]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: net: lib: Fix jq parsing error
authorYue Haibing <yuehaibing@huawei.com>
Wed, 11 Feb 2026 02:21:46 +0000 (10:21 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Feb 2026 02:41:18 +0000 (18:41 -0800)
commit10ec0fc0ccc525abc807b0ca8ad5a26a0bd56361
tree28a4c66469d247d53c0e6220d82636a8ece9b900
parentfe6515f5952c166bdc4efa2090609e68018338a4
selftests: net: lib: Fix jq parsing error

The testcase failed as below:
$./vlan_bridge_binding.sh
...
+ adf_ip_link_set_up d1
+ local name=d1
+ shift
+ ip_link_is_up d1
+ ip_link_has_flag d1 UP
+ local name=d1
+ shift
+ local flag=UP
+ shift
++ ip -j link show d1
++ jq --arg flag UP 'any(.[].flags.[]; . == $flag)'
jq: error: syntax error, unexpected '[', expecting FORMAT or QQSTRING_START
 (Unix shell quoting issues?) at <top-level>, line 1:
any(.[].flags.[]; . == $flag)
jq: 1 compile error

Remove the extra dot (.) after flags array to fix this.

Fixes: 4baa1d3a5080 ("selftests: net: lib: Add ip_link_has_flag()")
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/20260211022146.190948-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib.sh