Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tc-tests: actions: add MPLS tests

Add a new series of selftests to verify the functionality of act_mpls in
TC.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

John Hurley and committed by
David S. Miller
6fb8dbca 2a2ea508

+1089
+1
tools/testing/selftests/tc-testing/config
··· 42 42 CONFIG_NET_ACT_SKBMOD=m 43 43 CONFIG_NET_ACT_IFE=m 44 44 CONFIG_NET_ACT_TUNNEL_KEY=m 45 + CONFIG_NET_ACT_MPLS=m 45 46 CONFIG_NET_IFE_SKBMARK=m 46 47 CONFIG_NET_IFE_SKBPRIO=m 47 48 CONFIG_NET_IFE_SKBTCINDEX=m
+1088
tools/testing/selftests/tc-testing/tc-tests/actions/mpls.json
··· 1 + [ 2 + { 3 + "id": "a933", 4 + "name": "Add MPLS dec_ttl action with pipe opcode", 5 + "category": [ 6 + "actions", 7 + "mpls" 8 + ], 9 + "setup": [ 10 + [ 11 + "$TC actions flush action mpls", 12 + 0, 13 + 1, 14 + 255 15 + ] 16 + ], 17 + "cmdUnderTest": "$TC actions add action mpls dec_ttl pipe index 8", 18 + "expExitCode": "0", 19 + "verifyCmd": "$TC actions list action mpls", 20 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*pipe.*index 8 ref", 21 + "matchCount": "1", 22 + "teardown": [ 23 + "$TC actions flush action mpls" 24 + ] 25 + }, 26 + { 27 + "id": "08d1", 28 + "name": "Add mpls dec_ttl action with pass opcode", 29 + "category": [ 30 + "actions", 31 + "mpls" 32 + ], 33 + "setup": [ 34 + [ 35 + "$TC actions flush action mpls", 36 + 0, 37 + 1, 38 + 255 39 + ] 40 + ], 41 + "cmdUnderTest": "$TC actions add action mpls dec_ttl pass index 8", 42 + "expExitCode": "0", 43 + "verifyCmd": "$TC actions get action mpls index 8", 44 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*pass.*index 8 ref", 45 + "matchCount": "1", 46 + "teardown": [ 47 + "$TC actions flush action mpls" 48 + ] 49 + }, 50 + { 51 + "id": "d786", 52 + "name": "Add mpls dec_ttl action with drop opcode", 53 + "category": [ 54 + "actions", 55 + "mpls" 56 + ], 57 + "setup": [ 58 + [ 59 + "$TC actions flush action mpls", 60 + 0, 61 + 1, 62 + 255 63 + ] 64 + ], 65 + "cmdUnderTest": "$TC actions add action mpls dec_ttl drop index 8", 66 + "expExitCode": "0", 67 + "verifyCmd": "$TC actions get action mpls index 8", 68 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*drop.*index 8 ref", 69 + "matchCount": "1", 70 + "teardown": [ 71 + "$TC actions flush action mpls" 72 + ] 73 + }, 74 + { 75 + "id": "f334", 76 + "name": "Add mpls dec_ttl action with reclassify opcode", 77 + "category": [ 78 + "actions", 79 + "mpls" 80 + ], 81 + "setup": [ 82 + [ 83 + "$TC actions flush action mpls", 84 + 0, 85 + 1, 86 + 255 87 + ] 88 + ], 89 + "cmdUnderTest": "$TC actions add action mpls dec_ttl reclassify index 8", 90 + "expExitCode": "0", 91 + "verifyCmd": "$TC actions get action mpls index 8", 92 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*reclassify.*index 8 ref", 93 + "matchCount": "1", 94 + "teardown": [ 95 + "$TC actions flush action mpls" 96 + ] 97 + }, 98 + { 99 + "id": "29bd", 100 + "name": "Add mpls dec_ttl action with continue opcode", 101 + "category": [ 102 + "actions", 103 + "mpls" 104 + ], 105 + "setup": [ 106 + [ 107 + "$TC actions flush action mpls", 108 + 0, 109 + 1, 110 + 255 111 + ] 112 + ], 113 + "cmdUnderTest": "$TC actions add action mpls dec_ttl continue index 8", 114 + "expExitCode": "0", 115 + "verifyCmd": "$TC actions get action mpls index 8", 116 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*continue.*index 8 ref", 117 + "matchCount": "1", 118 + "teardown": [ 119 + "$TC actions flush action mpls" 120 + ] 121 + }, 122 + { 123 + "id": "48df", 124 + "name": "Add mpls dec_ttl action with jump opcode", 125 + "category": [ 126 + "actions", 127 + "mpls" 128 + ], 129 + "setup": [ 130 + [ 131 + "$TC actions flush action mpls", 132 + 0, 133 + 1, 134 + 255 135 + ] 136 + ], 137 + "cmdUnderTest": "$TC actions add action mpls dec_ttl jump 10 index 8", 138 + "expExitCode": "0", 139 + "verifyCmd": "$TC actions list action mpls", 140 + "matchPattern": "action order [0-9]+: mpls.*jump 10.*index 8 ref", 141 + "matchCount": "1", 142 + "teardown": [ 143 + "$TC actions flush action mpls" 144 + ] 145 + }, 146 + { 147 + "id": "62eb", 148 + "name": "Add mpls dec_ttl action with trap opcode", 149 + "category": [ 150 + "actions", 151 + "mpls" 152 + ], 153 + "setup": [ 154 + [ 155 + "$TC actions flush action mpls", 156 + 0, 157 + 1, 158 + 255 159 + ] 160 + ], 161 + "cmdUnderTest": "$TC actions add action mpls dec_ttl trap index 8", 162 + "expExitCode": "0", 163 + "verifyCmd": "$TC actions list action mpls", 164 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl trap.*index 8 ref", 165 + "matchCount": "1", 166 + "teardown": [ 167 + "$TC actions flush action mpls" 168 + ] 169 + }, 170 + { 171 + "id": "9118", 172 + "name": "Add mpls dec_ttl action with invalid opcode", 173 + "category": [ 174 + "actions", 175 + "mpls" 176 + ], 177 + "setup": [ 178 + [ 179 + "$TC actions flush action mpls", 180 + 0, 181 + 1, 182 + 255 183 + ] 184 + ], 185 + "cmdUnderTest": "$TC actions add action mpls dec_ttl foo index 8", 186 + "expExitCode": "255", 187 + "verifyCmd": "$TC actions list action mpls", 188 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*foo.*index 8 ref", 189 + "matchCount": "0", 190 + "teardown": [] 191 + }, 192 + { 193 + "id": "6ce1", 194 + "name": "Add mpls dec_ttl action with label (invalid)", 195 + "category": [ 196 + "actions", 197 + "mpls" 198 + ], 199 + "setup": [ 200 + [ 201 + "$TC actions flush action mpls", 202 + 0, 203 + 1, 204 + 255 205 + ] 206 + ], 207 + "cmdUnderTest": "$TC actions add action mpls dec_ttl label 20", 208 + "expExitCode": "255", 209 + "verifyCmd": "$TC actions list action mpls", 210 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*label.*20.*pipe", 211 + "matchCount": "0", 212 + "teardown": [] 213 + }, 214 + { 215 + "id": "352f", 216 + "name": "Add mpls dec_ttl action with tc (invalid)", 217 + "category": [ 218 + "actions", 219 + "mpls" 220 + ], 221 + "setup": [ 222 + [ 223 + "$TC actions flush action mpls", 224 + 0, 225 + 1, 226 + 255 227 + ] 228 + ], 229 + "cmdUnderTest": "$TC actions add action mpls dec_ttl tc 3", 230 + "expExitCode": "255", 231 + "verifyCmd": "$TC actions list action mpls", 232 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*tc.*3.*pipe", 233 + "matchCount": "0", 234 + "teardown": [] 235 + }, 236 + { 237 + "id": "fa1c", 238 + "name": "Add mpls dec_ttl action with ttl (invalid)", 239 + "category": [ 240 + "actions", 241 + "mpls" 242 + ], 243 + "setup": [ 244 + [ 245 + "$TC actions flush action mpls", 246 + 0, 247 + 1, 248 + 255 249 + ] 250 + ], 251 + "cmdUnderTest": "$TC actions add action mpls dec_ttl ttl 20", 252 + "expExitCode": "255", 253 + "verifyCmd": "$TC actions list action mpls", 254 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*ttl.*20.*pipe", 255 + "matchCount": "0", 256 + "teardown": [] 257 + }, 258 + { 259 + "id": "6b79", 260 + "name": "Add mpls dec_ttl action with bos (invalid)", 261 + "category": [ 262 + "actions", 263 + "mpls" 264 + ], 265 + "setup": [ 266 + [ 267 + "$TC actions flush action mpls", 268 + 0, 269 + 1, 270 + 255 271 + ] 272 + ], 273 + "cmdUnderTest": "$TC actions add action mpls dec_ttl bos 1", 274 + "expExitCode": "255", 275 + "verifyCmd": "$TC actions list action mpls", 276 + "matchPattern": "action order [0-9]+: mpls.*dec_ttl.*bos.*1.*pipe", 277 + "matchCount": "0", 278 + "teardown": [] 279 + }, 280 + { 281 + "id": "d4c4", 282 + "name": "Add mpls pop action with ip proto", 283 + "category": [ 284 + "actions", 285 + "mpls" 286 + ], 287 + "setup": [ 288 + [ 289 + "$TC actions flush action mpls", 290 + 0, 291 + 1, 292 + 255 293 + ] 294 + ], 295 + "cmdUnderTest": "$TC actions add action mpls pop protocol ipv4", 296 + "expExitCode": "0", 297 + "verifyCmd": "$TC actions list action mpls", 298 + "matchPattern": "action order [0-9]+: mpls.*pop.*protocol.*ip.*pipe", 299 + "matchCount": "1", 300 + "teardown": [ 301 + "$TC actions flush action mpls" 302 + ] 303 + }, 304 + { 305 + "id": "92fe", 306 + "name": "Add mpls pop action with mpls proto", 307 + "category": [ 308 + "actions", 309 + "mpls" 310 + ], 311 + "setup": [ 312 + [ 313 + "$TC actions flush action mpls", 314 + 0, 315 + 1, 316 + 255 317 + ] 318 + ], 319 + "cmdUnderTest": "$TC actions add action mpls pop protocol mpls_mc", 320 + "expExitCode": "0", 321 + "verifyCmd": "$TC actions list action mpls", 322 + "matchPattern": "action order [0-9]+: mpls.*pop.*protocol.*mpls_mc.*pipe", 323 + "matchCount": "1", 324 + "teardown": [ 325 + "$TC actions flush action mpls" 326 + ] 327 + }, 328 + { 329 + "id": "7e23", 330 + "name": "Add mpls pop action with no protocol (invalid)", 331 + "category": [ 332 + "actions", 333 + "mpls" 334 + ], 335 + "setup": [ 336 + [ 337 + "$TC actions flush action mpls", 338 + 0, 339 + 1, 340 + 255 341 + ] 342 + ], 343 + "cmdUnderTest": "$TC actions add action mpls pop", 344 + "expExitCode": "255", 345 + "verifyCmd": "$TC actions list action mpls", 346 + "matchPattern": "action order [0-9]+: mpls.*pop.*pipe", 347 + "matchCount": "0", 348 + "teardown": [] 349 + }, 350 + { 351 + "id": "6182", 352 + "name": "Add mpls pop action with label (invalid)", 353 + "category": [ 354 + "actions", 355 + "mpls" 356 + ], 357 + "setup": [ 358 + [ 359 + "$TC actions flush action mpls", 360 + 0, 361 + 1, 362 + 255 363 + ] 364 + ], 365 + "cmdUnderTest": "$TC actions add action mpls pop protocol ipv4 label 20", 366 + "expExitCode": "255", 367 + "verifyCmd": "$TC actions list action mpls", 368 + "matchPattern": "action order [0-9]+: mpls.*pop.*label.*20.*pipe", 369 + "matchCount": "0", 370 + "teardown": [] 371 + }, 372 + { 373 + "id": "6475", 374 + "name": "Add mpls pop action with tc (invalid)", 375 + "category": [ 376 + "actions", 377 + "mpls" 378 + ], 379 + "setup": [ 380 + [ 381 + "$TC actions flush action mpls", 382 + 0, 383 + 1, 384 + 255 385 + ] 386 + ], 387 + "cmdUnderTest": "$TC actions add action mpls pop protocol ipv4 tc 3", 388 + "expExitCode": "255", 389 + "verifyCmd": "$TC actions list action mpls", 390 + "matchPattern": "action order [0-9]+: mpls.*pop.*tc.*3.*pipe", 391 + "matchCount": "0", 392 + "teardown": [] 393 + }, 394 + { 395 + "id": "067b", 396 + "name": "Add mpls pop action with ttl (invalid)", 397 + "category": [ 398 + "actions", 399 + "mpls" 400 + ], 401 + "setup": [ 402 + [ 403 + "$TC actions flush action mpls", 404 + 0, 405 + 1, 406 + 255 407 + ] 408 + ], 409 + "cmdUnderTest": "$TC actions add action mpls pop protocol ipv4 ttl 20", 410 + "expExitCode": "255", 411 + "verifyCmd": "$TC actions list action mpls", 412 + "matchPattern": "action order [0-9]+: mpls.*pop.*ttl.*20.*pipe", 413 + "matchCount": "0", 414 + "teardown": [] 415 + }, 416 + { 417 + "id": "7316", 418 + "name": "Add mpls pop action with bos (invalid)", 419 + "category": [ 420 + "actions", 421 + "mpls" 422 + ], 423 + "setup": [ 424 + [ 425 + "$TC actions flush action mpls", 426 + 0, 427 + 1, 428 + 255 429 + ] 430 + ], 431 + "cmdUnderTest": "$TC actions add action mpls pop protocol ipv4 bos 1", 432 + "expExitCode": "255", 433 + "verifyCmd": "$TC actions list action mpls", 434 + "matchPattern": "action order [0-9]+: mpls.*pop.*bos.*1.*pipe", 435 + "matchCount": "0", 436 + "teardown": [] 437 + }, 438 + { 439 + "id": "38cc", 440 + "name": "Add mpls push action with label", 441 + "category": [ 442 + "actions", 443 + "mpls" 444 + ], 445 + "setup": [ 446 + [ 447 + "$TC actions flush action mpls", 448 + 0, 449 + 1, 450 + 255 451 + ] 452 + ], 453 + "cmdUnderTest": "$TC actions add action mpls push label 20", 454 + "expExitCode": "0", 455 + "verifyCmd": "$TC actions list action mpls", 456 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*20.*ttl.*[0-9]+.*pipe", 457 + "matchCount": "1", 458 + "teardown": [ 459 + "$TC actions flush action mpls" 460 + ] 461 + }, 462 + { 463 + "id": "c281", 464 + "name": "Add mpls push action with mpls_mc protocol", 465 + "category": [ 466 + "actions", 467 + "mpls" 468 + ], 469 + "setup": [ 470 + [ 471 + "$TC actions flush action mpls", 472 + 0, 473 + 1, 474 + 255 475 + ] 476 + ], 477 + "cmdUnderTest": "$TC actions add action mpls push protocol mpls_mc label 20", 478 + "expExitCode": "0", 479 + "verifyCmd": "$TC actions list action mpls", 480 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_mc.*label.*20.*ttl.*[0-9]+.*pipe", 481 + "matchCount": "1", 482 + "teardown": [ 483 + "$TC actions flush action mpls" 484 + ] 485 + }, 486 + { 487 + "id": "5db4", 488 + "name": "Add mpls push action with label, tc and ttl", 489 + "category": [ 490 + "actions", 491 + "mpls" 492 + ], 493 + "setup": [ 494 + [ 495 + "$TC actions flush action mpls", 496 + 0, 497 + 1, 498 + 255 499 + ] 500 + ], 501 + "cmdUnderTest": "$TC actions add action mpls push label 20 tc 3 ttl 128", 502 + "expExitCode": "0", 503 + "verifyCmd": "$TC actions list action mpls", 504 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*20.*tc.*3.*ttl.*128.*pipe", 505 + "matchCount": "1", 506 + "teardown": [ 507 + "$TC actions flush action mpls" 508 + ] 509 + }, 510 + { 511 + "id": "16eb", 512 + "name": "Add mpls push action with label and bos", 513 + "category": [ 514 + "actions", 515 + "mpls" 516 + ], 517 + "setup": [ 518 + [ 519 + "$TC actions flush action mpls", 520 + 0, 521 + 1, 522 + 255 523 + ] 524 + ], 525 + "cmdUnderTest": "$TC actions add action mpls push label 20 bos 1", 526 + "expExitCode": "0", 527 + "verifyCmd": "$TC actions list action mpls", 528 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*20.*bos.*1.*pipe", 529 + "matchCount": "1", 530 + "teardown": [ 531 + "$TC actions flush action mpls" 532 + ] 533 + }, 534 + { 535 + "id": "d69d", 536 + "name": "Add mpls push action with no label (invalid)", 537 + "category": [ 538 + "actions", 539 + "mpls" 540 + ], 541 + "setup": [ 542 + [ 543 + "$TC actions flush action mpls", 544 + 0, 545 + 1, 546 + 255 547 + ] 548 + ], 549 + "cmdUnderTest": "$TC actions add action mpls push", 550 + "expExitCode": "255", 551 + "verifyCmd": "$TC actions list action mpls", 552 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*pipe", 553 + "matchCount": "0", 554 + "teardown": [] 555 + }, 556 + { 557 + "id": "e8e4", 558 + "name": "Add mpls push action with ipv4 protocol (invalid)", 559 + "category": [ 560 + "actions", 561 + "mpls" 562 + ], 563 + "setup": [ 564 + [ 565 + "$TC actions flush action mpls", 566 + 0, 567 + 1, 568 + 255 569 + ] 570 + ], 571 + "cmdUnderTest": "$TC actions add action mpls push protocol ipv4 label 20", 572 + "expExitCode": "255", 573 + "verifyCmd": "$TC actions list action mpls", 574 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*20.*ttl.*[0-9]+.*pipe", 575 + "matchCount": "0", 576 + "teardown": [] 577 + }, 578 + { 579 + "id": "ecd0", 580 + "name": "Add mpls push action with out of range label (invalid)", 581 + "category": [ 582 + "actions", 583 + "mpls" 584 + ], 585 + "setup": [ 586 + [ 587 + "$TC actions flush action mpls", 588 + 0, 589 + 1, 590 + 255 591 + ] 592 + ], 593 + "cmdUnderTest": "$TC actions add action mpls push label 1048576", 594 + "expExitCode": "255", 595 + "verifyCmd": "$TC actions list action mpls", 596 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*1048576.*pipe", 597 + "matchCount": "0", 598 + "teardown": [] 599 + }, 600 + { 601 + "id": "d303", 602 + "name": "Add mpls push action with out of range tc (invalid)", 603 + "category": [ 604 + "actions", 605 + "mpls" 606 + ], 607 + "setup": [ 608 + [ 609 + "$TC actions flush action mpls", 610 + 0, 611 + 1, 612 + 255 613 + ] 614 + ], 615 + "cmdUnderTest": "$TC actions add action mpls push label 20 tc 8", 616 + "expExitCode": "255", 617 + "verifyCmd": "$TC actions list action mpls", 618 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*20.*tc.*8.*pipe", 619 + "matchCount": "0", 620 + "teardown": [] 621 + }, 622 + { 623 + "id": "fd6e", 624 + "name": "Add mpls push action with ttl of 0 (invalid)", 625 + "category": [ 626 + "actions", 627 + "mpls" 628 + ], 629 + "setup": [ 630 + [ 631 + "$TC actions flush action mpls", 632 + 0, 633 + 1, 634 + 255 635 + ] 636 + ], 637 + "cmdUnderTest": "$TC actions add action mpls push label 20 ttl 0", 638 + "expExitCode": "255", 639 + "verifyCmd": "$TC actions list action mpls", 640 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*20.*ttl.*0.*pipe", 641 + "matchCount": "0", 642 + "teardown": [] 643 + }, 644 + { 645 + "id": "19e9", 646 + "name": "Add mpls mod action with mpls label", 647 + "category": [ 648 + "actions", 649 + "mpls" 650 + ], 651 + "setup": [ 652 + [ 653 + "$TC actions flush action mpls", 654 + 0, 655 + 1, 656 + 255 657 + ] 658 + ], 659 + "cmdUnderTest": "$TC actions add action mpls mod label 20", 660 + "expExitCode": "0", 661 + "verifyCmd": "$TC actions list action mpls", 662 + "matchPattern": "action order [0-9]+: mpls.*modify.*label.*20.*pipe", 663 + "matchCount": "1", 664 + "teardown": [ 665 + "$TC actions flush action mpls" 666 + ] 667 + }, 668 + { 669 + "id": "1fde", 670 + "name": "Add mpls mod action with max mpls label", 671 + "category": [ 672 + "actions", 673 + "mpls" 674 + ], 675 + "setup": [ 676 + [ 677 + "$TC actions flush action mpls", 678 + 0, 679 + 1, 680 + 255 681 + ] 682 + ], 683 + "cmdUnderTest": "$TC actions add action mpls mod label 0xfffff", 684 + "expExitCode": "0", 685 + "verifyCmd": "$TC actions list action mpls", 686 + "matchPattern": "action order [0-9]+: mpls.*modify.*label.*1048575.*pipe", 687 + "matchCount": "1", 688 + "teardown": [ 689 + "$TC actions flush action mpls" 690 + ] 691 + }, 692 + { 693 + "id": "0c50", 694 + "name": "Add mpls mod action with mpls label exceeding max (invalid)", 695 + "category": [ 696 + "actions", 697 + "mpls" 698 + ], 699 + "setup": [ 700 + [ 701 + "$TC actions flush action mpls", 702 + 0, 703 + 1, 704 + 255 705 + ] 706 + ], 707 + "cmdUnderTest": "$TC actions add action mpls mod label 0x100000", 708 + "expExitCode": "255", 709 + "verifyCmd": "$TC actions list action mpls", 710 + "matchPattern": "action order [0-9]+: mpls.*modify.*label.*1048576.*pipe", 711 + "matchCount": "0", 712 + "teardown": [] 713 + }, 714 + { 715 + "id": "10b6", 716 + "name": "Add mpls mod action with mpls label of MPLS_LABEL_IMPLNULL (invalid)", 717 + "category": [ 718 + "actions", 719 + "mpls" 720 + ], 721 + "setup": [ 722 + [ 723 + "$TC actions flush action mpls", 724 + 0, 725 + 1, 726 + 255 727 + ] 728 + ], 729 + "cmdUnderTest": "$TC actions add action mpls mod label 3", 730 + "expExitCode": "255", 731 + "verifyCmd": "$TC actions list action mpls", 732 + "matchPattern": "action order [0-9]+: mpls.*modify.*label.*3.*pipe", 733 + "matchCount": "0", 734 + "teardown": [] 735 + }, 736 + { 737 + "id": "57c9", 738 + "name": "Add mpls mod action with mpls min tc", 739 + "category": [ 740 + "actions", 741 + "mpls" 742 + ], 743 + "setup": [ 744 + [ 745 + "$TC actions flush action mpls", 746 + 0, 747 + 1, 748 + 255 749 + ] 750 + ], 751 + "cmdUnderTest": "$TC actions add action mpls mod tc 0", 752 + "expExitCode": "0", 753 + "verifyCmd": "$TC actions list action mpls", 754 + "matchPattern": "action order [0-9]+: mpls.*modify.*tc.*0.*pipe", 755 + "matchCount": "1", 756 + "teardown": [ 757 + "$TC actions flush action mpls" 758 + ] 759 + }, 760 + { 761 + "id": "6872", 762 + "name": "Add mpls mod action with mpls max tc", 763 + "category": [ 764 + "actions", 765 + "mpls" 766 + ], 767 + "setup": [ 768 + [ 769 + "$TC actions flush action mpls", 770 + 0, 771 + 1, 772 + 255 773 + ] 774 + ], 775 + "cmdUnderTest": "$TC actions add action mpls mod tc 7", 776 + "expExitCode": "0", 777 + "verifyCmd": "$TC actions list action mpls", 778 + "matchPattern": "action order [0-9]+: mpls.*modify.*tc.*7.*pipe", 779 + "matchCount": "1", 780 + "teardown": [ 781 + "$TC actions flush action mpls" 782 + ] 783 + }, 784 + { 785 + "id": "a70a", 786 + "name": "Add mpls mod action with mpls tc exceeding max (invalid)", 787 + "category": [ 788 + "actions", 789 + "mpls" 790 + ], 791 + "setup": [ 792 + [ 793 + "$TC actions flush action mpls", 794 + 0, 795 + 1, 796 + 255 797 + ] 798 + ], 799 + "cmdUnderTest": "$TC actions add action mpls mod tc 8", 800 + "expExitCode": "255", 801 + "verifyCmd": "$TC actions list action mpls", 802 + "matchPattern": "action order [0-9]+: mpls.*modify.*tc.*4.*pipe", 803 + "matchCount": "0", 804 + "teardown": [] 805 + }, 806 + { 807 + "id": "6ed5", 808 + "name": "Add mpls mod action with mpls ttl", 809 + "category": [ 810 + "actions", 811 + "mpls" 812 + ], 813 + "setup": [ 814 + [ 815 + "$TC actions flush action mpls", 816 + 0, 817 + 1, 818 + 255 819 + ] 820 + ], 821 + "cmdUnderTest": "$TC actions add action mpls mod ttl 128", 822 + "expExitCode": "0", 823 + "verifyCmd": "$TC actions list action mpls", 824 + "matchPattern": "action order [0-9]+: mpls.*modify.*ttl.*128.*pipe", 825 + "matchCount": "1", 826 + "teardown": [ 827 + "$TC actions flush action mpls" 828 + ] 829 + }, 830 + { 831 + "id": "b80f", 832 + "name": "Add mpls mod action with mpls max ttl", 833 + "category": [ 834 + "actions", 835 + "mpls" 836 + ], 837 + "setup": [ 838 + [ 839 + "$TC actions flush action mpls", 840 + 0, 841 + 1, 842 + 255 843 + ] 844 + ], 845 + "cmdUnderTest": "$TC actions add action mpls mod ttl 255", 846 + "expExitCode": "0", 847 + "verifyCmd": "$TC actions list action mpls", 848 + "matchPattern": "action order [0-9]+: mpls.*modify.*ttl.*255.*pipe", 849 + "matchCount": "1", 850 + "teardown": [ 851 + "$TC actions flush action mpls" 852 + ] 853 + }, 854 + { 855 + "id": "8864", 856 + "name": "Add mpls mod action with mpls min ttl", 857 + "category": [ 858 + "actions", 859 + "mpls" 860 + ], 861 + "setup": [ 862 + [ 863 + "$TC actions flush action mpls", 864 + 0, 865 + 1, 866 + 255 867 + ] 868 + ], 869 + "cmdUnderTest": "$TC actions add action mpls mod ttl 1", 870 + "expExitCode": "0", 871 + "verifyCmd": "$TC actions list action mpls", 872 + "matchPattern": "action order [0-9]+: mpls.*modify.*ttl.*1.*pipe", 873 + "matchCount": "1", 874 + "teardown": [ 875 + "$TC actions flush action mpls" 876 + ] 877 + }, 878 + { 879 + "id": "6c06", 880 + "name": "Add mpls mod action with mpls ttl of 0 (invalid)", 881 + "category": [ 882 + "actions", 883 + "mpls" 884 + ], 885 + "setup": [ 886 + [ 887 + "$TC actions flush action mpls", 888 + 0, 889 + 1, 890 + 255 891 + ] 892 + ], 893 + "cmdUnderTest": "$TC actions add action mpls mod ttl 0", 894 + "expExitCode": "255", 895 + "verifyCmd": "$TC actions list action mpls", 896 + "matchPattern": "action order [0-9]+: mpls.*modify.*ttl.*0.*pipe", 897 + "matchCount": "0", 898 + "teardown": [] 899 + }, 900 + { 901 + "id": "b5d8", 902 + "name": "Add mpls mod action with mpls ttl exceeding max (invalid)", 903 + "category": [ 904 + "actions", 905 + "mpls" 906 + ], 907 + "setup": [ 908 + [ 909 + "$TC actions flush action mpls", 910 + 0, 911 + 1, 912 + 255 913 + ] 914 + ], 915 + "cmdUnderTest": "$TC actions add action mpls mod ttl 256", 916 + "expExitCode": "255", 917 + "verifyCmd": "$TC actions list action mpls", 918 + "matchPattern": "action order [0-9]+: mpls.*modify.*ttl.*256.*pipe", 919 + "matchCount": "0", 920 + "teardown": [] 921 + }, 922 + { 923 + "id": "451f", 924 + "name": "Add mpls mod action with mpls max bos", 925 + "category": [ 926 + "actions", 927 + "mpls" 928 + ], 929 + "setup": [ 930 + [ 931 + "$TC actions flush action mpls", 932 + 0, 933 + 1, 934 + 255 935 + ] 936 + ], 937 + "cmdUnderTest": "$TC actions add action mpls mod bos 1", 938 + "expExitCode": "0", 939 + "verifyCmd": "$TC actions list action mpls", 940 + "matchPattern": "action order [0-9]+: mpls.*modify.*bos.*1.*pipe", 941 + "matchCount": "1", 942 + "teardown": [ 943 + "$TC actions flush action mpls" 944 + ] 945 + }, 946 + { 947 + "id": "a1ed", 948 + "name": "Add mpls mod action with mpls min bos", 949 + "category": [ 950 + "actions", 951 + "mpls" 952 + ], 953 + "setup": [ 954 + [ 955 + "$TC actions flush action mpls", 956 + 0, 957 + 1, 958 + 255 959 + ] 960 + ], 961 + "cmdUnderTest": "$TC actions add action mpls mod bos 0", 962 + "expExitCode": "0", 963 + "verifyCmd": "$TC actions list action mpls", 964 + "matchPattern": "action order [0-9]+: mpls.*modify.*bos.*0.*pipe", 965 + "matchCount": "1", 966 + "teardown": [ 967 + "$TC actions flush action mpls" 968 + ] 969 + }, 970 + { 971 + "id": "3dcf", 972 + "name": "Add mpls mod action with mpls bos exceeding max (invalid)", 973 + "category": [ 974 + "actions", 975 + "mpls" 976 + ], 977 + "setup": [ 978 + [ 979 + "$TC actions flush action mpls", 980 + 0, 981 + 1, 982 + 255 983 + ] 984 + ], 985 + "cmdUnderTest": "$TC actions add action mpls mod bos 2", 986 + "expExitCode": "255", 987 + "verifyCmd": "$TC actions list action mpls", 988 + "matchPattern": "action order [0-9]+: mpls.*modify.*bos.*2.*pipe", 989 + "matchCount": "0", 990 + "teardown": [] 991 + }, 992 + { 993 + "id": "db7c", 994 + "name": "Add mpls mod action with protocol (invalid)", 995 + "category": [ 996 + "actions", 997 + "mpls" 998 + ], 999 + "setup": [ 1000 + [ 1001 + "$TC actions flush action mpls", 1002 + 0, 1003 + 1, 1004 + 255 1005 + ] 1006 + ], 1007 + "cmdUnderTest": "$TC actions add action mpls mod protocol ipv4", 1008 + "expExitCode": "255", 1009 + "verifyCmd": "$TC actions list action mpls", 1010 + "matchPattern": "action order [0-9]+: mpls.*modify.*protocol.*ip.*pipe", 1011 + "matchCount": "0", 1012 + "teardown": [] 1013 + }, 1014 + { 1015 + "id": "b070", 1016 + "name": "Replace existing mpls push action with new ID", 1017 + "category": [ 1018 + "actions", 1019 + "mpls" 1020 + ], 1021 + "setup": [ 1022 + [ 1023 + "$TC actions flush action mpls", 1024 + 0, 1025 + 1, 1026 + 255 1027 + ], 1028 + "$TC actions add action mpls push label 20 pipe index 12" 1029 + ], 1030 + "cmdUnderTest": "$TC actions replace action mpls push label 30 pipe index 12", 1031 + "expExitCode": "0", 1032 + "verifyCmd": "$TC actions get action mpls index 12", 1033 + "matchPattern": "action order [0-9]+: mpls.*push.*protocol.*mpls_uc.*label.*30.*pipe.*index 12 ref", 1034 + "matchCount": "1", 1035 + "teardown": [ 1036 + "$TC actions flush action mpls" 1037 + ] 1038 + }, 1039 + { 1040 + "id": "6cce", 1041 + "name": "Delete mpls pop action", 1042 + "category": [ 1043 + "actions", 1044 + "mpls" 1045 + ], 1046 + "setup": [ 1047 + [ 1048 + "$TC actions flush action mpls", 1049 + 0, 1050 + 1, 1051 + 255 1052 + ], 1053 + "$TC actions add action mpls pop protocol ipv4 index 44" 1054 + ], 1055 + "cmdUnderTest": "$TC actions del action mpls index 44", 1056 + "expExitCode": "0", 1057 + "verifyCmd": "$TC actions list action mpls", 1058 + "matchPattern": "action order [0-9]+: mpls.*pop.*index 44 ref", 1059 + "matchCount": "0", 1060 + "teardown": [] 1061 + }, 1062 + { 1063 + "id": "d138", 1064 + "name": "Flush mpls actions", 1065 + "category": [ 1066 + "actions", 1067 + "mpls" 1068 + ], 1069 + "setup": [ 1070 + [ 1071 + "$TC actions flush action mpls", 1072 + 0, 1073 + 1, 1074 + 255 1075 + ], 1076 + "$TC actions add action mpls push label 10 index 10", 1077 + "$TC actions add action mpls push label 20 index 20", 1078 + "$TC actions add action mpls push label 30 index 30", 1079 + "$TC actions add action mpls push label 40 index 40" 1080 + ], 1081 + "cmdUnderTest": "$TC actions flush action mpls", 1082 + "expExitCode": "0", 1083 + "verifyCmd": "$TC actions list action mpls", 1084 + "matchPattern": "action order [0-9]+: mpls.*push.*", 1085 + "matchCount": "0", 1086 + "teardown": [] 1087 + } 1088 + ]