Skip to content

Commit ca53b1b

Browse files
dayouliu1mssonicbld
authored andcommitted
Skip forced mgmt route test if intf is invalid (sonic-net#13438)
What is the motivation for this PR? Skip test_forced_mgmt_route_add_and_remove_by_mgmt_port_status in route/test_forced_mgmt_route.py if eth1 does not exist or is being used. This test was failing on Arista platforms when interface eth1 did not exist. How did you do it? Added a check to see if eth1 does not exist, and skips the test if so. How did you verify/test it? Tested on a t0 setup on a Arista-7260
1 parent 3e7148a commit ca53b1b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/route/test_forced_mgmt_route.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@ def test_forced_mgmt_route_add_and_remove_by_mgmt_port_status(
126126
config_db_mgmt_interface = config_db_json["MGMT_INTERFACE"]
127127
config_db_port = config_db_json["MGMT_PORT"]
128128

129-
# Skip multi-asic because override_config format are different.
129+
# Skip if port does not exist
130+
output = duthost.command("ip link show eth1", module_ignore_errors=True)
131+
if output["failed"]:
132+
pytest.skip("Skip test_forced_mgmt_route_add_and_remove_by_mgmt_port_status, port does not exist")
133+
134+
# Skip if port is already in use
130135
if 'eth1' in config_db_port:
131-
pytest.skip("Skip test_forced_mgmt_route_add_and_remove_by_mgmt_port_status for multi-mgmt device")
136+
pytest.skip("Skip test_forced_mgmt_route_add_and_remove_by_mgmt_port_status, port in use")
132137

133138
# Add eth1 to mgmt interface and port
134139
ipv4_forced_mgmt_address = "172.17.1.1/24"

0 commit comments

Comments
 (0)