162306a36Sopenharmony_ci[ 262306a36Sopenharmony_ci { 362306a36Sopenharmony_ci "id": "d959", 462306a36Sopenharmony_ci "name": "Add cBPF action with valid bytecode", 562306a36Sopenharmony_ci "category": [ 662306a36Sopenharmony_ci "actions", 762306a36Sopenharmony_ci "bpf" 862306a36Sopenharmony_ci ], 962306a36Sopenharmony_ci "setup": [ 1062306a36Sopenharmony_ci [ 1162306a36Sopenharmony_ci "$TC action flush action bpf", 1262306a36Sopenharmony_ci 0, 1362306a36Sopenharmony_ci 1, 1462306a36Sopenharmony_ci 255 1562306a36Sopenharmony_ci ] 1662306a36Sopenharmony_ci ], 1762306a36Sopenharmony_ci "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", 1862306a36Sopenharmony_ci "expExitCode": "0", 1962306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 100", 2062306a36Sopenharmony_ci "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", 2162306a36Sopenharmony_ci "matchCount": "1", 2262306a36Sopenharmony_ci "teardown": [ 2362306a36Sopenharmony_ci "$TC action flush action bpf" 2462306a36Sopenharmony_ci ] 2562306a36Sopenharmony_ci }, 2662306a36Sopenharmony_ci { 2762306a36Sopenharmony_ci "id": "f84a", 2862306a36Sopenharmony_ci "name": "Add cBPF action with invalid bytecode", 2962306a36Sopenharmony_ci "category": [ 3062306a36Sopenharmony_ci "actions", 3162306a36Sopenharmony_ci "bpf" 3262306a36Sopenharmony_ci ], 3362306a36Sopenharmony_ci "setup": [ 3462306a36Sopenharmony_ci [ 3562306a36Sopenharmony_ci "$TC actions flush action bpf", 3662306a36Sopenharmony_ci 0, 3762306a36Sopenharmony_ci 1, 3862306a36Sopenharmony_ci 255 3962306a36Sopenharmony_ci ] 4062306a36Sopenharmony_ci ], 4162306a36Sopenharmony_ci "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", 4262306a36Sopenharmony_ci "expExitCode": "255", 4362306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 100", 4462306a36Sopenharmony_ci "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", 4562306a36Sopenharmony_ci "matchCount": "0", 4662306a36Sopenharmony_ci "teardown": [ 4762306a36Sopenharmony_ci "$TC actions flush action bpf" 4862306a36Sopenharmony_ci ] 4962306a36Sopenharmony_ci }, 5062306a36Sopenharmony_ci { 5162306a36Sopenharmony_ci "id": "e939", 5262306a36Sopenharmony_ci "name": "Add eBPF action with valid object-file", 5362306a36Sopenharmony_ci "category": [ 5462306a36Sopenharmony_ci "actions", 5562306a36Sopenharmony_ci "bpf" 5662306a36Sopenharmony_ci ], 5762306a36Sopenharmony_ci "plugins": { 5862306a36Sopenharmony_ci "requires": "buildebpfPlugin" 5962306a36Sopenharmony_ci }, 6062306a36Sopenharmony_ci "setup": [ 6162306a36Sopenharmony_ci [ 6262306a36Sopenharmony_ci "$TC action flush action bpf", 6362306a36Sopenharmony_ci 0, 6462306a36Sopenharmony_ci 1, 6562306a36Sopenharmony_ci 255 6662306a36Sopenharmony_ci ] 6762306a36Sopenharmony_ci ], 6862306a36Sopenharmony_ci "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ok index 667", 6962306a36Sopenharmony_ci "expExitCode": "0", 7062306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 667", 7162306a36Sopenharmony_ci "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", 7262306a36Sopenharmony_ci "matchCount": "1", 7362306a36Sopenharmony_ci "teardown": [ 7462306a36Sopenharmony_ci "$TC action flush action bpf" 7562306a36Sopenharmony_ci ] 7662306a36Sopenharmony_ci }, 7762306a36Sopenharmony_ci { 7862306a36Sopenharmony_ci "id": "282d", 7962306a36Sopenharmony_ci "name": "Add eBPF action with invalid object-file", 8062306a36Sopenharmony_ci "category": [ 8162306a36Sopenharmony_ci "actions", 8262306a36Sopenharmony_ci "bpf" 8362306a36Sopenharmony_ci ], 8462306a36Sopenharmony_ci "plugins": { 8562306a36Sopenharmony_ci "requires": "buildebpfPlugin" 8662306a36Sopenharmony_ci }, 8762306a36Sopenharmony_ci "setup": [ 8862306a36Sopenharmony_ci [ 8962306a36Sopenharmony_ci "$TC action flush action bpf", 9062306a36Sopenharmony_ci 0, 9162306a36Sopenharmony_ci 1, 9262306a36Sopenharmony_ci 255 9362306a36Sopenharmony_ci ] 9462306a36Sopenharmony_ci ], 9562306a36Sopenharmony_ci "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ko index 667", 9662306a36Sopenharmony_ci "expExitCode": "255", 9762306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 667", 9862306a36Sopenharmony_ci "matchPattern": "action order [0-9]*: bpf action.o:\\[action-ko\\] id [0-9].*index 667 ref", 9962306a36Sopenharmony_ci "matchCount": "0", 10062306a36Sopenharmony_ci "teardown": [ 10162306a36Sopenharmony_ci [ 10262306a36Sopenharmony_ci "$TC action flush action bpf", 10362306a36Sopenharmony_ci 0, 10462306a36Sopenharmony_ci 1, 10562306a36Sopenharmony_ci 255 10662306a36Sopenharmony_ci ] 10762306a36Sopenharmony_ci ] 10862306a36Sopenharmony_ci }, 10962306a36Sopenharmony_ci { 11062306a36Sopenharmony_ci "id": "d819", 11162306a36Sopenharmony_ci "name": "Replace cBPF bytecode and action control", 11262306a36Sopenharmony_ci "category": [ 11362306a36Sopenharmony_ci "actions", 11462306a36Sopenharmony_ci "bpf" 11562306a36Sopenharmony_ci ], 11662306a36Sopenharmony_ci "setup": [ 11762306a36Sopenharmony_ci [ 11862306a36Sopenharmony_ci "$TC actions flush action bpf", 11962306a36Sopenharmony_ci 0, 12062306a36Sopenharmony_ci 1, 12162306a36Sopenharmony_ci 255 12262306a36Sopenharmony_ci ], 12362306a36Sopenharmony_ci [ 12462306a36Sopenharmony_ci "$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", 12562306a36Sopenharmony_ci 0, 12662306a36Sopenharmony_ci 1, 12762306a36Sopenharmony_ci 255 12862306a36Sopenharmony_ci ] 12962306a36Sopenharmony_ci ], 13062306a36Sopenharmony_ci "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", 13162306a36Sopenharmony_ci "expExitCode": "0", 13262306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 555", 13362306a36Sopenharmony_ci "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", 13462306a36Sopenharmony_ci "matchCount": "1", 13562306a36Sopenharmony_ci "teardown": [ 13662306a36Sopenharmony_ci "$TC action flush action bpf" 13762306a36Sopenharmony_ci ] 13862306a36Sopenharmony_ci }, 13962306a36Sopenharmony_ci { 14062306a36Sopenharmony_ci "id": "6ae3", 14162306a36Sopenharmony_ci "name": "Delete cBPF action ", 14262306a36Sopenharmony_ci "category": [ 14362306a36Sopenharmony_ci "actions", 14462306a36Sopenharmony_ci "bpf" 14562306a36Sopenharmony_ci ], 14662306a36Sopenharmony_ci "setup": [ 14762306a36Sopenharmony_ci [ 14862306a36Sopenharmony_ci "$TC actions flush action bpf", 14962306a36Sopenharmony_ci 0, 15062306a36Sopenharmony_ci 1, 15162306a36Sopenharmony_ci 255 15262306a36Sopenharmony_ci ], 15362306a36Sopenharmony_ci [ 15462306a36Sopenharmony_ci "$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", 15562306a36Sopenharmony_ci 0, 15662306a36Sopenharmony_ci 1, 15762306a36Sopenharmony_ci 255 15862306a36Sopenharmony_ci ] 15962306a36Sopenharmony_ci ], 16062306a36Sopenharmony_ci "cmdUnderTest": "$TC action delete action bpf index 444", 16162306a36Sopenharmony_ci "expExitCode": "0", 16262306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 444", 16362306a36Sopenharmony_ci "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", 16462306a36Sopenharmony_ci "matchCount": "0", 16562306a36Sopenharmony_ci "teardown": [ 16662306a36Sopenharmony_ci "$TC action flush action bpf" 16762306a36Sopenharmony_ci ] 16862306a36Sopenharmony_ci }, 16962306a36Sopenharmony_ci { 17062306a36Sopenharmony_ci "id": "3e0d", 17162306a36Sopenharmony_ci "name": "List cBPF actions", 17262306a36Sopenharmony_ci "category": [ 17362306a36Sopenharmony_ci "actions", 17462306a36Sopenharmony_ci "bpf" 17562306a36Sopenharmony_ci ], 17662306a36Sopenharmony_ci "setup": [ 17762306a36Sopenharmony_ci [ 17862306a36Sopenharmony_ci "$TC action flush action bpf", 17962306a36Sopenharmony_ci 0, 18062306a36Sopenharmony_ci 1, 18162306a36Sopenharmony_ci 255 18262306a36Sopenharmony_ci ], 18362306a36Sopenharmony_ci "$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", 18462306a36Sopenharmony_ci "$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", 18562306a36Sopenharmony_ci "$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" 18662306a36Sopenharmony_ci ], 18762306a36Sopenharmony_ci "cmdUnderTest": "$TC action list action bpf", 18862306a36Sopenharmony_ci "expExitCode": "0", 18962306a36Sopenharmony_ci "verifyCmd": "$TC action list action bpf", 19062306a36Sopenharmony_ci "matchPattern": "action order [0-9]*: bpf bytecode", 19162306a36Sopenharmony_ci "matchCount": "3", 19262306a36Sopenharmony_ci "teardown": [ 19362306a36Sopenharmony_ci "$TC actions flush action bpf" 19462306a36Sopenharmony_ci ] 19562306a36Sopenharmony_ci }, 19662306a36Sopenharmony_ci { 19762306a36Sopenharmony_ci "id": "55ce", 19862306a36Sopenharmony_ci "name": "Flush BPF actions", 19962306a36Sopenharmony_ci "category": [ 20062306a36Sopenharmony_ci "actions", 20162306a36Sopenharmony_ci "bpf" 20262306a36Sopenharmony_ci ], 20362306a36Sopenharmony_ci "setup": [ 20462306a36Sopenharmony_ci [ 20562306a36Sopenharmony_ci "$TC actions flush action bpf", 20662306a36Sopenharmony_ci 0, 20762306a36Sopenharmony_ci 1, 20862306a36Sopenharmony_ci 255 20962306a36Sopenharmony_ci ], 21062306a36Sopenharmony_ci "$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", 21162306a36Sopenharmony_ci "$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", 21262306a36Sopenharmony_ci "$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" 21362306a36Sopenharmony_ci ], 21462306a36Sopenharmony_ci "cmdUnderTest": "$TC action flush action bpf", 21562306a36Sopenharmony_ci "expExitCode": "0", 21662306a36Sopenharmony_ci "verifyCmd": "$TC action list action bpf", 21762306a36Sopenharmony_ci "matchPattern": "action order [0-9]*: bpf bytecode", 21862306a36Sopenharmony_ci "matchCount": "0", 21962306a36Sopenharmony_ci "teardown": [ 22062306a36Sopenharmony_ci "$TC actions flush action bpf" 22162306a36Sopenharmony_ci ] 22262306a36Sopenharmony_ci }, 22362306a36Sopenharmony_ci { 22462306a36Sopenharmony_ci "id": "ccc3", 22562306a36Sopenharmony_ci "name": "Add cBPF action with duplicate index", 22662306a36Sopenharmony_ci "category": [ 22762306a36Sopenharmony_ci "actions", 22862306a36Sopenharmony_ci "bpf" 22962306a36Sopenharmony_ci ], 23062306a36Sopenharmony_ci "setup": [ 23162306a36Sopenharmony_ci [ 23262306a36Sopenharmony_ci "$TC actions flush action bpf", 23362306a36Sopenharmony_ci 0, 23462306a36Sopenharmony_ci 1, 23562306a36Sopenharmony_ci 255 23662306a36Sopenharmony_ci ], 23762306a36Sopenharmony_ci "$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" 23862306a36Sopenharmony_ci ], 23962306a36Sopenharmony_ci "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", 24062306a36Sopenharmony_ci "expExitCode": "255", 24162306a36Sopenharmony_ci "verifyCmd": "$TC action get action bpf index 4294967295", 24262306a36Sopenharmony_ci "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", 24362306a36Sopenharmony_ci "matchCount": "1", 24462306a36Sopenharmony_ci "teardown": [ 24562306a36Sopenharmony_ci "$TC action flush action bpf" 24662306a36Sopenharmony_ci ] 24762306a36Sopenharmony_ci }, 24862306a36Sopenharmony_ci { 24962306a36Sopenharmony_ci "id": "89c7", 25062306a36Sopenharmony_ci "name": "Add cBPF action with invalid index", 25162306a36Sopenharmony_ci "category": [ 25262306a36Sopenharmony_ci "actions", 25362306a36Sopenharmony_ci "bpf" 25462306a36Sopenharmony_ci ], 25562306a36Sopenharmony_ci "setup": [ 25662306a36Sopenharmony_ci [ 25762306a36Sopenharmony_ci "$TC actions flush action bpf", 25862306a36Sopenharmony_ci 0, 25962306a36Sopenharmony_ci 1, 26062306a36Sopenharmony_ci 255 26162306a36Sopenharmony_ci ] 26262306a36Sopenharmony_ci ], 26362306a36Sopenharmony_ci "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", 26462306a36Sopenharmony_ci "expExitCode": "255", 26562306a36Sopenharmony_ci "verifyCmd": "$TC action ls action bpf", 26662306a36Sopenharmony_ci "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", 26762306a36Sopenharmony_ci "matchCount": "0", 26862306a36Sopenharmony_ci "teardown": [ 26962306a36Sopenharmony_ci "$TC action flush action bpf" 27062306a36Sopenharmony_ci ] 27162306a36Sopenharmony_ci }, 27262306a36Sopenharmony_ci { 27362306a36Sopenharmony_ci "id": "7ab9", 27462306a36Sopenharmony_ci "name": "Add cBPF action with cookie", 27562306a36Sopenharmony_ci "category": [ 27662306a36Sopenharmony_ci "actions", 27762306a36Sopenharmony_ci "bpf" 27862306a36Sopenharmony_ci ], 27962306a36Sopenharmony_ci "setup": [ 28062306a36Sopenharmony_ci [ 28162306a36Sopenharmony_ci "$TC actions flush action bpf", 28262306a36Sopenharmony_ci 0, 28362306a36Sopenharmony_ci 1, 28462306a36Sopenharmony_ci 255 28562306a36Sopenharmony_ci ] 28662306a36Sopenharmony_ci ], 28762306a36Sopenharmony_ci "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", 28862306a36Sopenharmony_ci "expExitCode": "0", 28962306a36Sopenharmony_ci "verifyCmd": "$TC action list action bpf", 29062306a36Sopenharmony_ci "matchPattern": "action order [0-9]*: bpf.*cookie d0d0d0d0d0d0d0", 29162306a36Sopenharmony_ci "matchCount": "1", 29262306a36Sopenharmony_ci "teardown": [ 29362306a36Sopenharmony_ci "$TC action flush action bpf" 29462306a36Sopenharmony_ci ] 29562306a36Sopenharmony_ci }, 29662306a36Sopenharmony_ci { 29762306a36Sopenharmony_ci "id": "b8a1", 29862306a36Sopenharmony_ci "name": "Replace bpf action with invalid goto_chain control", 29962306a36Sopenharmony_ci "category": [ 30062306a36Sopenharmony_ci "actions", 30162306a36Sopenharmony_ci "bpf" 30262306a36Sopenharmony_ci ], 30362306a36Sopenharmony_ci "setup": [ 30462306a36Sopenharmony_ci [ 30562306a36Sopenharmony_ci "$TC actions flush action bpf", 30662306a36Sopenharmony_ci 0, 30762306a36Sopenharmony_ci 1, 30862306a36Sopenharmony_ci 255 30962306a36Sopenharmony_ci ], 31062306a36Sopenharmony_ci "$TC action add action bpf bytecode '1,6 0 0 4294967295' pass index 90" 31162306a36Sopenharmony_ci ], 31262306a36Sopenharmony_ci "cmdUnderTest": "$TC action replace action bpf bytecode '1,6 0 0 4294967295' goto chain 42 index 90 cookie c1a0c1a0", 31362306a36Sopenharmony_ci "expExitCode": "255", 31462306a36Sopenharmony_ci "verifyCmd": "$TC action list action bpf", 31562306a36Sopenharmony_ci "matchPattern": "action order [0-9]*: bpf.* default-action pass.*index 90", 31662306a36Sopenharmony_ci "matchCount": "1", 31762306a36Sopenharmony_ci "teardown": [ 31862306a36Sopenharmony_ci "$TC action flush action bpf" 31962306a36Sopenharmony_ci ] 32062306a36Sopenharmony_ci } 32162306a36Sopenharmony_ci] 322