Skip to content

Commit 14cde77

Browse files
authored
[GCU] Reload after lo test to recover default route (#16084)
What is the motivation for this PR? default route test would fail after lo test How did you do it? Recover default route after test How did you verify/test it? E2E test
1 parent 6860828 commit 14cde77

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/generic_config_updater/test_lo_interface.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import ipaddress
44

55
from tests.common.helpers.assertions import pytest_assert
6+
from tests.common.utilities import wait_until
7+
from tests.common.config_reload import config_reload
68
from tests.common.gu_utils import apply_patch, expect_op_success, expect_op_failure
79
from tests.common.gu_utils import generate_tmpfile, delete_tmpfile
810
from tests.common.gu_utils import format_json_patch_for_multiasic
@@ -73,6 +75,14 @@ def setup_env(duthosts, rand_one_dut_hostname, lo_intf):
7375
check_show_ip_intf(
7476
duthost, DEFAULT_LOOPBACK,
7577
[lo_intf["ipv6"].lower()], ["Vrf"], is_ipv4=False)
78+
79+
# Loopback interface removal will impact default route. Restart bgp to recover routes.
80+
duthost.shell("sudo systemctl restart bgp")
81+
if not wait_until(240, 10, 0, duthost.check_default_route):
82+
logger.warning(
83+
"Default routes not recovered after restart bgp, restoring with `config_reload`"
84+
)
85+
config_reload(duthost)
7686
finally:
7787
delete_checkpoint(duthost)
7888

0 commit comments

Comments
 (0)