From c1c52738122bd85fc2a165d8625a04926a74360d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 23 Jun 2022 14:38:55 +0100 Subject: [PATCH] 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 --- tests/illumos-lx/Makefile.am | 5 ++++- tests/illumos-lx/sbin/dmidecode | 6 ++++++ tests/illumos-lx/sbin/uname | 2 ++ tests/illumos-lx/sbin/virt-what-cpuid-helper | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 tests/illumos-lx/sbin/dmidecode create mode 100755 tests/illumos-lx/sbin/uname create mode 100755 tests/illumos-lx/sbin/virt-what-cpuid-helper 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 @ -- 1.8.3.1