Re: [DTrace-devel] [PATCH] test: skip D return() action for kernels without support
Eugene Loh <[email protected]>
| Newsgroups | dev.linux.lists.dtrace |
|---|---|
| Message-ID | <[email protected]> |
Reviewed-by: Eugene Loh <[email protected]> On 10/15/25 12:13, Kris Van Hees via DTrace-devel wrote: > Most of the err.* tests can still be run, since they test other failure > modes. > > > 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