Skip to content

Commit

Permalink
test: Check DTrace return status in pcap stdout tests
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed Feb 26, 2023
1 parent 3bc04c2 commit d26c97e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion test/unittest/pcap/tst.pcap.stdout-fork-error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -12,6 +12,8 @@
# skb->data.
#

# @@xfail: need ip provider

if (( $# != 1 )); then
echo "expected one argument: <dtrace-path>" >&2
exit 2
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion test/unittest/pcap/tst.pcap.stdout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -11,6 +11,8 @@
# skb->data.
#

# @@xfail: need ip provider

if (( $# != 1 )); then
echo "expected one argument: <dtrace-path>" >&2
exit 2
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d26c97e

Please sign in to comment.