From c6c0137fad6ccc34374dc48a18c7d78227fccdde Mon Sep 17 00:00:00 2001 From: Jingwen Xie Date: Wed, 15 Jun 2022 08:39:44 +0000 Subject: [PATCH 1/2] avoid long run test. Fix later --- tests/generic_config_updater/test_aaa.py | 5 +++++ tests/generic_config_updater/test_cacl.py | 6 ++++++ tests/generic_config_updater/test_dhcp_relay.py | 5 +++++ tests/generic_config_updater/test_ipv6.py | 6 ++++++ tests/generic_config_updater/test_lo_interface.py | 6 ++++++ tests/generic_config_updater/test_portchannel_interface.py | 5 +++++ tests/generic_config_updater/test_syslog.py | 6 ++++++ tests/generic_config_updater/test_vlan_interface.py | 6 ++++++ 8 files changed, 45 insertions(+) diff --git a/tests/generic_config_updater/test_aaa.py b/tests/generic_config_updater/test_aaa.py index 904ddd88759..cbec27e09ec 100644 --- a/tests/generic_config_updater/test_aaa.py +++ b/tests/generic_config_updater/test_aaa.py @@ -15,6 +15,11 @@ AAA_CATEGORY = ["authentication", "authorization", "accounting"] DEFAULT_TACACS_SERVER = "100.127.20.21" + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + @pytest.fixture(autouse=True) def setup_env(duthosts, rand_one_dut_hostname): """ diff --git a/tests/generic_config_updater/test_cacl.py b/tests/generic_config_updater/test_cacl.py index 70232b09a46..444efc7c8b4 100644 --- a/tests/generic_config_updater/test_cacl.py +++ b/tests/generic_config_updater/test_cacl.py @@ -24,6 +24,12 @@ T0_CACL_TABLE = ["NTP_ACL", "SNMP_ACL", "SSH_ONLY"] + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + + def get_cacl_tables(duthost): """Get acl control palne tables """ diff --git a/tests/generic_config_updater/test_dhcp_relay.py b/tests/generic_config_updater/test_dhcp_relay.py index 1bf5689ab16..554103e76f7 100644 --- a/tests/generic_config_updater/test_dhcp_relay.py +++ b/tests/generic_config_updater/test_dhcp_relay.py @@ -20,6 +20,11 @@ CONFIG_CLEANUP = "config_cleanup" CONFIG_ADD_DEFAULT = "config_add_default" + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + @pytest.fixture(scope="module") def vlan_intfs_dict(utils_vlan_intfs_dict_orig): """ Add two new vlan for test diff --git a/tests/generic_config_updater/test_ipv6.py b/tests/generic_config_updater/test_ipv6.py index 4ae4795956a..b18246720fc 100644 --- a/tests/generic_config_updater/test_ipv6.py +++ b/tests/generic_config_updater/test_ipv6.py @@ -14,6 +14,12 @@ pytest.mark.topology('t0', 't1'), ] + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + + @pytest.fixture(autouse=True) def ensure_dut_readiness(duthost): """ diff --git a/tests/generic_config_updater/test_lo_interface.py b/tests/generic_config_updater/test_lo_interface.py index cbb6c499677..858ac6a7a5b 100644 --- a/tests/generic_config_updater/test_lo_interface.py +++ b/tests/generic_config_updater/test_lo_interface.py @@ -25,6 +25,12 @@ logger = logging.getLogger(__name__) + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + + @pytest.fixture(autouse=True) def setup_env(duthosts, rand_one_dut_hostname): """ diff --git a/tests/generic_config_updater/test_portchannel_interface.py b/tests/generic_config_updater/test_portchannel_interface.py index c026013ad8f..cae524f9c03 100644 --- a/tests/generic_config_updater/test_portchannel_interface.py +++ b/tests/generic_config_updater/test_portchannel_interface.py @@ -31,6 +31,11 @@ logger = logging.getLogger(__name__) +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + + @pytest.fixture(scope="module") def portchannel_table(cfg_facts): def _is_ipv4_address(ip_addr): diff --git a/tests/generic_config_updater/test_syslog.py b/tests/generic_config_updater/test_syslog.py index f0294251502..9c9fe568b1d 100644 --- a/tests/generic_config_updater/test_syslog.py +++ b/tests/generic_config_updater/test_syslog.py @@ -18,6 +18,12 @@ CONFIG_CLEANUP = "config_cleanup" CONFIG_ADD_DEFAULT = "config_add_default" + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + + @pytest.fixture(scope="module", params=[CONFIG_CLEANUP, CONFIG_ADD_DEFAULT]) def init_syslog_config(request): return request.param diff --git a/tests/generic_config_updater/test_vlan_interface.py b/tests/generic_config_updater/test_vlan_interface.py index 2a172bfbc92..07c48119134 100644 --- a/tests/generic_config_updater/test_vlan_interface.py +++ b/tests/generic_config_updater/test_vlan_interface.py @@ -19,6 +19,12 @@ logger = logging.getLogger(__name__) + +@pytest.fixture(autouse=True, scope="module") +def avoid_long_running_test(): + pytest.skip("Test costs too much time. Temp skip for now.") + + @pytest.fixture(autouse=True) def cleanup_test_env(duthosts, rand_one_dut_hostname): """ From db0340b2f631e2d3c3501aeda0df9a77121ff9bf Mon Sep 17 00:00:00 2001 From: Jingwen Xie Date: Thu, 16 Jun 2022 05:27:18 +0000 Subject: [PATCH 2/2] replace with skip marker --- tests/generic_config_updater/test_aaa.py | 5 +---- tests/generic_config_updater/test_cacl.py | 6 +----- tests/generic_config_updater/test_dhcp_relay.py | 5 +---- tests/generic_config_updater/test_ipv6.py | 6 +----- tests/generic_config_updater/test_lo_interface.py | 6 +----- tests/generic_config_updater/test_portchannel_interface.py | 6 +----- tests/generic_config_updater/test_syslog.py | 6 +----- tests/generic_config_updater/test_vlan_interface.py | 6 +----- 8 files changed, 8 insertions(+), 38 deletions(-) diff --git a/tests/generic_config_updater/test_aaa.py b/tests/generic_config_updater/test_aaa.py index cbec27e09ec..c80c2ddebfc 100644 --- a/tests/generic_config_updater/test_aaa.py +++ b/tests/generic_config_updater/test_aaa.py @@ -8,6 +8,7 @@ pytestmark = [ pytest.mark.topology('any'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) @@ -16,10 +17,6 @@ DEFAULT_TACACS_SERVER = "100.127.20.21" -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - @pytest.fixture(autouse=True) def setup_env(duthosts, rand_one_dut_hostname): """ diff --git a/tests/generic_config_updater/test_cacl.py b/tests/generic_config_updater/test_cacl.py index 444efc7c8b4..9ef750e0f67 100644 --- a/tests/generic_config_updater/test_cacl.py +++ b/tests/generic_config_updater/test_cacl.py @@ -18,6 +18,7 @@ pytestmark = [ pytest.mark.topology('t0'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) @@ -25,11 +26,6 @@ T0_CACL_TABLE = ["NTP_ACL", "SNMP_ACL", "SSH_ONLY"] -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - - def get_cacl_tables(duthost): """Get acl control palne tables """ diff --git a/tests/generic_config_updater/test_dhcp_relay.py b/tests/generic_config_updater/test_dhcp_relay.py index 554103e76f7..b876be98f85 100644 --- a/tests/generic_config_updater/test_dhcp_relay.py +++ b/tests/generic_config_updater/test_dhcp_relay.py @@ -10,6 +10,7 @@ pytestmark = [ pytest.mark.topology('t0'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) @@ -21,10 +22,6 @@ CONFIG_ADD_DEFAULT = "config_add_default" -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - @pytest.fixture(scope="module") def vlan_intfs_dict(utils_vlan_intfs_dict_orig): """ Add two new vlan for test diff --git a/tests/generic_config_updater/test_ipv6.py b/tests/generic_config_updater/test_ipv6.py index b18246720fc..cfd8f4036d4 100644 --- a/tests/generic_config_updater/test_ipv6.py +++ b/tests/generic_config_updater/test_ipv6.py @@ -12,14 +12,10 @@ pytestmark = [ pytest.mark.topology('t0', 't1'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - - @pytest.fixture(autouse=True) def ensure_dut_readiness(duthost): """ diff --git a/tests/generic_config_updater/test_lo_interface.py b/tests/generic_config_updater/test_lo_interface.py index 858ac6a7a5b..8bf387454f2 100644 --- a/tests/generic_config_updater/test_lo_interface.py +++ b/tests/generic_config_updater/test_lo_interface.py @@ -21,16 +21,12 @@ pytestmark = [ pytest.mark.topology('t0'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - - @pytest.fixture(autouse=True) def setup_env(duthosts, rand_one_dut_hostname): """ diff --git a/tests/generic_config_updater/test_portchannel_interface.py b/tests/generic_config_updater/test_portchannel_interface.py index cae524f9c03..525a007aa87 100644 --- a/tests/generic_config_updater/test_portchannel_interface.py +++ b/tests/generic_config_updater/test_portchannel_interface.py @@ -26,16 +26,12 @@ pytestmark = [ pytest.mark.topology('t0'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - - @pytest.fixture(scope="module") def portchannel_table(cfg_facts): def _is_ipv4_address(ip_addr): diff --git a/tests/generic_config_updater/test_syslog.py b/tests/generic_config_updater/test_syslog.py index 9c9fe568b1d..6c8148fad68 100644 --- a/tests/generic_config_updater/test_syslog.py +++ b/tests/generic_config_updater/test_syslog.py @@ -8,6 +8,7 @@ pytestmark = [ pytest.mark.topology('any'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) @@ -19,11 +20,6 @@ CONFIG_ADD_DEFAULT = "config_add_default" -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - - @pytest.fixture(scope="module", params=[CONFIG_CLEANUP, CONFIG_ADD_DEFAULT]) def init_syslog_config(request): return request.param diff --git a/tests/generic_config_updater/test_vlan_interface.py b/tests/generic_config_updater/test_vlan_interface.py index 07c48119134..085d8400ab5 100644 --- a/tests/generic_config_updater/test_vlan_interface.py +++ b/tests/generic_config_updater/test_vlan_interface.py @@ -15,16 +15,12 @@ pytestmark = [ pytest.mark.topology('t0'), + pytest.mark.skip(reason="Test costs too much time. Temp skip for now."), ] logger = logging.getLogger(__name__) -@pytest.fixture(autouse=True, scope="module") -def avoid_long_running_test(): - pytest.skip("Test costs too much time. Temp skip for now.") - - @pytest.fixture(autouse=True) def cleanup_test_env(duthosts, rand_one_dut_hostname): """