[DTrace-devel] [PATCH 3/4] test: Do not return 1 for err.*.x checks
eugene.loh at oracle.com
eugene.loh at oracle.com
Fri Oct 4 04:43:54 UTC 2024
From: Eugene Loh <eugene.loh at oracle.com>
We can mark tests as expected to fail. In fact, with .x files,
we can mark XFAIL based on a runtime check.
For err.* tests, however, we are expected to fail anyhow. So,
having an err.*.x return 1 is at least confusing... certainly
for the runtest.sh script.
In practice, err.*.x files usually return only 0 or 2 -- that is,
we might elect to skip the test.
The sole exception is err.unloaded_var.x, which checks for
/lib/modules/$(uname -r)/kernel/fs/gfs2/gfs2.ko*. If this module
is missing, the test is supposed to fail, but as it is err.* it is
expected to fail anyhow. So the counterintuitive result is that
if the module is missing, the test produces XPASS.
Change this err.*.x file to skip the test if the module is missing.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
test/unittest/types/err.unloaded_var.x | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/unittest/types/err.unloaded_var.x b/test/unittest/types/err.unloaded_var.x
index 54c61d57d..cc63265a4 100755
--- a/test/unittest/types/err.unloaded_var.x
+++ b/test/unittest/types/err.unloaded_var.x
@@ -2,7 +2,7 @@
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
-# XFAIL if gfs2.ko not found (exit 1)
+# SKIP if gfs2.ko not found (exit 2)
[[ ! -e /lib/modules/$(uname -r)/kernel/fs/gfs2/gfs2.ko ]] &&
-[[ ! -e /lib/modules/$(uname -r)/kernel/fs/gfs2/gfs2.ko.xz ]] && exit 1;
+[[ ! -e /lib/modules/$(uname -r)/kernel/fs/gfs2/gfs2.ko.xz ]] && exit 2;
exit 0
--
2.43.5
More information about the DTrace-devel
mailing list