diff options
author | Zhengchao Shao <shaozhengchao@huawei.com> | 2022-09-09 04:29:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-09-16 16:25:16 +0300 |
commit | 043b16435f3d9b32e26df528c0528052b053869e (patch) | |
tree | 6666c0f9641b5a97b842d060eb66d050db53fc32 /tools | |
parent | af649e7a6a53fe5f2e21d930d1d1cc3b19310f11 (diff) | |
download | linux-043b16435f3d9b32e26df528c0528052b053869e.tar.xz |
selftests/tc-testings: add nat action deleting test case
Test b811: Delete nat action with valid index
Test a521: Delete nat action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/tc-testing/tc-tests/actions/nat.json | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json b/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json index bc12c1ccad30..0a3c491edbc5 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json @@ -614,5 +614,55 @@ "teardown": [ "$TC actions flush action nat" ] + }, + { + "id": "b811", + "name": "Delete nat action with valid index", + "category": [ + "actions", + "nat" + ], + "setup": [ + [ + "$TC actions flush action nat", + 0, + 1, + 255 + ], + "$TC actions add action nat ingress 1.1.1.1 2.2.2.2 drop index 20" + ], + "cmdUnderTest": "$TC actions del action nat index 20", + "expExitCode": "0", + "verifyCmd": "$TC actions ls action nat index 20", + "matchPattern": "action order [0-9]+: nat ingress 1.1.1.1/32 2.2.2.2 drop.*index 20 ref", + "matchCount": "0", + "teardown": [ + "$TC actions flush action nat" + ] + }, + { + "id": "a521", + "name": "Delete nat action with invalid index", + "category": [ + "actions", + "nat" + ], + "setup": [ + [ + "$TC actions flush action nat", + 0, + 1, + 255 + ], + "$TC actions add action nat ingress 1.1.1.1 2.2.2.2 drop index 20" + ], + "cmdUnderTest": "$TC actions del action nat index 10", + "expExitCode": "255", + "verifyCmd": "$TC actions ls action nat index 20", + "matchPattern": "action order [0-9]+: nat ingress 1.1.1.1/32 2.2.2.2 drop.*index 20 ref", + "matchCount": "1", + "teardown": [ + "$TC actions flush action nat" + ] } ] |