[DTrace-devel] [PATCH 1/3] test: Check DTrace return status in pcap stdout tests

eugene.loh at oracle.com eugene.loh at oracle.com
Mon Jan 30 21:36:14 UTC 2023


From: Eugene Loh <eugene.loh at oracle.com>

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 test/unittest/pcap/tst.pcap.stdout-fork-error.sh | 9 ++++++++-
 test/unittest/pcap/tst.pcap.stdout.sh            | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/test/unittest/pcap/tst.pcap.stdout-fork-error.sh b/test/unittest/pcap/tst.pcap.stdout-fork-error.sh
index fc4a5b46..5681936a 100755
--- a/test/unittest/pcap/tst.pcap.stdout-fork-error.sh
+++ b/test/unittest/pcap/tst.pcap.stdout-fork-error.sh
@@ -2,7 +2,7 @@
 
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018, 2023, 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 @@
 # skb->data.
 #
 
+# @@xfail: need ip provider
+
 if (( $# != 1 )); then
 	echo "expected one argument: <dtrace-path>" >&2
 	exit 2
@@ -43,6 +45,11 @@ ip:::send
 }
 EODTRACE
 
+if [ $? -ne 0 ]; then
+	echo DTrace failed
+	exit 1
+fi
+
 rm -rf $tmpdir/failshark
 
 if [[ -f $file ]]; then
diff --git a/test/unittest/pcap/tst.pcap.stdout.sh b/test/unittest/pcap/tst.pcap.stdout.sh
index ee750722..bb0dc242 100755
--- a/test/unittest/pcap/tst.pcap.stdout.sh
+++ b/test/unittest/pcap/tst.pcap.stdout.sh
@@ -2,7 +2,7 @@
 
 #
 # Oracle Linux DTrace.
-# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018, 2023, 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,6 +11,8 @@
 # skb->data.
 #
 
+# @@xfail: need ip provider
+
 if (( $# != 1 )); then
 	echo "expected one argument: <dtrace-path>" >&2
 	exit 2
@@ -38,6 +40,11 @@ ip:::send
 }
 EODTRACE
 
+if [ $? -ne 0 ]; then
+	echo DTrace failed
+	exit 1
+fi
+
 if [[ -f $file ]]; then
 	pcapline=""
 	while read line ; do
-- 
2.18.4




More information about the DTrace-devel mailing list