From a456b39a24b143e9ab9a50be424461b871d76cc6 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Thu, 20 Feb 2025 04:23:57 +0000 Subject: [PATCH 1/2] Restore configuration after test_vxlan_bfd_tsa.py Signed-off-by: Zhaohui Sun --- tests/vxlan/test_vxlan_bfd_tsa.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/vxlan/test_vxlan_bfd_tsa.py b/tests/vxlan/test_vxlan_bfd_tsa.py index b2a4ac12909..e1142d65b50 100644 --- a/tests/vxlan/test_vxlan_bfd_tsa.py +++ b/tests/vxlan/test_vxlan_bfd_tsa.py @@ -17,6 +17,7 @@ from tests.ptf_runner import ptf_runner from tests.common.vxlan_ecmp_utils import Ecmp_Utils from tests.common.config_reload import config_system_checks_passed +from tests.common.fixtures.duthost_utils import backup_and_restore_config_db_on_duts # noqa F401 Logger = logging.getLogger(__name__) ecmp_utils = Ecmp_Utils() @@ -69,7 +70,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: From 2a201305c7cdf4b425cffa6698bb3495439ba3eb Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Thu, 20 Feb 2025 06:19:51 +0000 Subject: [PATCH 2/2] Add config reload Signed-off-by: Zhaohui Sun --- tests/vxlan/test_vxlan_bfd_tsa.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/vxlan/test_vxlan_bfd_tsa.py b/tests/vxlan/test_vxlan_bfd_tsa.py index e1142d65b50..48302b1d608 100644 --- a/tests/vxlan/test_vxlan_bfd_tsa.py +++ b/tests/vxlan/test_vxlan_bfd_tsa.py @@ -18,6 +18,7 @@ from tests.common.vxlan_ecmp_utils import Ecmp_Utils from tests.common.config_reload import config_system_checks_passed from tests.common.fixtures.duthost_utils import backup_and_restore_config_db_on_duts # noqa F401 +from tests.common.config_reload import config_reload Logger = logging.getLogger(__name__) ecmp_utils = Ecmp_Utils() @@ -225,6 +226,14 @@ def fixture_setUp(duthosts, time.sleep(1) +@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) + + class Test_VxLAN_BFD_TSA(): ''' Class for all the Vxlan tunnel cases where primary and secondary next hops are configured.