Skip to content

Commit a275a29

Browse files
authored
Fix ssip issue (sonic-net#15639)
when removing mgmt vrf, dut connection will be lost for a while. So, before config reload we need remove mgmt vrf, otherwise it will cause host unreachable.
1 parent 195af4c commit a275a29

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/syslog/test_syslog_source_ip.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,19 @@ def is_support_ssip(duthosts, enum_rand_one_per_hwsku_frontend_hostname):
8585

8686

8787
@pytest.fixture(scope="module", autouse=True)
88-
def restore_config_by_config_reload(duthosts, enum_rand_one_per_hwsku_frontend_hostname):
88+
def restore_config_by_config_reload(duthosts, enum_rand_one_per_hwsku_frontend_hostname, localhost):
8989
yield
90-
config_reload(duthosts[enum_rand_one_per_hwsku_frontend_hostname])
90+
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
91+
92+
if is_mgmt_vrf_enabled(duthost):
93+
# when removing mgmt vrf, dut connection will be lost for a while. So, before config reload,
94+
# we need remove mgmt vrf, otherwise it will cause host unreachable
95+
remove_vrf(duthost, VRF_LIST[2])
96+
localhost.wait_for(host=duthost.mgmt_ip, port=SONIC_SSH_PORT, search_regex=SONIC_SSH_REGEX,
97+
state='absent', delay=1, timeout=30)
98+
localhost.wait_for(host=duthost.mgmt_ip, port=SONIC_SSH_PORT, search_regex=SONIC_SSH_REGEX,
99+
state='started', delay=2, timeout=180)
100+
config_reload(duthost)
91101

92102

93103
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)