xref: /linux/tools/testing/selftests/tc-testing/tc-tests/actions/gate.json (revision fd7d598270724cc787982ea48bbe17ad383a8b7f)
1[
2    {
3        "id": "5153",
4        "name": "Add gate action with priority and sched-entry",
5        "category": [
6            "actions",
7            "gate"
8        ],
9        "setup": [
10            [
11                "$TC action flush action gate",
12                0,
13                1,
14                255
15            ]
16        ],
17        "cmdUnderTest": "$TC action add action gate priority 1 sched-entry close 100000000ns index 100",
18        "expExitCode": "0",
19        "verifyCmd": "$TC action get action gate index 100",
20        "matchPattern": "action order [0-9]*: .*priority 1.*index 100 ref",
21        "matchCount": "1",
22        "teardown": [
23            "$TC action flush action gate"
24        ]
25    },
26    {
27        "id": "7189",
28        "name": "Add gate action with base-time",
29        "category": [
30            "actions",
31            "gate"
32        ],
33        "setup": [
34            [
35                "$TC actions flush action gate",
36                0,
37                1,
38                255
39            ]
40        ],
41        "cmdUnderTest": "$TC action add action gate base-time 200000000000ns sched-entry close 100000000ns index 10",
42        "expExitCode": "0",
43        "verifyCmd": "$TC action ls action gate",
44        "matchPattern": "action order [0-9]*: .*base-time 200s.*index 10 ref",
45        "matchCount": "1",
46        "teardown": [
47            "$TC actions flush action gate"
48        ]
49    },
50    {
51        "id": "a721",
52        "name": "Add gate action with cycle-time",
53        "category": [
54            "actions",
55            "gate"
56        ],
57        "setup": [
58            [
59                "$TC action flush action gate",
60                0,
61                1,
62                255
63            ]
64        ],
65        "cmdUnderTest": "$TC action add action gate cycle-time 200000000000ns sched-entry close 100000000ns index 1000",
66        "expExitCode": "0",
67        "verifyCmd": "$TC action ls action gate",
68        "matchPattern": "action order [0-9]*: .*cycle-time 200s.*index 1000 ref",
69        "matchCount": "1",
70        "teardown": [
71            "$TC action flush action gate"
72        ]
73    },
74    {
75        "id": "c029",
76        "name": "Add gate action with cycle-time-ext",
77        "category": [
78            "actions",
79            "gate"
80        ],
81        "setup": [
82            [
83                "$TC action flush action gate",
84                0,
85                1,
86                255
87            ]
88        ],
89        "cmdUnderTest": "$TC action add action gate cycle-time-ext 20000000000ns sched-entry close 100000000ns index 1000",
90        "expExitCode": "0",
91        "verifyCmd": "$TC action get action gate index 1000",
92        "matchPattern": "action order [0-9]*: .*cycle-time-ext 20s.*index 1000 ref",
93        "matchCount": "1",
94        "teardown": [
95            "$TC action flush action gate"
96        ]
97    },
98    {
99        "id": "3719",
100        "name": "Replace gate base-time action",
101        "category": [
102            "actions",
103            "gate"
104        ],
105        "setup": [
106            [
107                "$TC actions flush action gate",
108                0,
109                1,
110                255
111            ],
112            [
113                "$TC action add action gate base-time 200000000000ns sched-entry open 200000000ns -1 8000000b index 20",
114                0,
115                1,
116                255
117            ]
118        ],
119        "cmdUnderTest": "$TC action replace action gate base-time 400000000000ns index 20",
120        "expExitCode": "0",
121        "verifyCmd": "$TC action get action gate index 20",
122        "matchPattern": "action order [0-9]*: .*base-time 400s.*index 20 ref",
123        "matchCount": "1",
124        "teardown": [
125            "$TC action flush action gate"
126        ]
127    },
128    {
129        "id": "d821",
130        "name": "Delete gate action with valid index",
131        "category": [
132            "actions",
133            "gate"
134        ],
135        "setup": [
136            [
137                "$TC actions flush action gate",
138                0,
139                1,
140                255
141            ],
142            [
143                "$TC action add action gate base-time 200000000000ns sched-entry open 200000000ns -1 8000000b index 302",
144                0,
145                1,
146                255
147            ]
148        ],
149        "cmdUnderTest": "$TC action delete action gate index 302",
150        "expExitCode": "0",
151        "verifyCmd": "$TC action get action bpf index 302",
152        "matchPattern": "action order [0-9]*: .*base-time 200s.*index 302 ref",
153        "matchCount": "0",
154        "teardown": [
155            "$TC action flush action gate"
156        ]
157    },
158    {
159        "id": "3128",
160        "name": "Delete gate action with invalid index",
161        "category": [
162            "actions",
163            "gate"
164        ],
165        "setup": [
166            [
167                "$TC actions flush action gate",
168                0,
169                1,
170                255
171            ],
172            [
173                "$TC action add action gate base-time 600000000000ns sched-entry open 200000000ns -1 8000000b index 999",
174                0,
175                1,
176                255
177            ]
178        ],
179        "cmdUnderTest": "$TC action delete action gate index 333",
180        "expExitCode": "255",
181        "verifyCmd": "$TC action get action gate index 999",
182        "matchPattern": "action order [0-9]*: .*base-time 600s.*index 999 ref",
183        "matchCount": "1",
184        "teardown": [
185            "$TC action flush action gate"
186        ]
187    },
188    {
189        "id": "7837",
190        "name": "List gate actions",
191        "category": [
192            "actions",
193            "gate"
194        ],
195        "setup": [
196            [
197                "$TC action flush action gate",
198                0,
199                1,
200                255
201            ],
202            "$TC action add action gate base-time 600000000000ns sched-entry open 200000000ns -1 8000000b index 101",
203            "$TC action add action gate cycle-time 600000000000ns sched-entry open 600000000ns -1 8000000b index 102",
204            "$TC action add action gate cycle-time-ext 400000000000ns sched-entry close 100000000ns index 103"
205        ],
206        "cmdUnderTest": "$TC action list action gate",
207        "expExitCode": "0",
208        "verifyCmd": "$TC action list action gate",
209        "matchPattern": "action order [0-9]*:",
210        "matchCount": "3",
211        "teardown": [
212            "$TC actions flush action gate"
213        ]
214    },
215    {
216        "id": "9273",
217        "name": "Flush gate actions",
218        "category": [
219            "actions",
220            "gate"
221        ],
222        "setup": [
223            [
224                "$TC actions flush action gate",
225                0,
226                1,
227                255
228            ],
229            "$TC action add action gate base-time 600000000000ns sched-entry open 200000000ns -1 8000000b index 101",
230            "$TC action add action gate cycle-time 600000000000ns sched-entry open 600000000ns -1 8000000b index 102",
231            "$TC action add action gate cycle-time-ext 400000000000ns sched-entry close 100000000ns index 103"
232	],
233        "cmdUnderTest": "$TC action flush action gate",
234        "expExitCode": "0",
235        "verifyCmd": "$TC action list action gate",
236        "matchPattern": "action order [0-9]*: .*priority",
237        "matchCount": "0",
238        "teardown": [
239            "$TC actions flush action gate"
240        ]
241    },
242    {
243        "id": "c829",
244        "name": "Add gate action with duplicate index",
245        "category": [
246            "actions",
247            "gate"
248        ],
249        "setup": [
250            [
251                "$TC actions flush action gate",
252                0,
253                1,
254                255
255            ],
256            "$TC action add action gate cycle-time 600000000000ns sched-entry open 600000000ns -1 8000000b index 4294967295"
257        ],
258        "cmdUnderTest": "$TC action add action gate cycle-time 600000000000ns sched-entry open 600000000ns -1 8000000b index 4294967295",
259        "expExitCode": "255",
260        "verifyCmd": "$TC action get action gate index 4294967295",
261        "matchPattern": "action order [0-9]*: .*index 4294967295",
262        "matchCount": "1",
263        "teardown": [
264            "$TC action flush action gate"
265        ]
266    },
267    {
268        "id": "3043",
269        "name": "Add gate action with invalid index",
270        "category": [
271            "actions",
272            "gate"
273        ],
274        "setup": [
275            [
276                "$TC actions flush action gate",
277                0,
278                1,
279                255
280            ]
281        ],
282        "cmdUnderTest": "$TC action add action gate cycle-time-ext 400000000000ns sched-entry close 100000000ns index 4294967296",
283        "expExitCode": "255",
284        "verifyCmd": "$TC action ls action gate",
285        "matchPattern": "action order [0-9]*:",
286        "matchCount": "0",
287        "teardown": [
288            "$TC action flush action gate"
289        ]
290    },
291    {
292        "id": "2930",
293        "name": "Add gate action with cookie",
294        "category": [
295            "actions",
296            "gate"
297        ],
298        "setup": [
299            [
300                "$TC actions flush action gate",
301                0,
302                1,
303                255
304            ]
305        ],
306        "cmdUnderTest": "$TC action add action gate cycle-time-ext 400000000000ns sched-entry close 100000000ns index 4294 cookie d0d0d0d0d0d0d0d0",
307        "expExitCode": "0",
308        "verifyCmd": "$TC action list action gate",
309        "matchPattern": "action order [0-9]*: .*cookie d0d0d0d0d0d0d0",
310        "matchCount": "1",
311        "teardown": [
312            "$TC action flush action gate"
313        ]
314    }
315]
316