[kvm-unit-tests PATCH] runtime: Skip tests if the target "kernel" file doesn't exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Skip the test if its target kernel/test file isn't available so that
skipping a test that isn't supported for a given config doesn't require
manually flagging the testcase in unittests.cfg.  This fixes "failures"
on x86 with CONFIG_EFI=y due to some tests not being built for EFI, but
not being annotated in x86/unittests.cfg.

Alternatively, testcases could be marked noefi (or efi-only), but that'd
require more manual effort, and there's no obvious advantage to doing so.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 scripts/runtime.bash | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index ee229631..a94d940d 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -150,6 +150,11 @@ function run()
         done
     fi
 
+    if [ ! -f "$kernel" ]; then
+        print_result "SKIP" $testname "" "Test file '$kernel' not found";
+        return 2;
+    fi
+
     log=$(premature_failure) && {
         skip=true
         if [ "${CONFIG_EFI}" == "y" ]; then

base-commit: 72d110d8286baf1b355301cc8c8bdb42be2663fb
-- 
2.49.0.1204.g71687c7c1d-goog





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux