htest: service boilerplate for secondary VMs.
In order to keep it easy to add tests, we need to avoid requiring new
VMs for each case as this will lead to an explosion of duplication and
build artifacts.
Allowing secondary VMs to contain selectable services for different
tests means they don't each require a separate VM and run into resource
limits. The resulting services are also avoid boilerplate so the source
gets to the point of the test more easily.
The primary VMs are also refactored to encourage splitting tests across
file but bundling them into the same VM so as to cut down on build
artifacts and make it easier to find and run tests.
Assertions can now be used in any context of a test, including in a test
service.
Change-Id: Id3b8a7579d0facdfceb9d77f62ef57241b31a88a
diff --git a/test/hftest/hftest.py b/test/hftest/hftest.py
index 4a00a52..2a2a07e 100755
--- a/test/hftest/hftest.py
+++ b/test/hftest/hftest.py
@@ -35,12 +35,12 @@
def qemu(image, initrd, args, log):
qemu_args = [
"timeout", "--foreground", "5s",
- "./prebuilts/linux-x64/qemu/qemu-system-aarch64", "-M", "virt,gic_version=3", "-cpu",
- "cortex-a57", "-smp", "4", "-m", "16M", "-machine", "virtualization=true",
+ "./prebuilts/linux-x64/qemu/qemu-system-aarch64", "-M", "virt,gic_version=3",
+ "-cpu", "cortex-a57", "-smp", "4", "-m", "16M", "-machine", "virtualization=true",
"-nographic", "-nodefaults", "-serial", "stdio", "-kernel", image,
]
if initrd:
- qemu_args += ["-initrd", initrd]
+ qemu_args += ["-initrd", initrd]
if args:
qemu_args += ["-append", args]
# Save the log to a file.
@@ -132,7 +132,8 @@
sponge_log.write(out)
sponge_log.write("\r\n\r\n")
hftest_out = hftest_lines(out)
- if hftest_out[-1] == "PASS":
+ if hftest_out[-1] == "FINISHED" and not any(
+ l.startswith('Failure:') for l in hftest_out):
print(" PASS")
else:
failures_from_suite += 1