[DTrace-devel] [PATCH 3/3] Add a probe to test/unittest/pragma/*libdep* tests
eugene.loh at oracle.com
eugene.loh at oracle.com
Wed Feb 24 09:12:03 PST 2021
From: Eugene Loh <eugene.loh at oracle.com>
These tests check library dependencies. Apparently, it was
sufficient with earlier implementations to invoke "dtrace -e"
with no probes to check such dependencies, but that is not true
currently. Further, there seems little point in checking library
dependencies if there are no probes. In any case, library dependencies
in the absence of probes is undefined.
Add a simple probe to the libdep tests. That way, these tests will not
rely on undefined behavior with regards to what library dependencies mean
in the presence of no probes.
Note that depends_on is not actually documented at all!
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
test/unittest/pragma/err.circlibdep.sh | 5 ++---
test/unittest/pragma/err.invalidlibdep.sh | 5 ++---
test/unittest/pragma/tst.libdep.sh | 4 ++--
test/unittest/pragma/tst.libdepfullyconnected.sh | 5 ++---
4 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/test/unittest/pragma/err.circlibdep.sh b/test/unittest/pragma/err.circlibdep.sh
index 8be5e115..f2b1397d 100755
--- a/test/unittest/pragma/err.circlibdep.sh
+++ b/test/unittest/pragma/err.circlibdep.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
-# Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2021, 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.
#
@@ -9,7 +9,6 @@ if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
fi
-# @@xfail: dtv2
libdir=$tmpdir/libdep.$$
dtrace=$1
@@ -31,7 +30,7 @@ EOF
setup_libs
-$dtrace $dt_flags -L$libdir -e
+$dtrace $dt_flags -L$libdir -e -n 'BEGIN {exit(0)}'
status=$?
rm -rf $libdir
diff --git a/test/unittest/pragma/err.invalidlibdep.sh b/test/unittest/pragma/err.invalidlibdep.sh
index bbe3988e..f4090de9 100755
--- a/test/unittest/pragma/err.invalidlibdep.sh
+++ b/test/unittest/pragma/err.invalidlibdep.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
-# Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2021, 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.
#
@@ -9,7 +9,6 @@ if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
fi
-# @@xfail: dtv2
libdir=$tmpdir/libdep.$$
dtrace=$1
@@ -31,7 +30,7 @@ EOF
setup_libs
-$dtrace $dt_flags -L$libdir -e
+$dtrace $dt_flags -L$libdir -e -n 'BEGIN {exit(0)}'
status=$?
rm -rf $libdir
diff --git a/test/unittest/pragma/tst.libdep.sh b/test/unittest/pragma/tst.libdep.sh
index 32c465f8..8f48568a 100755
--- a/test/unittest/pragma/tst.libdep.sh
+++ b/test/unittest/pragma/tst.libdep.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
-# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2021, 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.
#
@@ -38,7 +38,7 @@ EOF
setup_libs
-$dtrace $dt_flags -L$libdir -e
+$dtrace $dt_flags -L$libdir -e -n 'BEGIN {exit(0)}'
status=$?
rm -rf $libdir
diff --git a/test/unittest/pragma/tst.libdepfullyconnected.sh b/test/unittest/pragma/tst.libdepfullyconnected.sh
index 19b017c5..fd111ada 100755
--- a/test/unittest/pragma/tst.libdepfullyconnected.sh
+++ b/test/unittest/pragma/tst.libdepfullyconnected.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
-# Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2021, 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.
#
@@ -11,7 +11,6 @@
# guarantee consistent ordering as no nodes in the dependency graph will
# be isolated.
#
-# @@xfail: dtv2
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@@ -44,7 +43,7 @@ EOF
setup_libs
-DTRACE_DEBUG=1 $dtrace $dt_flags -L$libdir -e >$tmpfile 2>&1
+DTRACE_DEBUG=1 $dtrace $dt_flags -L$libdir -e -n 'BEGIN {exit(0)}' >$tmpfile 2>&1
perl /dev/stdin $tmpfile <<EOF
--
2.18.4
More information about the DTrace-devel
mailing list