[DTrace-devel] [PATCH] test: skip D return() action for kernels without support

Kris Van Hees kris.van.hees at oracle.com
Wed Oct 15 16:13:06 UTC 2025


Most of the err.* tests can still be run, since they test other failure
modes.

Suggested-by: Eugene Loh <eugene.loh at oracle.com>
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 test/unittest/actions/return/err.destructive.x    |  1 +
 test/unittest/actions/return/tst.destructive.x    | 15 +++++++++++++++
 .../actions/return/tst.override-getpid-entry.x    |  1 +
 .../actions/return/tst.override-getpid-return.x   |  1 +
 4 files changed, 18 insertions(+)
 create mode 120000 test/unittest/actions/return/err.destructive.x
 create mode 100755 test/unittest/actions/return/tst.destructive.x
 create mode 120000 test/unittest/actions/return/tst.override-getpid-entry.x
 create mode 120000 test/unittest/actions/return/tst.override-getpid-return.x

diff --git a/test/unittest/actions/return/err.destructive.x b/test/unittest/actions/return/err.destructive.x
new file mode 120000
index 00000000..36e16002
--- /dev/null
+++ b/test/unittest/actions/return/err.destructive.x
@@ -0,0 +1 @@
+tst.destructive.x
\ No newline at end of file
diff --git a/test/unittest/actions/return/tst.destructive.x b/test/unittest/actions/return/tst.destructive.x
new file mode 100755
index 00000000..3157408b
--- /dev/null
+++ b/test/unittest/actions/return/tst.destructive.x
@@ -0,0 +1,15 @@
+#!/bin/bash
+#
+# Oracle Linux DTrace.
+# Copyright (c) 2025, 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.
+
+# Verify that the return() action can be used on the current kernel, i.e. that
+# function error injection and BPF kprobe override is enabled.
+
+if [[ -r /sys/kernel/debug/error_injection/list ]]; then
+	exit 0
+else
+	exit 2
+fi
diff --git a/test/unittest/actions/return/tst.override-getpid-entry.x b/test/unittest/actions/return/tst.override-getpid-entry.x
new file mode 120000
index 00000000..36e16002
--- /dev/null
+++ b/test/unittest/actions/return/tst.override-getpid-entry.x
@@ -0,0 +1 @@
+tst.destructive.x
\ No newline at end of file
diff --git a/test/unittest/actions/return/tst.override-getpid-return.x b/test/unittest/actions/return/tst.override-getpid-return.x
new file mode 120000
index 00000000..36e16002
--- /dev/null
+++ b/test/unittest/actions/return/tst.override-getpid-return.x
@@ -0,0 +1 @@
+tst.destructive.x
\ No newline at end of file
-- 
2.51.0




More information about the DTrace-devel mailing list