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",
58 "requires": "buildebpfPlugin"
62 "$TC action flush action bpf",
68 "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ok index 667",
70 "verifyCmd": "$TC action get action bpf index 667",
71 "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",
74 "$TC action flush action bpf"
79 "name": "Add eBPF action with invalid object-file",
85 "requires": "buildebpfPlugin"
89 "$TC action flush action bpf",
95 "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ko index 667",
97 "verifyCmd": "$TC action get action bpf index 667",
98 "matchPattern": "action order [0-9]*: bpf action.o:\\[action-ko\\] id [0-9].*index 667 ref",
102 "$TC action flush action bpf",
111 "name": "Replace cBPF bytecode and action control",
118 "$TC actions flush action bpf",
124 "$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",
130 "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",
132 "verifyCmd": "$TC action get action bpf index 555",
133 "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",
136 "$TC action flush action bpf"
141 "name": "Delete cBPF action ",
148 "$TC actions flush action bpf",
154 "$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",
160 "cmdUnderTest": "$TC action delete action bpf index 444",
162 "verifyCmd": "$TC action get action bpf index 444",
163 "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",
166 "$TC action flush action bpf"
171 "name": "List cBPF actions",
178 "$TC action flush action bpf",
183 "$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",
184 "$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",
185 "$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"
187 "cmdUnderTest": "$TC action list action bpf",
189 "verifyCmd": "$TC action list action bpf",
190 "matchPattern": "action order [0-9]*: bpf bytecode",
193 "$TC actions flush action bpf"
198 "name": "Flush BPF actions",
205 "$TC actions flush action bpf",
210 "$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",
211 "$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",
212 "$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"
214 "cmdUnderTest": "$TC action flush action bpf",
216 "verifyCmd": "$TC action list action bpf",
217 "matchPattern": "action order [0-9]*: bpf bytecode",
220 "$TC actions flush action bpf"
225 "name": "Add cBPF action with duplicate index",
232 "$TC actions flush action bpf",
237 "$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"
239 "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",
240 "expExitCode": "255",
241 "verifyCmd": "$TC action get action bpf index 4294967295",
242 "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",
245 "$TC action flush action bpf"
250 "name": "Add cBPF action with invalid index",
257 "$TC actions flush action bpf",
263 "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",
264 "expExitCode": "255",
265 "verifyCmd": "$TC action ls action bpf",
266 "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",
269 "$TC action flush action bpf"
274 "name": "Add cBPF action with cookie",
281 "$TC actions flush action bpf",
287 "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",
289 "verifyCmd": "$TC action list action bpf",
290 "matchPattern": "action order [0-9]*: bpf.*cookie d0d0d0d0d0d0d0",
293 "$TC action flush action bpf"
298 "name": "Replace bpf action with invalid goto_chain control",
305 "$TC actions flush action bpf",
310 "$TC action add action bpf bytecode '1,6 0 0 4294967295' pass index 90"
312 "cmdUnderTest": "$TC action replace action bpf bytecode '1,6 0 0 4294967295' goto chain 42 index 90 cookie c1a0c1a0",
313 "expExitCode": "255",
314 "verifyCmd": "$TC action list action bpf",
315 "matchPattern": "action order [0-9]*: bpf.* default-action pass.*index 90",
318 "$TC action flush action bpf"