add an SMP lock-stress test case
Four pairs push 400k sequenced messages through small channels; checks FIFO order and cross-core execution. Verified to fail with the lock disabled.
This commit is contained in:
+9
-2
@@ -113,6 +113,12 @@ CASES = [
|
||||
"smp": 4,
|
||||
"expect": r"DANOS-TEST-RESULT: PASS",
|
||||
"fail": r"DANOS-TEST-RESULT: FAIL"},
|
||||
# Stress the big kernel lock across cores; heavier, so a longer timeout.
|
||||
{"name": "smp-stress",
|
||||
"smp": 4,
|
||||
"timeout": 90,
|
||||
"expect": r"DANOS-TEST-RESULT: PASS",
|
||||
"fail": r"DANOS-TEST-RESULT: FAIL"},
|
||||
{"name": "fault-ud", "expect": r"invalid opcode \(vector 6\)"},
|
||||
{"name": "fault-pf", "expect": r"page fault \(vector 14\)"},
|
||||
{"name": "fault-df", "expect": r"double fault \(vector 8\)"},
|
||||
@@ -184,7 +190,8 @@ def run_case(arch, case):
|
||||
cmd += ["-smp", str(case["smp"])]
|
||||
qemu = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
try:
|
||||
deadline = time.monotonic() + TIMEOUT
|
||||
timeout = case.get("timeout", TIMEOUT)
|
||||
deadline = time.monotonic() + timeout
|
||||
while time.monotonic() < deadline:
|
||||
time.sleep(0.2)
|
||||
text = ""
|
||||
@@ -199,7 +206,7 @@ def run_case(arch, case):
|
||||
if expect.search(text):
|
||||
return True, "matched " + repr(case["expect"])
|
||||
return False, "QEMU exited before matching (triple fault?)"
|
||||
return False, f"timed out after {TIMEOUT}s without matching {case['expect']!r}"
|
||||
return False, f"timed out after {timeout}s without matching {case['expect']!r}"
|
||||
finally:
|
||||
if qemu.poll() is None:
|
||||
qemu.terminate()
|
||||
|
||||
Reference in New Issue
Block a user