Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use safe config reload for some tests #5564

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/acl/test_acl_outer_vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def teardown(duthosts, rand_one_dut_hostname):
"""
yield
duthost = duthosts[rand_one_dut_hostname]
config_reload(duthost)
config_reload(duthost, safe_reload=True)

class AclVlanOuterTest_Base(object):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/arp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def common_setup_teardown(duthosts, ptfhost, enum_rand_one_per_hwsku_frontend_ho
yield duthost, ptfhost, router_mac
finally:
#Recover DUT interface IP address
config_reload(duthost, config_source='config_db', wait=120)
config_reload(duthost, config_source='config_db', safe_reload=True)

@pytest.fixture
def garp_enabled(rand_selected_dut, config_facts):
Expand Down
2 changes: 1 addition & 1 deletion tests/bgp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def backup_bgp_config(duthost):
try:
apply_default_bgp_config(duthost)
except Exception:
config_reload(duthost)
config_reload(duthost, safe_reload=True)
apply_default_bgp_config(duthost)

@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/common/system_utils/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def swap_syncd(duthost, creds):
)

logger.info("Reloading config and restarting swss...")
config_reload(duthost)
config_reload(duthost, safe_reload=True)

_perform_syncd_liveness_check(duthost)

Expand Down
4 changes: 2 additions & 2 deletions tests/copp/test_copp.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def _setup_testbed(dut, creds, ptf, test_params, tbinfo):
# NOTE: Even if the rpc syncd image is already installed, we need to restart
# SWSS for the COPP changes to take effect.
logging.info("Reloading config and restarting swss...")
config_reload(dut)
config_reload(dut, safe_reload=True)

logging.info("Configure syncd RPC for testing")
copp_utils.configure_syncd(dut, test_params.nn_target_port, test_params.nn_target_interface,
Expand All @@ -387,7 +387,7 @@ def _teardown_testbed(dut, creds, ptf, test_params, tbinfo):
else:
copp_utils.restore_syncd(dut, test_params.nn_target_namespace)
logging.info("Reloading config and restarting swss...")
config_reload(dut)
config_reload(dut, safe_reload=True)

def _setup_multi_asic_proxy(dut, creds, test_params, tbinfo):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/ecmp/test_fgnhg.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def fg_ecmp_to_regular_ecmp_transitions(ptfhost, duthost, router_mac, net_ports,
def cleanup(duthost, ptfhost):
logger.info("Start cleanup")
ptfhost.command('rm -f /tmp/fg_ecmp_persist_map.json')
config_reload(duthost)
config_reload(duthost, safe_reload=True)


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/mvrf/test_mgmtvrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def restore_config_db(duthost):
duthost.shell("mv /etc/sonic/config_db.json.bak /etc/sonic/config_db.json")

# Reload to restore configuration
config_reload(duthost)
config_reload(duthost, safe_reload=True)

@pytest.fixture(scope="module")
def check_ntp_sync(duthosts, rand_one_dut_hostname):
Expand Down
4 changes: 2 additions & 2 deletions tests/nat/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def apply_global_nat_config(duthost, config_nat_feature_enabled):
nat_global_config(duthost)
yield
# reload config on teardown
config_reload(duthost, config_source='minigraph')
config_reload(duthost, config_source='minigraph', safe_reload=True)


@pytest.fixture()
Expand All @@ -204,7 +204,7 @@ def reload_dut_config(request, duthost, setup_test_env):
dut_iface = setup_data[interface_type]["vrf_conf"]["red"]["dut_iface"]
gw_ip = setup_data[interface_type]["vrf_conf"]["red"]["gw"]
mask = setup_data[interface_type]["vrf_conf"]["red"]["mask"]
config_reload(duthost, config_source='minigraph')
config_reload(duthost, config_source='minigraph', safe_reload=True)
pch_ip = setup_info["pch_ips"][dut_iface]
duthost.shell("sudo config interface ip remove {} {}/31".format(dut_iface, pch_ip))
duthost.shell("sudo config interface ip add {} {}/{}".format(dut_iface, gw_ip, mask))
Expand Down