Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omnet/blob/main/om/tka/test/run.sh # omnet aien-dev/omnet Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omnet / om / tka / test / run.sh` 46 lines ยท 2140 bytes Raw Blame History 1 #!/bin/sh 2 set -eu 3 ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/../../.." && pwd) 4 OMC=${1:-} 5 if [ -z "$OMC" ]; then OMC=$("$ROOT/tools/omc.sh"); fi 6 GO=${TKA_GO:-${GO:-go}} 7 TMP=$(mktemp -d) 8 trap 'rm -rf "$TMP"' EXIT HUP INT TERM 9 cd "$ROOT/om/tka/test/oracle" 10 GOTOOLCHAIN=local "$GO" build -mod=readonly -o "$TMP/oracle" . 11 "$TMP/oracle" "$TMP/input" "$TMP/expected" "$ROOT/om/cbor/test/vectors" 12 cat "$ROOT/om/blake2s/blake2s.om" "$ROOT/om/sha512/sha512.om" "$ROOT/om/`ed25519`/`ed25519`.om" "$ROOT/om/cbor/cbor.om" > "$TMP/base.om" 13 cat "$TMP/base.om" "$ROOT/om/tka/tka.om" "$ROOT/om/tka/tkastate.om" "$ROOT/om/tka/tkapool.om" "$ROOT/om/tka/test/driver.om" > "$TMP/driver.om" 14 "$OMC" < "$TMP/driver.om" > "$TMP/driver" 15 chmod +x "$TMP/driver" 16 "$TMP/driver" < "$TMP/input" > "$TMP/actual" 17 python3 "$ROOT/om/tka/test/check.py" "$TMP/expected" "$TMP/actual" exact 18 python3 - "$TMP/driver.om" "$TMP/mutant.om" <<'PY' 19 import pathlib,sys 20 s=pathlib.Path(sys.argv[1]).read_text() 21 old='ret edverify pk msg 32 sg 1' 22 assert s.count(old)==1 23 pathlib.Path(sys.argv[2]).write_text(s.replace(old,'ret 1')) 24 PY 25 "$OMC" < "$TMP/mutant.om" > "$TMP/mutant" 26 chmod +x "$TMP/mutant" 27 "$TMP/mutant" < "$TMP/input" > "$TMP/mutant.actual" 28 python3 "$ROOT/om/tka/test/check.py" "$TMP/expected" "$TMP/mutant.actual" mutant 29 "$TMP/oracle" --fixture > "$TMP/fixture.json" 30 python3 - "$TMP/fixture.json" "$TMP/revocation.input" <<'PY' 31 import json,pathlib,struct,sys 32 v=json.loads(pathlib.Path(sys.argv[1]).read_text()) 33 b=bytearray() 34 for key in ("genesis","signature","node","removal"): 35 data=bytes.fromhex(v[key]) 36 if key != "node": 37 b.extend(struct.pack(" "$TMP/revocation.om" 42 "$OMC" < "$TMP/revocation.om" > "$TMP/revocation" 43 chmod +x "$TMP/revocation" 44 "$TMP/revocation" < "$TMP/revocation.input" 45 printf '%s\n' 'tka: PASS cross-unit node-signature revocation' 46 printf '%s\n' 'tka: PASS (differential model, authority, sync, signature mutant)'