tests: run.sh's bind test runs on the reference box's memory

run.sh refuses a 64 GB box since 6f6ef5e, and test_run_engine_bind ran it
with an environment of PATH and HOME only, so boxmem.py read the memory of
the machine the suite ran on: on a 64 GB DGX Spark its three tests failed
on that refusal (found in review, 2026-10-24). The test now writes the
reference box's MemTotal and passes it as QWEN38_MEMINFO, as the walled
install tests do.

Measured by a mutant: the test's own meminfo at 64 GB fails all three
tests on the refusal, and the unchanged copy beside it passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hasan BasbunarandClaude Opus 5.5 committed 2026-10-24 02:41:04 +02:00
1 parent da57cd7e54
commit 08d5845e0e
1 file changed
+6 -2
+6 -2
View File
@@ -6,7 +6,8 @@ run.sh runs the engine in the foreground with no proxy in front, and it passed
was open to anyone on the network holding the key, while SECURITY.md said it is not on
the network at all (found in review, 2026-09-24). This runs the real run.sh in a
throwaway HOME, with docker, systemctl, ss and nvidia-smi replaced by stubs, and reads
the `docker run` it execs."""
the `docker run` it execs. Its memory is the reference box's, by QWEN38_MEMINFO: run.sh refuses
a 64 GB box, and the test read the memory of the machine it ran on (found in review, 2026-10-24)."""
import pathlib
import re
import shutil
@@ -46,6 +47,8 @@ class TheEngineBind(unittest.TestCase):
snap.mkdir(parents=True)
(snap / "model.safetensors").write_text("w")
(snap / "config.json").write_text('{"architectures": ["X"]}')
self.meminfo = self.home / "meminfo"
self.meminfo.write_text("MemTotal: 127535272 kB\n")
self.bin = self.home / "bin"
self.bin.mkdir()
for name, body in STUBS.items():
@@ -54,7 +57,8 @@ class TheEngineBind(unittest.TestCase):
def run_sh(self, **env):
r = subprocess.run(["bash", str(REPO / "run.sh")], capture_output=True, text=True, timeout=60,
env={"PATH": f"{self.bin}:/usr/bin:/bin", "HOME": str(self.home), **env})
env={"PATH": f"{self.bin}:/usr/bin:/bin", "HOME": str(self.home),
"QWEN38_MEMINFO": str(self.meminfo), **env})
argv = self.home / "docker-run.argv"
return r, argv.read_text().split("\n") if argv.exists() else []