xref: /openbmc/linux/tools/testing/selftests/tc-testing/tc-tests/actions/xt.json (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1 [
2     {
3         "id": "2029",
4         "name": "Add xt action with log-prefix",
5         "category": [
6             "actions",
7             "xt"
8         ],
9         "setup": [
10             [
11                 "$TC actions flush action xt",
12                 0,
13                 1,
14                 255
15             ]
16         ],
17         "cmdUnderTest": "$TC action add action xt -j LOG --log-prefix PONG index 100",
18         "expExitCode": "0",
19         "verifyCmd": "$TC action ls action xt",
20         "matchPattern": "action order [0-9]*:.*target  LOG level warning prefix \"PONG\".*index 100 ref",
21         "matchCount": "1",
22         "teardown": [
23             "$TC actions flush action xt"
24         ]
25     },
26     {
27         "id": "3562",
28         "name": "Replace xt action log-prefix",
29         "category": [
30             "actions",
31             "xt"
32         ],
33         "setup": [
34             [
35                 "$TC actions flush action xt",
36                 0,
37                 1,
38                 255
39             ],
40             [
41                 "$TC action add action xt -j LOG --log-prefix PONG index 1",
42                 0,
43                 1,
44                 255
45             ]
46         ],
47         "cmdUnderTest": "$TC action replace action xt -j LOG --log-prefix WIN index 1",
48         "expExitCode": "0",
49         "verifyCmd": "$TC action get action xt index 1",
50         "matchPattern": "action order [0-9]*:.*target  LOG level warning prefix \"WIN\".*index 1 ref",
51         "matchCount": "1",
52         "teardown": [
53             "$TC action flush action xt"
54         ]
55     },
56     {
57         "id": "8291",
58         "name": "Delete xt action with valid index",
59         "category": [
60             "actions",
61             "xt"
62         ],
63         "setup": [
64             [
65                 "$TC actions flush action xt",
66                 0,
67                 1,
68                 255
69             ],
70             [
71                 "$TC action add action xt -j LOG --log-prefix PONG index 1000",
72                 0,
73                 1,
74                 255
75             ]
76         ],
77         "cmdUnderTest": "$TC action delete action xt index 1000",
78         "expExitCode": "0",
79         "verifyCmd": "$TC action get action xt index 1000",
80         "matchPattern": "action order [0-9]*:.*target  LOG level warning prefix \"PONG\".*index 1000 ref",
81         "matchCount": "0",
82         "teardown": [
83             "$TC action flush action xt"
84         ]
85     },
86     {
87         "id": "5169",
88         "name": "Delete xt action with invalid index",
89         "category": [
90             "actions",
91             "xt"
92         ],
93         "setup": [
94             [
95                 "$TC actions flush action xt",
96                 0,
97                 1,
98                 255
99             ],
100             [
101                 "$TC action add action xt -j LOG --log-prefix PONG index 1000",
102                 0,
103                 1,
104                 255
105             ]
106         ],
107         "cmdUnderTest": "$TC action delete action xt index 333",
108         "expExitCode": "255",
109         "verifyCmd": "$TC action get action xt index 1000",
110         "matchPattern": "action order [0-9]*:.*target  LOG level warning prefix \"PONG\".*index 1000 ref",
111         "matchCount": "1",
112         "teardown": [
113             "$TC action flush action xt"
114         ]
115     },
116     {
117         "id": "7284",
118         "name": "List xt actions",
119         "category": [
120             "actions",
121             "xt"
122         ],
123         "setup": [
124             [
125                 "$TC action flush action xt",
126                 0,
127                 1,
128                 255
129             ],
130             "$TC action add action xt -j LOG --log-prefix PONG index 1001",
131             "$TC action add action xt -j LOG --log-prefix WIN index 1002",
132             "$TC action add action xt -j LOG --log-prefix LOSE index 1003"
133         ],
134         "cmdUnderTest": "$TC action list action xt",
135         "expExitCode": "0",
136         "verifyCmd": "$TC action list action xt",
137         "matchPattern": "action order [0-9]*: tablename:",
138         "matchCount": "3",
139         "teardown": [
140             "$TC actions flush action xt"
141         ]
142     },
143     {
144         "id": "5010",
145         "name": "Flush xt actions",
146         "category": [
147             "actions",
148             "xt"
149         ],
150         "setup": [
151             [
152 		"$TC actions flush action xt",
153                 0,
154                 1,
155                 255
156             ],
157             "$TC action add action xt -j LOG --log-prefix PONG index 1001",
158             "$TC action add action xt -j LOG --log-prefix WIN index 1002",
159             "$TC action add action xt -j LOG --log-prefix LOSE index 1003"
160 	],
161         "cmdUnderTest": "$TC action flush action xt",
162         "expExitCode": "0",
163         "verifyCmd": "$TC action list action xt",
164         "matchPattern": "action order [0-9]*: tablename:",
165         "matchCount": "0",
166         "teardown": [
167             "$TC actions flush action xt"
168         ]
169     },
170     {
171         "id": "8437",
172         "name": "Add xt action with duplicate index",
173         "category": [
174             "actions",
175             "xt"
176         ],
177         "setup": [
178             [
179                 "$TC actions flush action xt",
180                 0,
181                 1,
182                 255
183             ],
184             "$TC action add action xt -j LOG --log-prefix PONG index 101"
185         ],
186         "cmdUnderTest": "$TC action add action xt -j LOG --log-prefix WIN index 101",
187         "expExitCode": "255",
188         "verifyCmd": "$TC action get action xt index 101",
189         "matchPattern": "action order [0-9]*:.*target  LOG level warning prefix \"PONG\".*index 101",
190         "matchCount": "1",
191         "teardown": [
192             "$TC action flush action xt"
193         ]
194     },
195     {
196         "id": "2837",
197         "name": "Add xt action with invalid index",
198         "category": [
199             "actions",
200             "xt"
201         ],
202         "setup": [
203             [
204                 "$TC actions flush action xt",
205                 0,
206                 1,
207                 255
208             ]
209         ],
210         "cmdUnderTest": "$TC action add action xt -j LOG --log-prefix WIN index 4294967296",
211         "expExitCode": "255",
212         "verifyCmd": "$TC action ls action xt",
213         "matchPattern": "action order [0-9]*:*target  LOG level warning prefix \"WIN\"",
214         "matchCount": "0",
215         "teardown": [
216             "$TC action flush action xt"
217         ]
218     }
219 ]
220