0001 [
0002 {
0003 "id": "e89a",
0004 "name": "Add valid pass action",
0005 "category": [
0006 "actions",
0007 "gact"
0008 ],
0009 "setup": [
0010 [
0011 "$TC actions flush action gact",
0012 0,
0013 1,
0014 255
0015 ]
0016 ],
0017 "cmdUnderTest": "$TC actions add action pass index 8",
0018 "expExitCode": "0",
0019 "verifyCmd": "$TC actions list action gact",
0020 "matchPattern": "action order [0-9]*: gact action pass.*index 8 ref",
0021 "matchCount": "1",
0022 "teardown": [
0023 "$TC actions flush action gact"
0024 ]
0025 },
0026 {
0027 "id": "a02c",
0028 "name": "Add valid pipe action",
0029 "category": [
0030 "actions",
0031 "gact"
0032 ],
0033 "setup": [
0034 [
0035 "$TC actions flush action gact",
0036 0,
0037 1,
0038 255
0039 ]
0040 ],
0041 "cmdUnderTest": "$TC actions add action pipe index 6",
0042 "expExitCode": "0",
0043 "verifyCmd": "$TC actions list action gact",
0044 "matchPattern": "action order [0-9]*: gact action pipe.*index 6 ref",
0045 "matchCount": "1",
0046 "teardown": [
0047 "$TC actions flush action gact"
0048 ]
0049 },
0050 {
0051 "id": "feef",
0052 "name": "Add valid reclassify action",
0053 "category": [
0054 "actions",
0055 "gact"
0056 ],
0057 "setup": [
0058 [
0059 "$TC actions flush action gact",
0060 0,
0061 1,
0062 255
0063 ]
0064 ],
0065 "cmdUnderTest": "$TC actions add action reclassify index 5",
0066 "expExitCode": "0",
0067 "verifyCmd": "$TC actions list action gact",
0068 "matchPattern": "action order [0-9]*: gact action reclassify.*index 5 ref",
0069 "matchCount": "1",
0070 "teardown": [
0071 "$TC actions flush action gact"
0072 ]
0073 },
0074 {
0075 "id": "8a7a",
0076 "name": "Add valid drop action",
0077 "category": [
0078 "actions",
0079 "gact"
0080 ],
0081 "setup": [
0082 [
0083 "$TC actions flush action gact",
0084 0,
0085 1,
0086 255
0087 ]
0088 ],
0089 "cmdUnderTest": "$TC actions add action drop index 30",
0090 "expExitCode": "0",
0091 "verifyCmd": "$TC actions list action gact",
0092 "matchPattern": "action order [0-9]*: gact action drop.*index 30 ref",
0093 "matchCount": "1",
0094 "teardown": [
0095 "$TC actions flush action gact"
0096 ]
0097 },
0098 {
0099 "id": "9a52",
0100 "name": "Add valid continue action",
0101 "category": [
0102 "actions",
0103 "gact"
0104 ],
0105 "setup": [
0106 [
0107 "$TC actions flush action gact",
0108 0,
0109 1,
0110 255
0111 ]
0112 ],
0113 "cmdUnderTest": "$TC actions add action continue index 432",
0114 "expExitCode": "0",
0115 "verifyCmd": "$TC actions list action gact",
0116 "matchPattern": "action order [0-9]*: gact action continue.*index 432 ref",
0117 "matchCount": "1",
0118 "teardown": [
0119 "$TC actions flush action gact"
0120 ]
0121 },
0122 {
0123 "id": "d700",
0124 "name": "Add invalid action",
0125 "category": [
0126 "actions",
0127 "gact"
0128 ],
0129 "setup": [
0130 [
0131 "$TC actions flush action gact",
0132 0,
0133 1,
0134 255
0135 ]
0136 ],
0137 "cmdUnderTest": "$TC actions add action pump index 386",
0138 "expExitCode": "255",
0139 "verifyCmd": "$TC actions list action gact",
0140 "matchPattern": "action order [0-9]*: gact action.*index 386 ref",
0141 "matchCount": "0",
0142 "teardown": [
0143 "$TC actions flush action gact"
0144 ]
0145 },
0146 {
0147 "id": "9215",
0148 "name": "Add action with duplicate index",
0149 "category": [
0150 "actions",
0151 "gact"
0152 ],
0153 "setup": [
0154 [
0155 "$TC actions flush action gact",
0156 0,
0157 1,
0158 255
0159 ],
0160 "$TC actions add action pipe index 15"
0161 ],
0162 "cmdUnderTest": "$TC actions add action drop index 15",
0163 "expExitCode": "255",
0164 "verifyCmd": "$TC actions list action gact",
0165 "matchPattern": "action order [0-9]*: gact action drop.*index 15 ref",
0166 "matchCount": "0",
0167 "teardown": [
0168 "$TC actions flush action gact"
0169 ]
0170 },
0171 {
0172 "id": "798e",
0173 "name": "Add action with index exceeding 32-bit maximum",
0174 "category": [
0175 "actions",
0176 "gact"
0177 ],
0178 "setup": [
0179 [
0180 "$TC actions flush action gact",
0181 0,
0182 1,
0183 255
0184 ]
0185 ],
0186 "cmdUnderTest": "$TC actions add action drop index 4294967296",
0187 "expExitCode": "255",
0188 "verifyCmd": "actions list action gact",
0189 "matchPattern": "action order [0-9]*: gact action drop.*index 4294967296 ref",
0190 "matchCount": "0",
0191 "teardown": [
0192 "$TC actions flush action gact"
0193 ]
0194 },
0195 {
0196 "id": "22be",
0197 "name": "Add action with index at 32-bit maximum",
0198 "category": [
0199 "actions",
0200 "gact"
0201 ],
0202 "setup": [
0203 [
0204 "$TC actions flush action gact",
0205 0,
0206 1,
0207 255
0208 ]
0209 ],
0210 "cmdUnderTest": "$TC actions add action drop index 4294967295",
0211 "expExitCode": "0",
0212 "verifyCmd": "$TC actions list action gact",
0213 "matchPattern": "action order [0-9]*: gact action drop.*index 4294967295 ref",
0214 "matchCount": "1",
0215 "teardown": [
0216 "$TC actions flush action gact"
0217 ]
0218 },
0219 {
0220 "id": "ac2a",
0221 "name": "List actions",
0222 "category": [
0223 "actions",
0224 "gact"
0225 ],
0226 "setup": [
0227 [
0228 "$TC actions flush action gact",
0229 0,
0230 1,
0231 255
0232 ],
0233 "$TC actions add action reclassify index 101",
0234 "$TC actions add action reclassify index 102",
0235 "$TC actions add action reclassify index 103",
0236 "$TC actions add action reclassify index 104",
0237 "$TC actions add action reclassify index 105"
0238 ],
0239 "cmdUnderTest": "$TC actions list action gact",
0240 "expExitCode": "0",
0241 "verifyCmd": "$TC actions list action gact",
0242 "matchPattern": "action order [0-9]*: gact action reclassify",
0243 "matchCount": "5",
0244 "teardown": [
0245 "$TC actions flush action gact"
0246 ]
0247 },
0248 {
0249 "id": "3edf",
0250 "name": "Flush gact actions",
0251 "category": [
0252 "actions",
0253 "gact"
0254 ],
0255 "setup": [
0256 "$TC actions add action reclassify index 101",
0257 "$TC actions add action reclassify index 102",
0258 "$TC actions add action reclassify index 103",
0259 "$TC actions add action reclassify index 104",
0260 "$TC actions add action reclassify index 105"
0261 ],
0262 "cmdUnderTest": "$TC actions flush action gact",
0263 "expExitCode": "0",
0264 "verifyCmd": "$TC actions list action gact",
0265 "matchPattern": "action order [0-9]*: gact action reclassify",
0266 "matchCount": "0",
0267 "teardown": []
0268 },
0269 {
0270 "id": "63ec",
0271 "name": "Delete pass action",
0272 "category": [
0273 "actions",
0274 "gact"
0275 ],
0276 "setup": [
0277 [
0278 "$TC actions flush action gact",
0279 0,
0280 1,
0281 255
0282 ],
0283 "$TC actions add action pass index 1"
0284 ],
0285 "cmdUnderTest": "$TC actions del action gact index 1",
0286 "expExitCode": "0",
0287 "verifyCmd": "$TC actions list action gact",
0288 "matchPattern": "action order [0-9]*: gact action pass.*index 1 ref",
0289 "matchCount": "0",
0290 "teardown": [
0291 "$TC actions flush action gact"
0292 ]
0293 },
0294 {
0295 "id": "46be",
0296 "name": "Delete pipe action",
0297 "category": [
0298 "actions",
0299 "gact"
0300 ],
0301 "setup": [
0302 [
0303 "$TC actions flush action gact",
0304 0,
0305 1,
0306 255
0307 ],
0308 "$TC actions add action pipe index 9"
0309 ],
0310 "cmdUnderTest": "$TC actions del action gact index 9",
0311 "expExitCode": "0",
0312 "verifyCmd": "$TC actions list action gact",
0313 "matchPattern": "action order [0-9]*: gact action pipe.*index 9 ref",
0314 "matchCount": "0",
0315 "teardown": [
0316 "$TC actions flush action gact"
0317 ]
0318 },
0319 {
0320 "id": "2e08",
0321 "name": "Delete reclassify action",
0322 "category": [
0323 "actions",
0324 "gact"
0325 ],
0326 "setup": [
0327 [
0328 "$TC actions flush action gact",
0329 0,
0330 1,
0331 255
0332 ],
0333 "$TC actions add action reclassify index 65536"
0334 ],
0335 "cmdUnderTest": "$TC actions del action gact index 65536",
0336 "expExitCode": "0",
0337 "verifyCmd": "$TC actions list action gact",
0338 "matchPattern": "action order [0-9]*: gact action reclassify.*index 65536 ref",
0339 "matchCount": "0",
0340 "teardown": [
0341 "$TC actions flush action gact"
0342 ]
0343 },
0344 {
0345 "id": "99c4",
0346 "name": "Delete drop action",
0347 "category": [
0348 "actions",
0349 "gact"
0350 ],
0351 "setup": [
0352 [
0353 "$TC actions flush action gact",
0354 0,
0355 1,
0356 255
0357 ],
0358 "$TC actions add action drop index 16"
0359 ],
0360 "cmdUnderTest": "$TC actions del action gact index 16",
0361 "expExitCode": "0",
0362 "verifyCmd": "$TC actions list action gact",
0363 "matchPattern": "action order [0-9]*: gact action drop.*index 16 ref",
0364 "matchCount": "0",
0365 "teardown": [
0366 "$TC actions flush action gact"
0367 ]
0368 },
0369 {
0370 "id": "fb6b",
0371 "name": "Delete continue action",
0372 "category": [
0373 "actions",
0374 "gact"
0375 ],
0376 "setup": [
0377 [
0378 "$TC actions flush action gact",
0379 0,
0380 1,
0381 255
0382 ],
0383 "$TC actions add action continue index 32"
0384 ],
0385 "cmdUnderTest": "$TC actions del action gact index 32",
0386 "expExitCode": "0",
0387 "verifyCmd": "actions list action gact",
0388 "matchPattern": "action order [0-9]*: gact action continue.*index 32 ref",
0389 "matchCount": "0",
0390 "teardown": [
0391 "$TC actions flush action gact"
0392 ]
0393 },
0394 {
0395 "id": "0eb3",
0396 "name": "Delete non-existent action",
0397 "category": [
0398 "actions",
0399 "gact"
0400 ],
0401 "setup": [
0402 [
0403 "$TC actions flush action gact",
0404 0,
0405 1,
0406 255
0407 ]
0408 ],
0409 "cmdUnderTest": "$TC actions del action gact index 2",
0410 "expExitCode": "255",
0411 "verifyCmd": "$TC actions list action gact",
0412 "matchPattern": "action order [0-9]*: gact action",
0413 "matchCount": "0",
0414 "teardown": [
0415 "$TC actions flush action gact"
0416 ]
0417 },
0418 {
0419 "id": "f02c",
0420 "name": "Replace gact action",
0421 "category": [
0422 "actions",
0423 "gact"
0424 ],
0425 "setup": [
0426 [
0427 "$TC actions flush action gact",
0428 0,
0429 1,
0430 255
0431 ],
0432 "$TC actions add action drop index 10",
0433 "$TC actions add action drop index 12"
0434 ],
0435 "cmdUnderTest": "$TC actions replace action ok index 12",
0436 "expExitCode": "0",
0437 "verifyCmd": "$TC actions ls action gact",
0438 "matchPattern": "action order [0-9]*: gact action pass",
0439 "matchCount": "1",
0440 "teardown": [
0441 "$TC actions flush action gact"
0442 ]
0443 },
0444 {
0445 "id": "525f",
0446 "name": "Get gact action by index",
0447 "category": [
0448 "actions",
0449 "gact"
0450 ],
0451 "setup": [
0452 [
0453 "$TC actions flush action gact",
0454 0,
0455 1,
0456 255
0457 ],
0458 "$TC actions add action drop index 3900800700"
0459 ],
0460 "cmdUnderTest": "$TC actions get action gact index 3900800700",
0461 "expExitCode": "0",
0462 "verifyCmd": "$TC actions get action gact index 3900800700",
0463 "matchPattern": "index 3900800700",
0464 "matchCount": "1",
0465 "teardown": [
0466 "$TC actions flush action gact"
0467 ]
0468 },
0469 {
0470 "id": "1021",
0471 "name": "Add batch of 32 gact pass actions",
0472 "category": [
0473 "actions",
0474 "gact"
0475 ],
0476 "setup": [
0477 [
0478 "$TC actions flush action gact",
0479 0,
0480 1,
0481 255
0482 ]
0483 ],
0484 "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action pass index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
0485 "expExitCode": "0",
0486 "verifyCmd": "$TC actions list action gact",
0487 "matchPattern": "^[ \t]+index [0-9]+ ref",
0488 "matchCount": "32",
0489 "teardown": [
0490 "$TC actions flush action gact"
0491 ]
0492 },
0493 {
0494 "id": "da7a",
0495 "name": "Add batch of 32 gact continue actions with cookie",
0496 "category": [
0497 "actions",
0498 "gact"
0499 ],
0500 "setup": [
0501 [
0502 "$TC actions flush action gact",
0503 0,
0504 1,
0505 255
0506 ]
0507 ],
0508 "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action continue index \\$i cookie aabbccddeeff112233445566778800a1 \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
0509 "expExitCode": "0",
0510 "verifyCmd": "$TC actions list action gact",
0511 "matchPattern": "^[ \t]+index [0-9]+ ref",
0512 "matchCount": "32",
0513 "teardown": [
0514 "$TC actions flush action gact"
0515 ]
0516 },
0517 {
0518 "id": "8aa3",
0519 "name": "Delete batch of 32 gact continue actions",
0520 "category": [
0521 "actions",
0522 "gact"
0523 ],
0524 "setup": [
0525 [
0526 "$TC actions flush action gact",
0527 0,
0528 1,
0529 255
0530 ],
0531 "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action continue index \\$i \\\"; args=\\\"\\$args\\$cmd\\\"; done && $TC actions add \\$args\""
0532 ],
0533 "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action gact index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
0534 "expExitCode": "0",
0535 "verifyCmd": "$TC actions list action gact",
0536 "matchPattern": "^[ \t]+index [0-9]+ ref",
0537 "matchCount": "0",
0538 "teardown": []
0539 },
0540 {
0541 "id": "8e47",
0542 "name": "Add gact action with random determ goto chain control action",
0543 "category": [
0544 "actions",
0545 "gact"
0546 ],
0547 "setup": [
0548 [
0549 "$TC actions flush action gact",
0550 0,
0551 1,
0552 255
0553 ]
0554 ],
0555 "cmdUnderTest": "$TC actions add action pass random determ goto chain 1 2 index 90",
0556 "expExitCode": "255",
0557 "verifyCmd": "$TC actions list action gact",
0558 "matchPattern": "action order [0-9]*: gact action pass random type determ goto chain 1 val 2.*index 90 ref",
0559 "matchCount": "0",
0560 "teardown": [
0561 "$TC actions flush action gact"
0562 ]
0563 },
0564 {
0565 "id": "ca89",
0566 "name": "Replace gact action with invalid goto chain control",
0567 "category": [
0568 "actions",
0569 "gact"
0570 ],
0571 "setup": [
0572 [
0573 "$TC actions flush action gact",
0574 0,
0575 1,
0576 255
0577 ],
0578 "$TC actions add action pass random determ drop 2 index 90"
0579 ],
0580 "cmdUnderTest": "$TC actions replace action goto chain 42 random determ drop 5 index 90 cookie c1a0c1a0",
0581 "expExitCode": "255",
0582 "verifyCmd": "$TC actions list action gact",
0583 "matchPattern": "action order [0-9]*: gact action pass.*random type determ drop val 2.*index 90 ref",
0584 "matchCount": "1",
0585 "teardown": [
0586 "$TC actions flush action gact"
0587 ]
0588 },
0589 {
0590 "id": "95ad",
0591 "name": "Add gact pass action with no_percpu flag",
0592 "category": [
0593 "actions",
0594 "gact"
0595 ],
0596 "setup": [
0597 [
0598 "$TC actions flush action gact",
0599 0,
0600 1,
0601 255
0602 ]
0603 ],
0604 "cmdUnderTest": "$TC actions add action pass no_percpu",
0605 "expExitCode": "0",
0606 "verifyCmd": "$TC actions list action gact",
0607 "matchPattern": "action order [0-9]*: gact action pass.*no_percpu",
0608 "matchCount": "1",
0609 "teardown": [
0610 "$TC actions flush action gact"
0611 ]
0612 },
0613 {
0614 "id": "7f52",
0615 "name": "Try to flush action which is referenced by filter",
0616 "category": [
0617 "actions",
0618 "gact"
0619 ],
0620 "plugins": {
0621 "requires": "nsPlugin"
0622 },
0623 "setup": [
0624 [
0625 "$TC actions flush action gact",
0626 0,
0627 1,
0628 255
0629 ],
0630 "$TC qdisc add dev $DEV1 ingress",
0631 "$TC actions add action pass index 1",
0632 "$TC filter add dev $DEV1 protocol all ingress prio 1 handle 0x1234 matchall action gact index 1"
0633 ],
0634 "cmdUnderTest": "$TC actions flush action gact",
0635 "expExitCode": "1",
0636 "verifyCmd": "$TC actions ls action gact",
0637 "matchPattern": "total acts 1.*action order [0-9]*: gact action pass.*index 1 ref 2 bind 1",
0638 "matchCount": "1",
0639 "teardown": [
0640 "$TC qdisc del dev $DEV1 ingress",
0641 [
0642 "sleep 1; $TC actions flush action gact",
0643 0,
0644 1
0645 ]
0646 ]
0647 },
0648 {
0649 "id": "ae1e",
0650 "name": "Try to flush actions when last one is referenced by filter",
0651 "category": [
0652 "actions",
0653 "gact"
0654 ],
0655 "plugins": {
0656 "requires": "nsPlugin"
0657 },
0658 "setup": [
0659 [
0660 "$TC actions flush action gact",
0661 0,
0662 1,
0663 255
0664 ],
0665 "$TC qdisc add dev $DEV1 ingress",
0666 [
0667 "$TC actions add action pass index 1",
0668 0,
0669 1,
0670 255
0671 ],
0672 "$TC actions add action reclassify index 2",
0673 "$TC actions add action drop index 3",
0674 "$TC filter add dev $DEV1 protocol all ingress prio 1 handle 0x1234 matchall action gact index 3"
0675 ],
0676 "cmdUnderTest": "$TC actions flush action gact",
0677 "expExitCode": "0",
0678 "verifyCmd": "$TC actions ls action gact",
0679 "matchPattern": "total acts 1.*action order [0-9]*: gact action drop.*index 3 ref 2 bind 1",
0680 "matchCount": "1",
0681 "teardown": [
0682 "$TC qdisc del dev $DEV1 ingress",
0683 [
0684 "sleep 1; $TC actions flush action gact",
0685 0,
0686 1
0687 ]
0688 ]
0689 }
0690 ]