lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190813154108.30509472@cakuba.netronome.com>
Date:   Tue, 13 Aug 2019 15:41:08 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Jiri Pirko <jiri@...nulli.us>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, mlxsw@...lanox.com
Subject: Re: [patch net-next] selftests: netdevsim: add devlink params tests

On Tue, 13 Aug 2019 15:04:46 +0200, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@...lanox.com>
> 
> Test recently added netdevsim devlink param implementation.
> 
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>

Thanks for the test, but it doesn't pass here:

TEST: fw flash test                                                 [ OK ]
TEST: params test                                                   [FAIL]
	Failed to get test1 param value

> diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
> index 9d8baf5d14b3..858ebdc8d8a3 100755
> --- a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
> +++ b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
> @@ -3,7 +3,7 @@
>  
>  lib_dir=$(dirname $0)/../../../net/forwarding
>  
> -ALL_TESTS="fw_flash_test"
> +ALL_TESTS="fw_flash_test params_test"
>  NUM_NETIFS=0
>  source $lib_dir/lib.sh
>  
> @@ -30,6 +30,66 @@ fw_flash_test()
>  	log_test "fw flash test"
>  }
>  
> +param_get()
> +{
> +	local name=$1
> +
> +	devlink dev param show $DL_HANDLE name $name -j | \
> +		jq -e -r '.[][][].values[] | select(.cmode == "driverinit").value'

                   ^^

The -e makes jq set exit code to 1 when test1 param is false.

Quoting the man page:

       ยท   -e / --exit-status:

           Sets the exit status of jq to 0 if the last output values
           was neither false nor null, 1 if the last output value was
           either false or  null,  or  4  if  no valid  result  was
           ever produced. Normally jq exits with 2 if there was any
           usage problem or system error, 3 if there was a jq program
           compile error, or 0 if the jq program ran.

Without the -e all is well:

# ./devlink.sh 
TEST: fw flash test                                                 [ OK ]
TEST: params test                                                   [ OK ]

> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ