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/omega-gpu-driver/blob/main/tests/sec2_host.sh # omega-gpu-driver aien-dev/omega-gpu-driver 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 `omega-gpu-driver / tests / sec2_host.sh` 32 lines ยท 1427 bytes Raw Blame History 1 #!/bin/sh 2 # Unprivileged host-only vendor protocol replay. Never opens a device. 3 set -eu 4 R=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd) 5 OMC=${OMC:-$R/build/omc} 6 SEC2_OM=${SEC2_OM:-$R/gsp/sec2.om} 7 actual=$(sha256sum "$OMC"); actual=${actual%% *} 8 [ "$actual" = `bcfa582892afca8f65e551fe56867d918d86e84540c7381be8fa9ef18d0cf0f6` ] || exit 2 9 t=$(mktemp -d /tmp/sec2-host.XXXXXX) 10 trap 'rm -rf "$t"' EXIT HUP INT TERM 11 python3 - "$R" "$t" "$SEC2_OM" <<'PY' 12 import pathlib,sys 13 r,t,s=map(pathlib.Path,sys.argv[1:]) 14 units=['gsp/rpc.om','gsp/replay.om','gsp/sysinfo.om','chan/params.om','gsp/boot.om','gsp/arena.om','gsp/connect.om','gsp/profile.om','gsp/mmio.om','gsp/sim.om'] 15 text=''.join((r/p).read_text()+'\n' for p in units) 16 fixture=(r/'tests/arena_trace.om').read_text() 17 assert fixture.count('fn main to int')==1 18 text+=fixture.split('fn main to int')[0] 19 text+=s.read_text()+'\n'+(r/'gsp/sec2sim.om').read_text()+'\n'+(r/'tests/sec2_trace.om').read_text() 20 (t/'trace.om').write_text(text) 21 PY 22 "$OMC" < "$t/trace.om" > "$t/replay" 23 chmod +x "$t/replay" 24 python3 - "$t/replay" <<'PY' 25 import subprocess,sys 26 for m in range(15): 27 p=subprocess.run([sys.argv[1]],input=bytes([m]),capture_output=True,timeout=60) 28 if p.returncode: sys.exit(f'sec2_host: FAIL case {m} exit {p.returncode} {p.stderr!r}') 29 print(f'sec2_host: PASS case {m}') 30 print('sec2_host: HOST_EXERCISED; physical boot/RPC/compute NOT_RUN') 31 PY 32 sha256sum "$t/trace.om" "$t/replay"