diff --git a/tests/pfcwd/files/pfcwd_helper.py b/tests/common/helpers/pfcwd_helper.py similarity index 100% rename from tests/pfcwd/files/pfcwd_helper.py rename to tests/common/helpers/pfcwd_helper.py diff --git a/tests/pfcwd/conftest.py b/tests/pfcwd/conftest.py index 532bc3c13c1..738c6fa7d0a 100644 --- a/tests/pfcwd/conftest.py +++ b/tests/pfcwd/conftest.py @@ -7,7 +7,7 @@ from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 from tests.common.fixtures.ptfhost_utils import pause_garp_service # noqa F401 from tests.common.mellanox_data import is_mellanox_device as isMellanoxDevice -from .files.pfcwd_helper import TrafficPorts, set_pfc_timers, select_test_ports +from tests.common.helpers.pfcwd_helper import TrafficPorts, set_pfc_timers, select_test_ports from tests.common.utilities import str2bool logger = logging.getLogger(__name__) diff --git a/tests/pfcwd/test_pfcwd_all_port_storm.py b/tests/pfcwd/test_pfcwd_all_port_storm.py index 241364e0bdf..8cffd960b6f 100644 --- a/tests/pfcwd/test_pfcwd_all_port_storm.py +++ b/tests/pfcwd/test_pfcwd_all_port_storm.py @@ -6,9 +6,10 @@ from tests.common.fixtures.conn_graph_facts import enum_fanout_graph_facts # noqa F401 from tests.common.helpers.pfc_storm import PFCMultiStorm from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer -from .files.pfcwd_helper import start_wd_on_ports, start_background_traffic # noqa F401 -from .files.pfcwd_helper import EXPECT_PFC_WD_DETECT_RE, EXPECT_PFC_WD_RESTORE_RE, fetch_vendor_specific_diagnosis_re -from .files.pfcwd_helper import send_background_traffic +from tests.common.helpers.pfcwd_helper import start_wd_on_ports, start_background_traffic # noqa F401 +from tests.common.helpers.pfcwd_helper import EXPECT_PFC_WD_DETECT_RE, EXPECT_PFC_WD_RESTORE_RE, \ + fetch_vendor_specific_diagnosis_re +from tests.common.helpers.pfcwd_helper import send_background_traffic from tests.common import config_reload TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "templates") diff --git a/tests/pfcwd/test_pfcwd_function.py b/tests/pfcwd/test_pfcwd_function.py index 4f77a8f4121..342b40ec66a 100644 --- a/tests/pfcwd/test_pfcwd_function.py +++ b/tests/pfcwd/test_pfcwd_function.py @@ -10,15 +10,16 @@ from tests.common.helpers.assertions import pytest_assert, pytest_require from tests.common.helpers.pfc_storm import PFCStorm from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer -from .files.pfcwd_helper import start_wd_on_ports -from .files.pfcwd_helper import EXPECT_PFC_WD_DETECT_RE, EXPECT_PFC_WD_RESTORE_RE, fetch_vendor_specific_diagnosis_re -from .files.pfcwd_helper import has_neighbor_device +from tests.common.helpers.pfcwd_helper import start_wd_on_ports +from tests.common.helpers.pfcwd_helper import EXPECT_PFC_WD_DETECT_RE, EXPECT_PFC_WD_RESTORE_RE, \ + fetch_vendor_specific_diagnosis_re +from tests.common.helpers.pfcwd_helper import has_neighbor_device from tests.ptf_runner import ptf_runner from tests.common import port_toggle from tests.common import constants from tests.common.dualtor.dual_tor_utils import is_tunnel_qos_remap_enabled, dualtor_ports # noqa F401 from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_enum_rand_one_per_hwsku_frontend_host_m # noqa F401, E501 -from .files.pfcwd_helper import send_background_traffic, check_pfc_storm_state +from tests.common.helpers.pfcwd_helper import send_background_traffic, check_pfc_storm_state from tests.common.utilities import wait_until diff --git a/tests/pfcwd/test_pfcwd_timer_accuracy.py b/tests/pfcwd/test_pfcwd_timer_accuracy.py index 359cc400a09..5f40056c6cc 100644 --- a/tests/pfcwd/test_pfcwd_timer_accuracy.py +++ b/tests/pfcwd/test_pfcwd_timer_accuracy.py @@ -6,10 +6,10 @@ from tests.common.fixtures.conn_graph_facts import enum_fanout_graph_facts # noqa F401 from tests.common.helpers.assertions import pytest_assert from tests.common.helpers.pfc_storm import PFCStorm -from .files.pfcwd_helper import start_wd_on_ports, start_background_traffic # noqa F401 +from tests.common.helpers.pfcwd_helper import start_wd_on_ports, start_background_traffic # noqa F401 from tests.common.plugins.loganalyzer import DisableLogrotateCronContext -from .files.pfcwd_helper import send_background_traffic +from tests.common.helpers.pfcwd_helper import send_background_traffic pytestmark = [ diff --git a/tests/pfcwd/test_pfcwd_warm_reboot.py b/tests/pfcwd/test_pfcwd_warm_reboot.py index f12a4eaa83b..67b67c264a0 100644 --- a/tests/pfcwd/test_pfcwd_warm_reboot.py +++ b/tests/pfcwd/test_pfcwd_warm_reboot.py @@ -16,9 +16,9 @@ from tests.common.utilities import InterruptableThread from tests.common.utilities import join_all from tests.ptf_runner import ptf_runner -from .files.pfcwd_helper import EXPECT_PFC_WD_DETECT_RE, EXPECT_PFC_WD_RESTORE_RE -from .files.pfcwd_helper import send_background_traffic -from .files.pfcwd_helper import has_neighbor_device +from tests.common.helpers.pfcwd_helper import EXPECT_PFC_WD_DETECT_RE, EXPECT_PFC_WD_RESTORE_RE +from tests.common.helpers.pfcwd_helper import send_background_traffic +from tests.common.helpers.pfcwd_helper import has_neighbor_device from tests.common.utilities import wait_until TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "templates") diff --git a/tests/qos/test_qos_sai.py b/tests/qos/test_qos_sai.py index d93bc360b26..1b6dfcb86c2 100644 --- a/tests/qos/test_qos_sai.py +++ b/tests/qos/test_qos_sai.py @@ -37,7 +37,7 @@ from tests.common.dualtor.dual_tor_utils import dualtor_ports, is_tunnel_qos_remap_enabled # noqa F401 from tests.common.helpers.assertions import pytest_assert from tests.common.helpers.pfc_storm import PFCStorm -from tests.pfcwd.files.pfcwd_helper import set_pfc_timers, start_wd_on_ports +from tests.common.helpers.pfcwd_helper import set_pfc_timers, start_wd_on_ports from tests.common.platform.device_utils import list_dut_fanout_connections from tests.common.utilities import wait_until from .qos_sai_base import QosSaiBase