Skip to content

Commit 91a0e94

Browse files
committed
integration-test: skip the chv x86 run when kvm is unavailable
GitHub Actions runners do not expose /dev/kvm, so the x86 Cloud Hypervisor path cannot be treated as a hard requirement there. Only run that test when cloud-hypervisor is on PATH and /dev/kvm exists, and warn clearly otherwise instead of failing the suite.
1 parent 431cd9b commit 91a0e94

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

integration-test/x86/Makefile

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,27 @@ run_chv: | build
5050

5151
.PHONY: run_chv_if_supported
5252
run_chv_if_supported: | build
53-
cloud-hypervisor \
54-
--cpus boot=1 \
55-
--memory size=64M \
56-
--console off \
57-
--debug-console tty \
58-
--serial file=serial.chv.pio.txt \
59-
--kernel target/x86-unknown-none/release/kernel-x86.elf64 \
60-
2>cloud-hypervisor.stderr.txt; \
61-
rc=$$? ; \
62-
if [ $$rc -eq 0 ]; then \
63-
grep "hello from serial via x86 port I/O" ./serial.chv.pio.txt ; \
64-
elif grep -q "no supported hypervisor" ./cloud-hypervisor.stderr.txt; then \
65-
echo "Skipping Cloud Hypervisor test: no supported hypervisor" ; \
53+
if ! command -v cloud-hypervisor >/dev/null 2>&1; then \
54+
echo "WARNING: Skipping Cloud Hypervisor test because cloud-hypervisor is not in PATH." >&2 ; \
55+
elif [ ! -c /dev/kvm ]; then \
56+
echo "WARNING: Skipping Cloud Hypervisor test because /dev/kvm is not available." >&2 ; \
6657
else \
67-
echo "Cloud Hypervisor Test Run Failed. rc=$$rc" >&2 ; \
68-
cat ./cloud-hypervisor.stderr.txt >&2 ; \
69-
exit 1 ; \
58+
cloud-hypervisor \
59+
--cpus boot=1 \
60+
--memory size=64M \
61+
--console off \
62+
--debug-console tty \
63+
--serial file=serial.chv.pio.txt \
64+
--kernel target/x86-unknown-none/release/kernel-x86.elf64 \
65+
2>cloud-hypervisor.stderr.txt; \
66+
rc=$$? ; \
67+
if [ $$rc -eq 0 ]; then \
68+
grep "hello from serial via x86 port I/O" ./serial.chv.pio.txt ; \
69+
else \
70+
echo "Cloud Hypervisor Test Run Failed. rc=$$rc" >&2 ; \
71+
cat ./cloud-hypervisor.stderr.txt >&2 ; \
72+
exit 1 ; \
73+
fi ; \
7074
fi
7175

7276
.PHONY: run

0 commit comments

Comments
 (0)