diff --git a/tests/vxlan/test_vxlan_ecmp.py b/tests/vxlan/test_vxlan_ecmp.py index a9a419065ac..0c1acca8045 100644 --- a/tests/vxlan/test_vxlan_ecmp.py +++ b/tests/vxlan/test_vxlan_ecmp.py @@ -60,6 +60,8 @@ from tests.common.helpers.assertions import pytest_assert from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401 +from tests.common.fixtures.duthost_utils import backup_and_restore_config_db_on_duts # noqa F401 +from tests.common.config_reload import config_reload from tests.common.utilities import wait_until from tests.ptf_runner import ptf_runner from tests.common.vxlan_ecmp_utils import Ecmp_Utils @@ -140,7 +142,8 @@ def fixture_setUp(duthosts, rand_one_dut_hostname, minigraph_facts, tbinfo, - encap_type): + encap_type, + backup_and_restore_config_db_on_duts): # noqa F811 ''' Setup for the entire script. The basic steps in VxLAN configs are: @@ -339,6 +342,14 @@ def fixture_setUp(duthosts, setup_crm_interval(data['duthost'], int(data['original_crm_interval'])) +@pytest.fixture(scope="module", autouse=True) +def restore_config_by_config_reload(duthosts, rand_one_dut_hostname, localhost): + yield + duthost = duthosts[rand_one_dut_hostname] + + config_reload(duthost, safe_reload=True) + + @pytest.fixture(scope="module") def default_routes(setUp, encap_type): vnet = list(setUp[encap_type]['vnet_vni_map'].keys())[0]