From ccf7d5e6187372004eeda230efc68ecad5b46514 Mon Sep 17 00:00:00 2001 From: divyagayathri-hcl Date: Wed, 20 Nov 2024 05:42:54 -0800 Subject: [PATCH] [Thinkit] Adding tests/lib/switch_test_setup_helpers.expected file. --- tests/lib/BUILD.bazel | 3 + tests/lib/switch_test_setup_helpers.expected | 729 +++++++++++++++++++ 2 files changed, 732 insertions(+) create mode 100644 tests/lib/switch_test_setup_helpers.expected diff --git a/tests/lib/BUILD.bazel b/tests/lib/BUILD.bazel index 7f7b8a37..1e78dc02 100644 --- a/tests/lib/BUILD.bazel +++ b/tests/lib/BUILD.bazel @@ -11,6 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +load("//p4_pdpi/testing:diff_test.bzl", "cmd_diff_test") + package( default_visibility = ["//visibility:public"], licenses = ["notice"], diff --git a/tests/lib/switch_test_setup_helpers.expected b/tests/lib/switch_test_setup_helpers.expected new file mode 100644 index 00000000..47b1aeca --- /dev/null +++ b/tests/lib/switch_test_setup_helpers.expected @@ -0,0 +1,729 @@ +================================================================================ +1,2,some_port -> a_port +Available ports: a_port +================================================================================ +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "router_interface_table" +matches { + name: "router_interface_id" + exact { + str: "router-interface-1" + } +} +action { + name: "set_port_and_src_mac" + params { + name: "port" + value { + str: "1" + } + } + params { + name: "src_mac" + value { + mac: "00:02:03:04:05:06" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action.params[0].value.str: "1" -> "a_port" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "wcmp_group_table" +matches { + name: "wcmp_group_id" + exact { + str: "group-4294934545" + } +} +action_set { + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-1" + } + } + } + weight: 1 + watch_port: "2" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "some_port" + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action_set.actions[0].watch_port: "2" -> "a_port" +modified: action_set.actions[1].watch_port: "some_port" -> "a_port" + +================================================================================ +1 -> Exactly one of {2,3} +Available ports: 2,3 +================================================================================ +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "router_interface_table" +matches { + name: "router_interface_id" + exact { + str: "router-interface-1" + } +} +action { + name: "set_port_and_src_mac" + params { + name: "port" + value { + str: "1" + } + } + params { + name: "src_mac" + value { + mac: "00:02:03:04:05:06" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action.params[0].value.str: "1" -> "3" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "wcmp_group_table" +matches { + name: "wcmp_group_id" + exact { + str: "group-4294934545" + } +} +action_set { + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-1" + } + } + } + weight: 1 + watch_port: "1" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "1" + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action_set.actions[0].watch_port: "1" -> "3" +modified: action_set.actions[1].watch_port: "1" -> "3" + +================================================================================ +Unchanged due to only existing ports +Available ports: 2,3 +================================================================================ +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "router_interface_table" +matches { + name: "router_interface_id" + exact { + str: "router-interface-1" + } +} +action { + name: "set_port_and_src_mac" + params { + name: "port" + value { + str: "2" + } + } + params { + name: "src_mac" + value { + mac: "00:02:03:04:05:06" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "wcmp_group_table" +matches { + name: "wcmp_group_id" + exact { + str: "group-4294934545" + } +} +action_set { + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-1" + } + } + } + weight: 1 + watch_port: "2" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "3" + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +================================================================================ +All unchanged due to no ports +Available ports: 1 +================================================================================ +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "neighbor_table" +matches { + name: "router_interface_id" + exact { + str: "router-interface-1" + } +} +matches { + name: "neighbor_id" + exact { + str: "fe80::3e28:6dff:fe34:c002" + } +} +action { + name: "set_dst_mac" + params { + name: "dst_mac" + value { + mac: "3c:28:6d:34:c0:02" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "nexthop_table" +matches { + name: "nexthop_id" + exact { + str: "nexthop-1" + } +} +action { + name: "set_nexthop" + params { + name: "router_interface_id" + value { + str: "router-interface-1" + } + } + params { + name: "neighbor_id" + value { + str: "fe80::3e28:6dff:fe34:c002" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "ipv4_table" +matches { + name: "vrf_id" + exact { + str: "vrf-80" + } +} +action { + name: "set_wcmp_group_id" + params { + name: "wcmp_group_id" + value { + str: "group-4294934531" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "ipv6_table" +matches { + name: "vrf_id" + exact { + str: "vrf-80" + } +} +action { + name: "set_wcmp_group_id" + params { + name: "wcmp_group_id" + value { + str: "group-4294934531" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "vrf_table" +matches { + name: "vrf_id" + exact { + str: "vrf-80" + } +} +action { + name: "no_action" +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +================================================================================ +Roughly even number of 1, 2, and 'a_port', with existing 'a_port' and port-less entries unchanged +Available ports: 1,2,a_port +================================================================================ +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "neighbor_table" +matches { + name: "router_interface_id" + exact { + str: "router-interface-1" + } +} +matches { + name: "neighbor_id" + exact { + str: "fe80::3e28:6dff:fe34:c002" + } +} +action { + name: "set_dst_mac" + params { + name: "dst_mac" + value { + mac: "3c:28:6d:34:c0:02" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "router_interface_table" +matches { + name: "router_interface_id" + exact { + str: "router-interface-1" + } +} +action { + name: "set_port_and_src_mac" + params { + name: "port" + value { + str: "a_port" + } + } + params { + name: "src_mac" + value { + mac: "00:02:03:04:05:06" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +NONE + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "wcmp_group_table" +matches { + name: "wcmp_group_id" + exact { + str: "group-4294934545" + } +} +action_set { + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-1" + } + } + } + weight: 1 + watch_port: "4" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "5" + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action_set.actions[0].watch_port: "4" -> "a_port" +modified: action_set.actions[1].watch_port: "5" -> "2" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "mirror_session_table" +matches { + name: "mirror_session_id" + exact { + str: "mirror-session-201326593" + } +} +action { + name: "mirror_as_ipv4_erspan" + params { + name: "port" + value { + str: "6" + } + } + params { + name: "src_ip" + value { + ipv4: "10.206.196.0" + } + } + params { + name: "dst_ip" + value { + ipv4: "172.20.0.202" + } + } + params { + name: "src_mac" + value { + mac: "00:02:03:04:05:06" + } + } + params { + name: "dst_mac" + value { + mac: "00:1a:11:17:5f:80" + } + } + params { + name: "ttl" + value { + hex_str: "0x40" + } + } + params { + name: "tos" + value { + hex_str: "0x00" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action.params[0].value.str: "6" -> "1" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "l3_admit_table" +matches { + name: "dst_mac" + ternary { + value { + mac: "02:32:0a:ce:c4:04" + } + mask { + mac: "ff:ff:ff:ff:ff:ff" + } + } +} +matches { + name: "in_port" + optional { + value { + str: "7" + } + } +} +priority: 2030 +action { + name: "admit_to_l3" +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: matches[1].optional.value.str: "7" -> "a_port" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "acl_ingress_table" +matches { + name: "is_ipv4" + optional { + value { + hex_str: "0x1" + } + } +} +matches { + name: "ip_protocol" + ternary { + value { + hex_str: "0x11" + } + mask { + hex_str: "0xff" + } + } +} +matches { + name: "l4_dst_port" + ternary { + value { + hex_str: "0x0223" + } + mask { + hex_str: "0xffff" + } + } +} +matches { + name: "in_port" + optional { + value { + str: "8" + } + } +} +priority: 3100 +action { + name: "acl_drop" +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: matches[3].optional.value.str: "8" -> "2" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "acl_pre_ingress_table" +matches { + name: "in_port" + optional { + value { + str: "9" + } + } +} +priority: 1151 +action { + name: "set_vrf" + params { + name: "vrf_id" + value { + str: "vrf-210" + } + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: matches[0].optional.value.str: "9" -> "1" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "acl_egress_table" +matches { + name: "ether_type" + ternary { + value { + hex_str: "0x0800" + } + mask { + hex_str: "" + } + } +} +matches { + name: "ip_protocol" + ternary { + value { + hex_str: "0x11" + } + mask { + hex_str: "0xff" + } + } +} +matches { + name: "l4_dst_port" + ternary { + value { + hex_str: "0x0223" + } + mask { + hex_str: "0xffff" + } + } +} +matches { + name: "out_port" + optional { + value { + str: "10" + } + } +} +priority: 3101 +action { + name: "acl_drop" +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: matches[3].optional.value.str: "10" -> "2" + +-- ORIGINAL ENTRY -------------------------------------------------------------- +table_name: "wcmp_group_table" +matches { + name: "wcmp_group_id" + exact { + str: "group-4294934545" + } +} +action_set { + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-1" + } + } + } + weight: 1 + watch_port: "11" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "12" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "13" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "14" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "15" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "16" + } + actions { + action { + name: "set_nexthop_id" + params { + name: "nexthop_id" + value { + str: "nexthop-2" + } + } + } + weight: 1 + watch_port: "17" + } +} +-- MODIFICATIONS --------------------------------------------------------------- +modified: action_set.actions[0].watch_port: "11" -> "1" +modified: action_set.actions[1].watch_port: "12" -> "a_port" +modified: action_set.actions[2].watch_port: "13" -> "2" +modified: action_set.actions[3].watch_port: "14" -> "1" +modified: action_set.actions[4].watch_port: "15" -> "a_port" +modified: action_set.actions[5].watch_port: "16" -> "2" +modified: action_set.actions[6].watch_port: "17" -> "1" +