Skip to content

Commit b8056f2

Browse files
liuhangbinPaolo Abeni
authored andcommitted
kselftest: rtnetlink.sh: use grep_fail when expecting the cmd fail
run_cmd_grep_fail should be used when expecting the cmd fail, or the ret will be set to 1, and the total test return 1 when exiting. This would cause the result report to fail if run via run_kselftest.sh. Before fix: # ./rtnetlink.sh -t kci_test_addrlft PASS: preferred_lft addresses have expired # echo $? 1 After fix: # ./rtnetlink.sh -t kci_test_addrlft PASS: preferred_lft addresses have expired # echo $? 0 Fixes: 9c2a19f ("kselftest: rtnetlink.sh: add verbose flag") Signed-off-by: Hangbin Liu <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent dade3f6 commit b8056f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/net/rtnetlink.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ kci_test_addrlft()
297297
done
298298

299299
sleep 5
300-
run_cmd_grep "10.23.11." ip addr show dev "$devdummy"
300+
run_cmd_grep_fail "10.23.11." ip addr show dev "$devdummy"
301301
if [ $? -eq 0 ]; then
302302
check_err 1
303303
end_test "FAIL: preferred_lft addresses remaining"

0 commit comments

Comments
 (0)