[DTrace-devel] [PATCH] test: if /proc/kallmodsyms does not exist, skip tests that require it
Kris Van Hees
kris.van.hees at oracle.com
Fri Jul 26 23:48:44 UTC 2024
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
test/unittest/aggs/tst.aggmod_full.x | 4 +++-
test/unittest/aggs/tst.aggmod_full2.x | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/test/unittest/aggs/tst.aggmod_full.x b/test/unittest/aggs/tst.aggmod_full.x
index 94239b47..955fb52a 100755
--- a/test/unittest/aggs/tst.aggmod_full.x
+++ b/test/unittest/aggs/tst.aggmod_full.x
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
-# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
@@ -12,6 +12,8 @@
# often of the form __key.*. If there are few (2-3), the bug is present
# and this test should not be run.
+[[ -r /proc/kallmodsyms ]] || exit 2
+
nzero=`awk '/ 0 /; / _end$/ || / __brk_limit$/ {exit(0);}' /proc/kallmodsyms | wc -l`
if [[ $nzero -lt 20 ]]; then
diff --git a/test/unittest/aggs/tst.aggmod_full2.x b/test/unittest/aggs/tst.aggmod_full2.x
index 2cc64c94..2e4c5900 100755
--- a/test/unittest/aggs/tst.aggmod_full2.x
+++ b/test/unittest/aggs/tst.aggmod_full2.x
@@ -20,6 +20,8 @@ fi
# often of the form __key.*. If there are few (2-3), the bug is present
# and this test should not be run.
+[[ -r /proc/kallmodsyms ]] || exit 2
+
nzero=`awk '/ 0 /; / _end$/ || / __brk_limit$/ {exit(0);}' /proc/kallmodsyms | wc -l`
if [[ $nzero -lt 20 ]]; then
--
2.45.2
More information about the DTrace-devel
mailing list