From: Richard W.M. Jones Date: Thu, 23 Jun 2022 13:38:55 +0000 (+0100) Subject: illumos-lx: Fix test so it works under virtualization X-Git-Tag: v1.24~1 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=c1c52738122bd85fc2a165d8625a04926a74360d;p=virt-what.git illumos-lx: Fix test so it works under virtualization Tests need to provide dummy sbin/virt-what-cpuid-helper, dmidecode and uname. This ensures that if we are running the test suite under (eg) KVM, that virt-what doesn't discover this. The failure was: ./test.sh: test failed because output did not match expected Expected output was: ---------------------------------------- illumos-lx ---------------------------------------- But the actual output of the program was: ---------------------------------------- illumos-lx kvm ---------------------------------------- Fixes: commit 763cf1b1123136751b71f475610c5ac1eeaba0ad --- diff --git a/tests/illumos-lx/Makefile.am b/tests/illumos-lx/Makefile.am index b7f942a..88c4179 100644 --- a/tests/illumos-lx/Makefile.am +++ b/tests/illumos-lx/Makefile.am @@ -22,4 +22,7 @@ TESTS = test.sh EXTRA_DIST = \ test.sh \ proc/1/environ \ - proc/version + proc/version \ + sbin/dmidecode \ + sbin/uname \ + sbin/virt-what-cpuid-helper diff --git a/tests/illumos-lx/sbin/dmidecode b/tests/illumos-lx/sbin/dmidecode new file mode 100755 index 0000000..d9992ad --- /dev/null +++ b/tests/illumos-lx/sbin/dmidecode @@ -0,0 +1,6 @@ +#!/bin/sh - +cat <<'EOF' +# dmidecode 2.11 +/dev/mem: Operation not permitted +EOF +exit 1 diff --git a/tests/illumos-lx/sbin/uname b/tests/illumos-lx/sbin/uname new file mode 100755 index 0000000..ab0ec89 --- /dev/null +++ b/tests/illumos-lx/sbin/uname @@ -0,0 +1,2 @@ +#!/bin/sh - +echo x86_64 diff --git a/tests/illumos-lx/sbin/virt-what-cpuid-helper b/tests/illumos-lx/sbin/virt-what-cpuid-helper new file mode 100755 index 0000000..ad82504 --- /dev/null +++ b/tests/illumos-lx/sbin/virt-what-cpuid-helper @@ -0,0 +1,2 @@ +#!/bin/sh - +echo @