summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
diff options
context:
space:
mode:
authorLucas Bates2017-06-16 23:22:35 +0200
committerDavid S. Miller2017-06-20 19:15:10 +0200
commit76b903ee198d7216af5de844fc6cc00d7ffd54fd (patch)
treebb6cae0c441c5e24d88e4732916d3815f7178383 /tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
parentMerge branch 'qed-RDMA-and-infrastructure-for-iWARP' (diff)
downloadkernel-qcow2-linux-76b903ee198d7216af5de844fc6cc00d7ffd54fd.tar.gz
kernel-qcow2-linux-76b903ee198d7216af5de844fc6cc00d7ffd54fd.tar.xz
kernel-qcow2-linux-76b903ee198d7216af5de844fc6cc00d7ffd54fd.zip
selftests: Introduce tc testsuite
Add the beginnings of a testsuite for tc functionality in the kernel. These are a series of unit tests that use the tc executable and verify the success of those commands by checking both the exit codes and the output from tc's 'show' operation. To run the tests: # cd tools/testing/selftests/tc-testing # sudo ./tdc.py You can specify the tc executable to use with the -p argument on the command line or editing the 'TC' variable in tdc_config.py. Refer to the README for full details on how to run. The initial complement of test cases are limited mostly to tc actions. Test cases are most welcome; see the creating-testcases subdirectory for help in creating them. Signed-off-by: Lucas Bates <lucasb@mojatatu.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/tc-testing/tc-tests/filters/tests.json')
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/filters/tests.json21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
new file mode 100644
index 000000000000..c727b96a59b0
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
@@ -0,0 +1,21 @@
+[
+ {
+ "id": "e9a3",
+ "name": "Add u32 with source match",
+ "category": [
+ "filter",
+ "u32"
+ ],
+ "setup": [
+ "$TC qdisc add dev $DEV1 ingress"
+ ],
+ "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol ip prio 1 u32 match ip src 127.0.0.1/32 flowid 1:1 action ok",
+ "expExitCode": "0",
+ "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
+ "matchPattern": "match 7f000002/ffffffff at 12",
+ "matchCount": "0",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 ingress"
+ ]
+ }
+] \ No newline at end of file