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

Kris Van Hees kris.van.hees at oracle.com
Fri Feb 24 03:21:44 UTC 2023


On Mon, Jan 30, 2023 at 04:36:14PM -0500, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees 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
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list