14 lines
1.2 KiB
Python
14 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""A bounded, no-network QEMU test; no host disks are attached."""
|
|
import pathlib,subprocess,sys
|
|
image=pathlib.Path(sys.argv[1] if len(sys.argv)>1 else 'build/open-agila.iso').resolve()
|
|
if not image.is_file():raise SystemExit('Build the ISO first with make boot.')
|
|
command=['qemu-system-x86_64','-machine','pc,accel=tcg','-cpu','qemu64','-m','64M','-smp','1','-display','none','-serial','stdio','-monitor','none','-nic','none','-no-reboot','-no-shutdown','-device','isa-debug-exit,iobase=0xf4,iosize=0x04','-cdrom',str(image)]
|
|
try:result=subprocess.run(command,capture_output=True,text=True,timeout=30)
|
|
except subprocess.TimeoutExpired as error:
|
|
print((error.stdout or b'').decode(errors='replace') if isinstance(error.stdout,bytes) else error.stdout or '')
|
|
raise SystemExit('FAIL: boot did not finish within 30 seconds')
|
|
print(result.stdout,end='');print(result.stderr,end='',file=sys.stderr)
|
|
if result.returncode!=33 or 'OPEN_AGILA_X86_64_ADA' not in result.stdout or 'ADA_PORTS_BOOT_TESTS_OK' not in result.stdout or 'AGILA_BOOT_OK' not in result.stdout:raise SystemExit('FAIL: missing boot proof or wrong QEMU exit status: '+str(result.returncode))
|
|
print('QEMU_BOOT_SMOKE_PASS')
|