Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tc-testing: fix tdc tests for 'bpf' action

- correct a typo in the value of 'matchPattern' of test 282d, potentially
causing false negative
- allow errors when 'teardown' executes '$TC action flush action bpf' in
test 282d, to fix false positive when it is run with act_bpf unloaded
- correct the value of 'matchPattern' in test e939, causing false positive
in case the BPF JIT is enabled

Fixes: 440ea4ae1828 ("tc-testing: add selftests for 'bpf' action")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Lucas Bates <lucasb@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Davide Caratti and committed by
David S. Miller
f7017caf 6ad4e91c

+8 -3
+8 -3
tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json
··· 66 66 "cmdUnderTest": "$TC action add action bpf object-file _b.o index 667", 67 67 "expExitCode": "0", 68 68 "verifyCmd": "$TC action get action bpf index 667", 69 - "matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id [0-9]* tag 3b185187f1855c4c default-action pipe.*index 667 ref", 69 + "matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id [0-9]* tag 3b185187f1855c4c( jited)? default-action pipe.*index 667 ref", 70 70 "matchCount": "1", 71 71 "teardown": [ 72 72 "$TC action flush action bpf", ··· 92 92 "cmdUnderTest": "$TC action add action bpf object-file _c.o index 667", 93 93 "expExitCode": "255", 94 94 "verifyCmd": "$TC action get action bpf index 667", 95 - "matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id [0-9].*index 667 ref", 95 + "matchPattern": "action order [0-9]*: bpf _c.o:\\[action\\] id [0-9].*index 667 ref", 96 96 "matchCount": "0", 97 97 "teardown": [ 98 - "$TC action flush action bpf", 98 + [ 99 + "$TC action flush action bpf", 100 + 0, 101 + 1, 102 + 255 103 + ], 99 104 "rm -f _c.o" 100 105 ] 101 106 },