[DTrace-devel] [PATCH 1/6] test: add back a simple module loader.

Nick Alcock nick.alcock at oracle.com
Wed Apr 19 15:41:26 UTC 2023


This lets us use modules that may or may not exist on the test system.
(In all such cases, a .x file must check for the existence of the
module.)

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 runtest.sh                       | 10 ++++++++++
 test/modules                     | 12 +++---------
 test/unittest/scalars/tst.misc.d |  1 -
 test/unittest/scalars/tst.misc.x | 11 +++++++++++
 4 files changed, 24 insertions(+), 10 deletions(-)
 create mode 100755 test/unittest/scalars/tst.misc.x

diff --git a/runtest.sh b/runtest.sh
index 261db3b84e3d3..6ae2ed92af792 100755
--- a/runtest.sh
+++ b/runtest.sh
@@ -23,6 +23,14 @@ arch="$(uname -m)"
 
 [[ -f ./runtest.conf ]] && . ./runtest.conf
 
+load_modules()
+{
+    # If running as root, pull in appropriate modules
+    if [[ "x$(id -u)" = "x0" ]]; then
+	cat test/modules | xargs -rn 1 modprobe 2>/dev/null
+    fi
+}
+
 #
 # Utility function to ensure a given provider is present.
 # Uses the providers list written out at start time.
@@ -626,6 +634,8 @@ if [[ -n $NOBADDOF ]]; then
     fi
 fi
 
+load_modules
+
 if [[ -z $NOBADDOF ]]; then
     # Run DOF-corruption tests instead.
 
diff --git a/test/modules b/test/modules
index c060a479e0ba1..db6900ca2ba98 100644
--- a/test/modules
+++ b/test/modules
@@ -1,9 +1,3 @@
-##unload-only dtrace
-dt_test
-profile
-systrace
-sdt
-fbt
-fasttrap
-ext4 # unload-quietly
-isofs # unload-quietly
+ext4
+isofs
+rds
diff --git a/test/unittest/scalars/tst.misc.d b/test/unittest/scalars/tst.misc.d
index f1541d5ee8877..60edab45ecced 100644
--- a/test/unittest/scalars/tst.misc.d
+++ b/test/unittest/scalars/tst.misc.d
@@ -4,7 +4,6 @@
  * Licensed under the Universal Permissive License v 1.0 as shown at
  * http://oss.oracle.com/licenses/upl.
  */
-/* @@xfail: dtv2 */
 
 /*
  * ASSERTION:
diff --git a/test/unittest/scalars/tst.misc.x b/test/unittest/scalars/tst.misc.x
new file mode 100755
index 0000000000000..06e1b0ca892cc
--- /dev/null
+++ b/test/unittest/scalars/tst.misc.x
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! $(grep -q '^isofs ' /proc/modules); then
+    exit 1
+fi
+
+if ! $(grep -q '^ext4 ' /proc/modules); then
+    exit 1
+fi
+
+exit 0
-- 
2.39.1.268.g9de2f9a303




More information about the DTrace-devel mailing list