hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json
....@@ -629,7 +629,7 @@
629629 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 0102:80:00880022 index 1",
630630 "expExitCode": "0",
631631 "verifyCmd": "$TC actions get action tunnel_key index 1",
632
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 0102:80:00880022.*index 1",
632
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 0102:80:00880022.*index 1",
633633 "matchCount": "1",
634634 "teardown": [
635635 "$TC actions flush action tunnel_key"
....@@ -653,7 +653,7 @@
653653 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 0102:80:00880022,0408:42:0040007611223344,0111:02:1020304011223344 index 1",
654654 "expExitCode": "0",
655655 "verifyCmd": "$TC actions get action tunnel_key index 1",
656
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 0102:80:00880022,0408:42:0040007611223344,0111:02:1020304011223344.*index 1",
656
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 0102:80:00880022,0408:42:0040007611223344,0111:02:1020304011223344.*index 1",
657657 "matchCount": "1",
658658 "teardown": [
659659 "$TC actions flush action tunnel_key"
....@@ -677,7 +677,7 @@
677677 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 824212:80:00880022 index 1",
678678 "expExitCode": "255",
679679 "verifyCmd": "$TC actions get action tunnel_key index 1",
680
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 824212:80:00880022.*index 1",
680
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 824212:80:00880022.*index 1",
681681 "matchCount": "0",
682682 "teardown": [
683683 "$TC actions flush action tunnel_key"
....@@ -701,7 +701,7 @@
701701 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 0102:4224:00880022 index 1",
702702 "expExitCode": "255",
703703 "verifyCmd": "$TC actions get action tunnel_key index 1",
704
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 0102:4224:00880022.*index 1",
704
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 0102:4224:00880022.*index 1",
705705 "matchCount": "0",
706706 "teardown": [
707707 "$TC actions flush action tunnel_key"
....@@ -725,7 +725,7 @@
725725 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 0102:80:4288 index 1",
726726 "expExitCode": "255",
727727 "verifyCmd": "$TC actions get action tunnel_key index 1",
728
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 0102:80:4288.*index 1",
728
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 0102:80:4288.*index 1",
729729 "matchCount": "0",
730730 "teardown": [
731731 "$TC actions flush action tunnel_key"
....@@ -749,7 +749,7 @@
749749 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 0102:80:4288428822 index 1",
750750 "expExitCode": "255",
751751 "verifyCmd": "$TC actions get action tunnel_key index 1",
752
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 0102:80:4288428822.*index 1",
752
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 0102:80:4288428822.*index 1",
753753 "matchCount": "0",
754754 "teardown": [
755755 "$TC actions flush action tunnel_key"
....@@ -773,7 +773,7 @@
773773 "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 1.1.1.1 dst_ip 2.2.2.2 id 42 dst_port 6081 geneve_opts 0102:80:00880022,0408:42: index 1",
774774 "expExitCode": "255",
775775 "verifyCmd": "$TC actions get action tunnel_key index 1",
776
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt 0102:80:00880022,0408:42:.*index 1",
776
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 1.1.1.1.*dst_ip 2.2.2.2.*key_id 42.*dst_port 6081.*geneve_opt[s]? 0102:80:00880022,0408:42:.*index 1",
777777 "matchCount": "0",
778778 "teardown": [
779779 "$TC actions flush action tunnel_key"
....@@ -818,12 +818,12 @@
818818 1,
819819 255
820820 ],
821
- "$TC actions add action tunnel_key set src_ip 10.10.10.1 dst_ip 20.20.20.2 dst_port 3128 nocsum id 1 index 1 cookie aabbccddeeff112233445566778800a"
821
+ "$TC actions add action tunnel_key set src_ip 10.10.10.1 dst_ip 20.20.20.2 dst_port 3128 nocsum id 1 index 1 cookie 123456"
822822 ],
823
- "cmdUnderTest": "$TC actions replace action tunnel_key set src_ip 11.11.11.1 dst_ip 21.21.21.2 dst_port 3129 id 11 csum reclassify index 1 cookie a1b1c1d1",
823
+ "cmdUnderTest": "$TC actions replace action tunnel_key set src_ip 11.11.11.1 dst_ip 21.21.21.2 dst_port 3129 id 11 csum reclassify index 1 cookie 123456",
824824 "expExitCode": "0",
825825 "verifyCmd": "$TC actions get action tunnel_key index 1",
826
- "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 11.11.11.1.*dst_ip 21.21.21.2.*key_id 11.*dst_port 3129.*csum reclassify.*index 1.*cookie a1b1c1d1",
826
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 11.11.11.1.*dst_ip 21.21.21.2.*key_id 11.*dst_port 3129.*csum reclassify.*index 1.*cookie 123456",
827827 "matchCount": "1",
828828 "teardown": [
829829 "$TC actions flush action tunnel_key"
....@@ -884,5 +884,54 @@
884884 "teardown": [
885885 "$TC actions flush action tunnel_key"
886886 ]
887
+ },
888
+ {
889
+ "id": "8242",
890
+ "name": "Replace tunnel_key set action with invalid goto chain",
891
+ "category": [
892
+ "actions",
893
+ "tunnel_key"
894
+ ],
895
+ "setup": [
896
+ [
897
+ "$TC actions flush action tunnel_key",
898
+ 0,
899
+ 1,
900
+ 255
901
+ ],
902
+ "$TC actions add action tunnel_key set src_ip 10.10.10.1 dst_ip 20.20.20.2 dst_port 3128 nocsum id 1 pass index 90"
903
+ ],
904
+ "cmdUnderTest": "$TC actions replace action tunnel_key set src_ip 10.10.10.2 dst_ip 20.20.20.1 dst_port 3129 id 2 csum goto chain 42 index 90 cookie c1a0c1a0",
905
+ "expExitCode": "255",
906
+ "verifyCmd": "$TC actions get action tunnel_key index 90",
907
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 10.10.10.1.*dst_ip 20.20.20.2.*key_id 1.*dst_port 3128.*csum pass.*index 90 ref",
908
+ "matchCount": "1",
909
+ "teardown": [
910
+ "$TC actions flush action tunnel_key"
911
+ ]
912
+ },
913
+ {
914
+ "id": "0cd2",
915
+ "name": "Add tunnel_key set action with no_percpu flag",
916
+ "category": [
917
+ "actions",
918
+ "tunnel_key"
919
+ ],
920
+ "setup": [
921
+ [
922
+ "$TC actions flush action tunnel_key",
923
+ 0,
924
+ 1,
925
+ 255
926
+ ]
927
+ ],
928
+ "cmdUnderTest": "$TC actions add action tunnel_key set src_ip 10.10.10.1 dst_ip 20.20.20.2 id 1 no_percpu",
929
+ "expExitCode": "0",
930
+ "verifyCmd": "$TC actions list action tunnel_key",
931
+ "matchPattern": "action order [0-9]+: tunnel_key.*set.*src_ip 10.10.10.1.*dst_ip 20.20.20.2.*key_id 1.*no_percpu",
932
+ "matchCount": "1",
933
+ "teardown": [
934
+ "$TC actions flush action tunnel_key"
935
+ ]
887936 }
888937 ]