Back to home page

OSCL-LXR

 
 

    


0001 [
0002     {
0003         "id": "d959",
0004         "name": "Add cBPF action with valid bytecode",
0005         "category": [
0006             "actions",
0007             "bpf"
0008         ],
0009         "setup": [
0010             [
0011                 "$TC action flush action bpf",
0012                 0,
0013                 1,
0014                 255
0015             ]
0016         ],
0017         "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",
0018         "expExitCode": "0",
0019         "verifyCmd": "$TC action get action bpf index 100",
0020         "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",
0021         "matchCount": "1",
0022         "teardown": [
0023             "$TC action flush action bpf"
0024         ]
0025     },
0026     {
0027         "id": "f84a",
0028         "name": "Add cBPF action with invalid bytecode",
0029         "category": [
0030             "actions",
0031             "bpf"
0032         ],
0033         "setup": [
0034             [
0035                 "$TC actions flush action bpf",
0036                 0,
0037                 1,
0038                 255
0039             ]
0040         ],
0041         "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",
0042         "expExitCode": "255",
0043         "verifyCmd": "$TC action get action bpf index 100",
0044         "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",
0045         "matchCount": "0",
0046         "teardown": [
0047             "$TC actions flush action bpf"
0048         ]
0049     },
0050     {
0051         "id": "e939",
0052         "name": "Add eBPF action with valid object-file",
0053         "category": [
0054             "actions",
0055             "bpf"
0056         ],
0057         "plugins": {
0058                 "requires": "buildebpfPlugin"
0059         },
0060         "setup": [
0061             [
0062                 "$TC action flush action bpf",
0063                 0,
0064                 1,
0065                 255
0066             ]
0067         ],
0068         "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ok index 667",
0069         "expExitCode": "0",
0070         "verifyCmd": "$TC action get action bpf index 667",
0071         "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",
0072         "matchCount": "1",
0073         "teardown": [
0074             "$TC action flush action bpf"
0075         ]
0076     },
0077     {
0078         "id": "282d",
0079         "name": "Add eBPF action with invalid object-file",
0080         "category": [
0081             "actions",
0082             "bpf"
0083         ],
0084         "plugins": {
0085                 "requires": "buildebpfPlugin"
0086         },
0087         "setup": [
0088             [
0089                 "$TC action flush action bpf",
0090                 0,
0091                 1,
0092                 255
0093             ]
0094         ],
0095         "cmdUnderTest": "$TC action add action bpf object-file $EBPFDIR/action.o section action-ko index 667",
0096         "expExitCode": "255",
0097         "verifyCmd": "$TC action get action bpf index 667",
0098         "matchPattern": "action order [0-9]*: bpf action.o:\\[action-ko\\] id [0-9].*index 667 ref",
0099         "matchCount": "0",
0100         "teardown": [
0101             [
0102                 "$TC action flush action bpf",
0103                 0,
0104                 1,
0105                 255
0106             ]
0107         ]
0108     },
0109     {
0110         "id": "d819",
0111         "name": "Replace cBPF bytecode and action control",
0112         "category": [
0113             "actions",
0114             "bpf"
0115         ],
0116         "setup": [
0117             [
0118                 "$TC actions flush action bpf",
0119                 0,
0120                 1,
0121                 255
0122             ],
0123             [
0124                 "$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",
0125                 0,
0126                 1,
0127                 255
0128             ]
0129         ],
0130         "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",
0131         "expExitCode": "0",
0132         "verifyCmd": "$TC action get action bpf index 555",
0133         "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",
0134         "matchCount": "1",
0135         "teardown": [
0136             "$TC action flush action bpf"
0137         ]
0138     },
0139     {
0140         "id": "6ae3",
0141         "name": "Delete cBPF action ",
0142         "category": [
0143             "actions",
0144             "bpf"
0145         ],
0146         "setup": [
0147             [
0148                 "$TC actions flush action bpf",
0149                 0,
0150                 1,
0151                 255
0152             ],
0153             [
0154                 "$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",
0155                 0,
0156                 1,
0157                 255
0158             ]
0159         ],
0160         "cmdUnderTest": "$TC action delete action bpf index 444",
0161         "expExitCode": "0",
0162         "verifyCmd": "$TC action get action bpf index 444",
0163         "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",
0164         "matchCount": "0",
0165         "teardown": [
0166             "$TC action flush action bpf"
0167         ]
0168     },
0169     {
0170         "id": "3e0d",
0171         "name": "List cBPF actions",
0172         "category": [
0173             "actions",
0174             "bpf"
0175         ],
0176         "setup": [
0177             [
0178                 "$TC action flush action bpf",
0179                 0,
0180                 1,
0181                 255
0182             ],
0183             "$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",
0184             "$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",
0185             "$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"
0186         ],
0187         "cmdUnderTest": "$TC action list action bpf",
0188         "expExitCode": "0",
0189         "verifyCmd": "$TC action list action bpf",
0190         "matchPattern": "action order [0-9]*: bpf bytecode",
0191         "matchCount": "3",
0192         "teardown": [
0193             "$TC actions flush action bpf"
0194         ]
0195     },
0196     {
0197         "id": "55ce",
0198         "name": "Flush BPF actions",
0199         "category": [
0200             "actions",
0201             "bpf"
0202         ],
0203         "setup": [
0204             [
0205                 "$TC actions flush action bpf",
0206                 0,
0207                 1,
0208                 255
0209             ],
0210             "$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",
0211             "$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",
0212             "$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"
0213         ],
0214         "cmdUnderTest": "$TC action flush action bpf",
0215         "expExitCode": "0",
0216         "verifyCmd": "$TC action list action bpf",
0217         "matchPattern": "action order [0-9]*: bpf bytecode",
0218         "matchCount": "0",
0219         "teardown": [
0220             "$TC actions flush action bpf"
0221         ]
0222     },
0223     {
0224         "id": "ccc3",
0225         "name": "Add cBPF action with duplicate index",
0226         "category": [
0227             "actions",
0228             "bpf"
0229         ],
0230         "setup": [
0231             [
0232                 "$TC actions flush action bpf",
0233                 0,
0234                 1,
0235                 255
0236             ],
0237             "$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"
0238         ],
0239         "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",
0240         "expExitCode": "255",
0241         "verifyCmd": "$TC action get action bpf index 4294967295",
0242         "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",
0243         "matchCount": "1",
0244         "teardown": [
0245             "$TC action flush action bpf"
0246         ]
0247     },
0248     {
0249         "id": "89c7",
0250         "name": "Add cBPF action with invalid index",
0251         "category": [
0252             "actions",
0253             "bpf"
0254         ],
0255         "setup": [
0256             [
0257                 "$TC actions flush action bpf",
0258                 0,
0259                 1,
0260                 255
0261             ]
0262         ],
0263         "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",
0264         "expExitCode": "255",
0265         "verifyCmd": "$TC action ls action bpf",
0266         "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",
0267         "matchCount": "0",
0268         "teardown": [
0269             "$TC action flush action bpf"
0270         ]
0271     },
0272     {
0273         "id": "7ab9",
0274         "name": "Add cBPF action with cookie",
0275         "category": [
0276             "actions",
0277             "bpf"
0278         ],
0279         "setup": [
0280             [
0281                 "$TC actions flush action bpf",
0282                 0,
0283                 1,
0284                 255
0285             ]
0286         ],
0287         "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",
0288         "expExitCode": "0",
0289         "verifyCmd": "$TC action list action bpf",
0290         "matchPattern": "action order [0-9]*: bpf.*cookie d0d0d0d0d0d0d0",
0291         "matchCount": "1",
0292         "teardown": [
0293             "$TC action flush action bpf"
0294         ]
0295     },
0296     {
0297         "id": "b8a1",
0298         "name": "Replace bpf action with invalid goto_chain control",
0299         "category": [
0300             "actions",
0301             "bpf"
0302         ],
0303         "setup": [
0304             [
0305                 "$TC actions flush action bpf",
0306                 0,
0307                 1,
0308                 255
0309             ],
0310             "$TC action add action bpf bytecode '1,6 0 0 4294967295' pass index 90"
0311         ],
0312         "cmdUnderTest": "$TC action replace action bpf bytecode '1,6 0 0 4294967295' goto chain 42 index 90 cookie c1a0c1a0",
0313         "expExitCode": "255",
0314         "verifyCmd": "$TC action list action bpf",
0315         "matchPattern": "action order [0-9]*: bpf.* default-action pass.*index 90",
0316         "matchCount": "1",
0317         "teardown": [
0318             "$TC action flush action bpf"
0319         ]
0320     }
0321 ]