runtime: Skip tests if the target "kernel" file doesn't exist
Sean Christopherson
reviewerPATCH 1/1 runtime: Skip tests if the target "kernel" file doesn't exist
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.
--- scripts/runtime.bash | 5 +++++ 1 file changed, 5 insertions(+)
scripts/runtime.bash +5 -0
@@ -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
Signature · 1 line
2.49.0.1204.g71687c7c1d-goog
Quoted 19 lines · Sean Christopherson
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=ydue 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 <[email protected]>--- scripts/runtime.bash | 5 +++++ 1 file changed, 5 insertions(+)scripts/runtime.bash +0
-0
scripts/runtime.bash function run() · line 157
Quoted 8 lines
scripts/runtime.bash +5
-0@@ -150,6 +150,11 @@ function run() done fi + if [ ! -f "$kernel" ]; then + print_result "SKIP" $testname "" "Test file '$kernel' not found"; + return 2; + fi +
I see mkstandalone.sh already has something like this. There's still one other place, though, which is print_testname(). Should we filter tests from the listing that are missing their kernels?
Thanks,
drew
Quoted 8 lines
scripts/runtime.bash +0
-0log=$(premature_failure) && { skip=true if [ "${CONFIG_EFI}" == "y" ]; thenbase-commit:
72d110d8286baf1b355301cc8c8bdb42be2663fbSignature · 1 line
2.49.0.1204.g71687c7c1d-goog
Sean Christopherson
reviewerQuoted 23 lines · Andrew Jones
Quoted 22 lines · Sean Christopherson
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=ydue 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 <[email protected]>--- scripts/runtime.bash | 5 +++++ 1 file changed, 5 insertions(+)scripts/runtime.bash +0
-0@@ -150,6 +150,11 @@ function run() done fi
Quoted 9 lines
scripts/runtime.bash function run() · line 157
Quoted 5 lines
scripts/runtime.bash +5
-0+ if [ ! -f "$kernel" ]; then + print_result "SKIP" $testname "" "Test file '$kernel' not found"; + return 2; + fi +I see
mkstandalone.shalready has something like this. There's still one other place, though, which isprint_testname(). Should we filter tests from the listing that are missing their kernels?
Huh, TIL you can list testcases :-)
I would say no? Because then listing testcases would depend on a successful build, which would be annoying in a variety of scenarios.
It would also be weird to list testcases that are excluded based on e.g. arch, but not list testcases that are effectively excluded via Makefile.
Andrew Jones
Reviewed-byQuoted 34 lines · Sean Christopherson
Quoted 23 lines · Andrew Jones
Quoted 22 lines · Sean Christopherson
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=ydue 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 <[email protected]>--- scripts/runtime.bash | 5 +++++ 1 file changed, 5 insertions(+)scripts/runtime.bash +0
-0@@ -150,6 +150,11 @@ function run() done fiQuoted 9 lines
scripts/runtime.bash function run() · line 157
Quoted 5 lines
scripts/runtime.bash +5
-0+ if [ ! -f "$kernel" ]; then + print_result "SKIP" $testname "" "Test file '$kernel' not found"; + return 2; + fi +I see
mkstandalone.shalready has something like this. There's still one other place, though, which isprint_testname(). Should we filter tests from the listing that are missing their kernels?
Quoted 7 lines
Huh, TIL you can list testcases :-)
I would say no? Because then listing testcases would depend on a successful build, which would be annoying in a variety of scenarios.
It would also be weird to list testcases that are excluded based on e.g. arch, but not list testcases that are effectively excluded via
Makefile.
Sounds reasonable.
Thanks,
drew
Quoted 10 lines · Sean Christopherson
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=ydue 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.
[...]
Applied to kvm-x86 next, thanks!
[1/1] runtime: Skip tests if the target "kernel" file doesn't exist
https://github.com/kvm-x86/kvm-unit-tests/commit/7f528c1b474c