Move tests data path to TF
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
parent
ede64a64f5
commit
b290fddceb
@ -37,9 +37,6 @@ from storage_devices.disk import Disk
|
|||||||
from storage_devices.drbd import Drbd
|
from storage_devices.drbd import Drbd
|
||||||
|
|
||||||
|
|
||||||
TEST_RUN_DATA_PATH = "/tmp/open_cas_test_data"
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
TestRun.addoption(parser)
|
TestRun.addoption(parser)
|
||||||
parser.addoption("--dut-config", action="append", type=str)
|
parser.addoption("--dut-config", action="append", type=str)
|
||||||
@ -139,7 +136,6 @@ def pytest_runtest_setup(item):
|
|||||||
TestRun.LOGGER.info(f"DUT info: {TestRun.dut}")
|
TestRun.LOGGER.info(f"DUT info: {TestRun.dut}")
|
||||||
TestRun.dut.plugin_manager = TestRun.plugin_manager
|
TestRun.dut.plugin_manager = TestRun.plugin_manager
|
||||||
TestRun.dut.executor = TestRun.executor
|
TestRun.dut.executor = TestRun.executor
|
||||||
TestRun.TEST_RUN_DATA_PATH = TEST_RUN_DATA_PATH
|
|
||||||
TestRun.dut.cache_list = []
|
TestRun.dut.cache_list = []
|
||||||
TestRun.dut.core_list = []
|
TestRun.dut.core_list = []
|
||||||
TestRun.duts.append(TestRun.dut)
|
TestRun.duts.append(TestRun.dut)
|
||||||
@ -195,14 +191,14 @@ def base_prepare(item):
|
|||||||
|
|
||||||
RamDisk.remove_all()
|
RamDisk.remove_all()
|
||||||
|
|
||||||
if check_if_directory_exists(path=TEST_RUN_DATA_PATH):
|
if check_if_directory_exists(path=TestRun.TEST_RUN_DATA_PATH):
|
||||||
remove(
|
remove(
|
||||||
path=posixpath.join(TEST_RUN_DATA_PATH, "*"),
|
path=posixpath.join(TestRun.TEST_RUN_DATA_PATH, "*"),
|
||||||
force=True,
|
force=True,
|
||||||
recursive=True,
|
recursive=True,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
create_directory(path=TEST_RUN_DATA_PATH)
|
create_directory(path=TestRun.TEST_RUN_DATA_PATH)
|
||||||
|
|
||||||
for disk in TestRun.disks.values():
|
for disk in TestRun.disks.values():
|
||||||
disk_serial = Disk.get_disk_serial_number(disk.path)
|
disk_serial = Disk.get_disk_serial_number(disk.path)
|
||||||
@ -271,9 +267,9 @@ def pytest_runtest_teardown():
|
|||||||
DeviceMapper.remove_all()
|
DeviceMapper.remove_all()
|
||||||
RamDisk.remove_all()
|
RamDisk.remove_all()
|
||||||
|
|
||||||
if check_if_directory_exists(path=TEST_RUN_DATA_PATH):
|
if check_if_directory_exists(path=TestRun.TEST_RUN_DATA_PATH):
|
||||||
remove(
|
remove(
|
||||||
path=posixpath.join(TEST_RUN_DATA_PATH, "*"),
|
path=posixpath.join(TestRun.TEST_RUN_DATA_PATH, "*"),
|
||||||
force=True,
|
force=True,
|
||||||
recursive=True,
|
recursive=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user