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",
59 "$TC action flush action bpf",
65 "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action-ebpf section action-ok index 667",
67 "verifyCmd": "$TC action get action bpf index 667",
68 "matchPattern": "action order [0-9]*: bpf action-ebpf:\\[action-ok\\] id [0-9].* tag [0-9a-f]{16}( jited)? default-action pipe.*index 667 ref",
71 "$TC action flush action bpf"
76 "name": "Add eBPF action with invalid object-file",
83 "$TC action flush action bpf",
89 "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action-ebpf section action-ko index 667",
91 "verifyCmd": "$TC action get action bpf index 667",
92 "matchPattern": "action order [0-9]*: bpf action-ebpf:\\[action-ko\\] id [0-9].*index 667 ref",
96 "$TC action flush action bpf",
105 "name": "Replace cBPF bytecode and action control",
112 "$TC actions flush action bpf",
118 "$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",
124 "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",
126 "verifyCmd": "$TC action get action bpf index 555",
127 "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",
130 "$TC action flush action bpf"
135 "name": "Delete cBPF action ",
142 "$TC actions flush action bpf",
148 "$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",
154 "cmdUnderTest": "$TC action delete action bpf index 444",
156 "verifyCmd": "$TC action get action bpf index 444",
157 "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",
160 "$TC action flush action bpf"
165 "name": "List cBPF actions",
172 "$TC action flush action bpf",
177 "$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",
178 "$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",
179 "$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"
181 "cmdUnderTest": "$TC action list action bpf",
183 "verifyCmd": "$TC action list action bpf",
184 "matchPattern": "action order [0-9]*: bpf bytecode",
187 "$TC actions flush action bpf"
192 "name": "Flush BPF actions",
199 "$TC actions flush action bpf",
204 "$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",
205 "$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",
206 "$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"
208 "cmdUnderTest": "$TC action flush action bpf",
210 "verifyCmd": "$TC action list action bpf",
211 "matchPattern": "action order [0-9]*: bpf bytecode",
214 "$TC actions flush action bpf"
219 "name": "Add cBPF action with duplicate index",
226 "$TC actions flush action bpf",
231 "$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"
233 "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",
234 "expExitCode": "255",
235 "verifyCmd": "$TC action get action bpf index 4294967295",
236 "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",
239 "$TC action flush action bpf"
244 "name": "Add cBPF action with invalid index",
251 "$TC actions flush action bpf",
257 "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 123456",
258 "expExitCode": "255",
259 "verifyCmd": "$TC action ls action bpf",
260 "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 123456",
263 "$TC action flush action bpf"
268 "name": "Add cBPF action with cookie",
275 "$TC actions flush action bpf",
281 "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",
283 "verifyCmd": "$TC action list action bpf",
284 "matchPattern": "action order [0-9]*: bpf.*cookie d0d0d0d0d0d0d0",
287 "$TC action flush action bpf"
292 "name": "Replace bpf action with invalid goto_chain control",
299 "$TC actions flush action bpf",
304 "$TC action add action bpf bytecode '1,6 0 0 4294967295' pass index 90"
306 "cmdUnderTest": "$TC action replace action bpf bytecode '1,6 0 0 4294967295' goto chain 42 index 90 cookie c1a0c1a0",
307 "expExitCode": "255",
308 "verifyCmd": "$TC action list action bpf",
309 "matchPattern": "action order [0-9]*: bpf.* default-action pass.*index 90",
312 "$TC action flush action bpf"