Subject: Re: [patch net-next v2 2/2] selftests: netdevsim: add devlink params tests

From: Jiri Pirko <[email-masked]>
Date: Thu, 15 Aug 2019 10:52:14 +0200

Thu, Aug 15, 2019 at 10:45:45AM CEST, [email-masked] wrote:
>Thu, Aug 15, 2019 at 03:09:00AM CEST, [email-masked] wrote:
>>On Wed, 14 Aug 2019 17:26:04 +0200, Jiri Pirko wrote:
>>> From: Jiri Pirko <[email-masked]>
>>> 
>>> Test recently added netdevsim devlink param implementation.
>>> 
>>> Signed-off-by: Jiri Pirko <[email-masked]>
>>> ---
>>> v1->v2:
>>> -using cmd_jq helper
>>
>>Still failing here :(
>>
>># ./devlink.sh 
>>TEST: fw flash test                                                 [ OK ]
>>TEST: params test                                                   [FAIL]
>>	Failed to get test1 param value
>>TEST: regions test                                                  [ OK ]
>>
>># jq --version
>>jq-1.5-1-a5b5cbe
>># echo '{ "a" : false }' | jq -e -r '.[]'
>>false
>># echo $?
>>1
>
>Odd, could you please try:
>$ jq --version
>jq-1.5
>$ echo '{"param":{"netdevsim/netdevsim11":[{"name":"test1","type":"driver-specific","values":[{"cmode":"driverinit","value":"false"}]}]}}' | jq -e -r '.[][][].values[] | select(.cmode == "driverinit").value'
>false
>$ echo $?
>0

Ah, it is not the jq version, it is the iproute2 version:
8257e6c49cca9847e01262f6e749c6e88e2ddb72

I'll think about how to fix this.

>
>
>>
>>On another machine:
>>
>>$ echo '{ "a" : false }' | jq -e -r '.[]'
>>false
>>$ echo $?
>>1
>>
>>Did you mean to drop the -e ?