Commit 043b1643 authored by Zhengchao Shao's avatar Zhengchao Shao Committed by David S. Miller
Browse files

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: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent af649e7a
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
@@ -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"
        ]
    }
]