4 "name": "Add cBPF action with valid bytecode",
11 "$TC action flush action bpf",
17 "cmdUnderTest": "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' index 100",
19 "verifyCmd": "$TC action get action bpf index 100",
20 "matchPattern": "action order [0-9]*: bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' default-action pipe.*index 100 ref",
23 "$TC action flush action bpf"
28 "name": "Add cBPF action with invalid bytecode",
35 "$TC actions flush action bpf",
41 "cmdUnderTest": "$TC action add action bpf bytecode '4,40 0 0 12,31 0 1 2048,6 0 0 262144,6 0 0 0' index 100",
43 "verifyCmd": "$TC action get action bpf index 100",
44 "matchPattern": "action order [0-9]*: bpf bytecode '4,40 0 0 12,31 0 1 2048,6 0 0 262144,6 0 0 0' default-action pipe.*index 100 ref",
47 "$TC actions flush action bpf"
52 "name": "Add eBPF action with valid object-file",
60 "$TC action flush action bpf",
66 "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ok index 667",
68 "verifyCmd": "$TC action get action bpf index 667",
69 "matchPattern": "action order [0-9]*: bpf action.o:\\[action-ok\\] id [0-9]* tag [0-9a-f]{16}( jited)? default-action pipe.*index 667 ref",
72 "$TC action flush action bpf",
78 "name": "Add eBPF action with invalid object-file",
86 "$TC action flush action bpf",
92 "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ko index 667",
94 "verifyCmd": "$TC action get action bpf index 667",
95 "matchPattern": "action order [0-9]*: bpf action.o:\\[action-ko\\] id [0-9].*index 667 ref",
99 "$TC action flush action bpf",
109 "name": "Replace cBPF bytecode and action control",
116 "$TC actions flush action bpf",
122 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' index 555",
128 "cmdUnderTest": "$TC action replace action bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' drop index 555",
130 "verifyCmd": "$TC action get action bpf index 555",
131 "matchPattern": "action order [0-9]*: bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' default-action drop.*index 555 ref",
134 "$TC action flush action bpf"
139 "name": "Delete cBPF action ",
146 "$TC actions flush action bpf",
152 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' index 444",
158 "cmdUnderTest": "$TC action delete action bpf index 444",
160 "verifyCmd": "$TC action get action bpf index 444",
161 "matchPattern": "action order [0-9]*: bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' default-action pipe.*index 444 ref",
164 "$TC action flush action bpf"
169 "name": "List cBPF actions",
176 "$TC action flush action bpf",
181 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' ok index 101",
182 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' drop index 102",
183 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 33024,6 0 0 262144,6 0 0 0' continue index 103"
185 "cmdUnderTest": "$TC action list action bpf",
187 "verifyCmd": "$TC action list action bpf",
188 "matchPattern": "action order [0-9]*: bpf bytecode",
191 "$TC actions flush action bpf"
196 "name": "Flush BPF actions",
203 "$TC actions flush action bpf",
208 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' ok index 101",
209 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' drop index 102",
210 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 33024,6 0 0 262144,6 0 0 0' continue index 103"
212 "cmdUnderTest": "$TC action flush action bpf",
214 "verifyCmd": "$TC action list action bpf",
215 "matchPattern": "action order [0-9]*: bpf bytecode",
218 "$TC actions flush action bpf"
223 "name": "Add cBPF action with duplicate index",
230 "$TC actions flush action bpf",
235 "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' index 4294967295"
237 "cmdUnderTest": "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' index 4294967295",
238 "expExitCode": "255",
239 "verifyCmd": "$TC action get action bpf index 4294967295",
240 "matchPattern": "action order [0-9]*: bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' default-action pipe.*index 4294967295",
243 "$TC action flush action bpf"
248 "name": "Add cBPF action with invalid index",
255 "$TC actions flush action bpf",
261 "cmdUnderTest": "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' index 4294967296 cookie 12345",
262 "expExitCode": "255",
263 "verifyCmd": "$TC action ls action bpf",
264 "matchPattern": "action order [0-9]*: bpf bytecode '4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0' default-action pipe.*cookie 12345",
267 "$TC action flush action bpf"
272 "name": "Add cBPF action with cookie",
279 "$TC actions flush action bpf",
285 "cmdUnderTest": "$TC action add action bpf bytecode '4,40 0 0 12,21 0 1 2054,6 0 0 262144,6 0 0 0' cookie d0d0d0d0d0d0d0d0",
287 "verifyCmd": "$TC action list action bpf",
288 "matchPattern": "action order [0-9]*: bpf.*cookie d0d0d0d0d0d0d0",
291 "$TC action flush action bpf"