summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json
blob: ef7ca4a6775bcbd70c58df6cd43537b3b809557a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
[
    {
        "id": "d710",
        "name": "Release tail references after first action deletion fails",
        "category": [
            "actions",
            "gact"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            [
                "$TC actions flush action gact",
                0,
                1,
                255
            ],
            "$TC qdisc add dev $DEV1 ingress",
            "$TC actions add action pass index 1",
            "$TC actions add action pass index 2",
            "$TC actions add action pass index 3",
            "$TC filter add dev $DEV1 protocol ip ingress u32 match u32 0 0 action gact index 1"
        ],
        "cmdUnderTest": "$TC actions del action gact index 1 action gact index 2 action gact index 3",
        "expExitCode": "255",
        "verifyCmd": "$TC actions ls action gact",
        "matchPattern": "total acts 3\\b.*index 1 ref 2 bind 1\\b.*index 2 ref 1 bind 0\\b.*index 3 ref 1 bind 0\\b",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV1 ingress",
            [
                "$TC actions flush action gact",
                0,
                1,
                255
            ]
        ]
    },
    {
        "id": "d711",
        "name": "Release tail references after middle action deletion fails",
        "category": [
            "actions",
            "gact"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            [
                "$TC actions flush action gact",
                0,
                1,
                255
            ],
            "$TC qdisc add dev $DEV1 ingress",
            "$TC actions add action pass index 1",
            "$TC actions add action pass index 2",
            "$TC actions add action pass index 3",
            "$TC filter add dev $DEV1 protocol ip ingress u32 match u32 0 0 action gact index 2"
        ],
        "cmdUnderTest": "$TC actions del action gact index 1 action gact index 2 action gact index 3",
        "expExitCode": "255",
        "verifyCmd": "$TC actions ls action gact",
        "matchPattern": "total acts 2\\b.*index 2 ref 2 bind 1\\b.*index 3 ref 1 bind 0\\b",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV1 ingress",
            [
                "$TC actions flush action gact",
                0,
                1,
                255
            ]
        ]
    },
    {
        "id": "d713",
        "name": "Delete a tail action once after a failed batch",
        "category": [
            "actions",
            "gact"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            [
                "$TC actions flush action gact",
                0,
                1,
                255
            ],
            "$TC qdisc add dev $DEV1 ingress",
            "$TC actions add action pass index 1",
            "$TC actions add action pass index 2",
            "$TC filter add dev $DEV1 protocol ip ingress u32 match u32 0 0 action gact index 1"
        ],
        "cmdUnderTest": "$TC actions del action gact index 1 action gact index 2",
        "expExitCode": "255",
        "verifyCmd": "sh -c '$TC actions del action gact index 2 && $TC actions ls action gact'",
        "matchPattern": "total acts 1\\b.*index 1 ref 2 bind 1\\b",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV1 ingress",
            [
                "$TC actions flush action gact",
                0,
                1,
                255
            ]
        ]
    }
]