Skip to content

Commit

Permalink
[show][muxcable] update show mux tunnel-route to check soc_ipv6 as …
Browse files Browse the repository at this point in the history
…well
  • Loading branch information
zjswhhh authored and yxieca committed Jul 13, 2023
1 parent 24fc1db commit 58db48a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion show/muxcable.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def get_tunnel_route_per_port(db, port_tunnel_route, per_npu_configdb, per_npu_a

mux_cfg_dict = per_npu_configdb[asic_id].get_all(
per_npu_configdb[asic_id].CONFIG_DB, 'MUX_CABLE|{}'.format(port))
dest_names = ["server_ipv4", "server_ipv6", "soc_ipv4"]
dest_names = ["server_ipv4", "server_ipv6", "soc_ipv4", "soc_ipv6"]

for name in dest_names:
dest_address = mux_cfg_dict.get(name, None)
Expand Down
6 changes: 5 additions & 1 deletion tests/mock_tables/asic_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@
"ASIC_STATE:SAI_OBJECT_TYPE_ROUTE_ENTRY:{\"dest\":\"10.2.1.1\",\"switch_id\":\"oid:0x21000000000000\",\"vr\":\"oid:0x300000000007c\"}": {
"SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD",
"SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID": "oid:0x40000000015d8"
}
},
"ASIC_STATE:SAI_OBJECT_TYPE_ROUTE_ENTRY:{\"dest\":\"e801::47\",\"switch_id\":\"oid:0x21000000000000\",\"vr\":\"oid:0x300000000007c\"}": {
"SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION": "SAI_PACKET_ACTION_FORWARD",
"SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID": "oid:0x40000000015d8"
}
}
3 changes: 2 additions & 1 deletion tests/mock_tables/config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,8 @@
"MUX_CABLE|Ethernet4": {
"state": "auto",
"server_ipv4": "10.3.1.1",
"server_ipv6": "e801::46"
"server_ipv6": "e801::46",
"soc_ipv6": "e801::47"
},
"MUX_CABLE|Ethernet8": {
"state": "active",
Expand Down
6 changes: 6 additions & 0 deletions tests/muxcable_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@
"DEST": "10.3.1.1",
"kernel": 1,
"asic": false
},
"soc_ipv6": {
"DEST": "e801::47",
"kernel": false,
"asic": 1
}
}
}
Expand All @@ -591,6 +596,7 @@
--------- ----------- -------------- -------- ------
Ethernet0 server_ipv4 10.2.1.1 added added
Ethernet4 server_ipv4 10.3.1.1 added -
Ethernet4 soc_ipv6 e801::47 - added
"""

show_muxcable_tunnel_route_expected_output_port_json="""\
Expand Down

0 comments on commit 58db48a

Please sign in to comment.