diff --git a/tests/pc/test_lag_member.py b/tests/pc/test_lag_member.py index 1dd5def4452..7f53c358d9f 100644 --- a/tests/pc/test_lag_member.py +++ b/tests/pc/test_lag_member.py @@ -10,7 +10,7 @@ from tests.common.helpers.assertions import pytest_assert, pytest_require from tests.ptf_runner import ptf_runner from tests.common.utilities import wait_until -from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory, copy_arp_responder_py # noqa F401 +from tests.common.fixtures.ptfhost_utils import copy_acstests_directory # noqa F401 from tests.common.config_reload import config_reload logger = logging.getLogger(__name__) @@ -346,21 +346,11 @@ def get_vlan_id(cfg_facts, number_of_lag_member): @pytest.fixture(scope="module") -def common_setup_teardown(ptfhost): +def common_setup_teardown(copy_acstests_directory, ptfhost): # noqa: F811 logger.info("########### Setup for lag testing ###########") - ptfhost.shell("mkdir -p {}".format(TEST_DIR)) - # Copy PTF test into PTF-docker for test LACP DU - test_files = ["lag_test.py", "acs_base_test.py", "router_utils.py"] - for test_file in test_files: - src = "../ansible/roles/test/files/acstests/%s" % test_file - dst = TEST_DIR + test_file - ptfhost.copy(src=src, dest=dst) - yield ptfhost - ptfhost.file(path=TEST_DIR, state="absent") - @pytest.fixture(scope="module") def ptf_dut_setup_and_teardown(duthost, ptfhost, tbinfo, most_common_port_speed): @@ -464,7 +454,7 @@ def run_lag_member_traffic_test(duthost, dut_vlan, ptf_ports, ptfhost): "ptf_lag": ptf_lag, ATTR_PORT_NOT_BEHIND_LAG: ptf_not_lag } - ptf_runner(ptfhost, TEST_DIR, "lag_test.LagMemberTrafficTest", "/root/ptftests", params=params) + ptf_runner(ptfhost, 'acstests', "lag_test.LagMemberTrafficTest", "/root/ptftests", params=params, is_python3=True) def test_lag_member_traffic(common_setup_teardown, duthost, ptf_dut_setup_and_teardown):