Update TF and functional tests API

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Slawomir Jankowski
2020-12-07 16:52:36 +01:00
committed by Robert Baldyga
parent ecbd4fbe30
commit 17f440de10
56 changed files with 209 additions and 210 deletions

View File

@@ -81,7 +81,7 @@ def test_ioclass_core_id(filesystem):
if filesystem:
dd_dst_paths = [cached_mountpoint + "/test_file", not_cached_mountpoint + "/test_file"]
else:
dd_dst_paths = [core_1.system_path, core_2.system_path]
dd_dst_paths = [core_1.path, core_2.path]
for path in dd_dst_paths:
dd = (

View File

@@ -39,7 +39,7 @@ def test_ioclass_directory_depth(filesystem):
cache, core = prepare()
Udev.disable()
with TestRun.step(f"Prepare {filesystem.name} filesystem and mount {core.system_path} "
with TestRun.step(f"Prepare {filesystem.name} filesystem and mount {core.path} "
f"at {mountpoint}."):
core.create_filesystem(filesystem)
core.mount(mountpoint)
@@ -156,7 +156,7 @@ def test_ioclass_directory_file_operations(filesystem):
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare {filesystem.name} filesystem "
f"and mounting {core.system_path} at {mountpoint}."):
f"and mounting {core.path} at {mountpoint}."):
core.create_filesystem(fs_type=filesystem)
core.mount(mount_point=mountpoint)
sync()
@@ -289,7 +289,7 @@ def test_ioclass_directory_dir_operations(filesystem):
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare {filesystem.name} filesystem "
f"and mount {core.system_path} at {mountpoint}."):
f"and mount {core.path} at {mountpoint}."):
core.create_filesystem(fs_type=filesystem)
core.mount(mount_point=mountpoint)
sync()

View File

@@ -53,7 +53,7 @@ def test_ioclass_file_extension():
)
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare filesystem and mount {core.system_path} at {mountpoint}."):
with TestRun.step(f"Prepare filesystem and mount {core.path} at {mountpoint}."):
core.create_filesystem(Filesystem.ext3)
core.mount(mountpoint)
@@ -128,7 +128,7 @@ def test_ioclass_file_name_prefix():
)
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare filesystem and mount {core.system_path} at {mountpoint}"):
with TestRun.step(f"Prepare filesystem and mount {core.path} at {mountpoint}"):
previous_occupancy = cache.get_occupancy()
core.create_filesystem(Filesystem.ext3)
@@ -285,7 +285,7 @@ def test_ioclass_file_offset():
)
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare filesystem and mount {core.system_path} at {mountpoint}."):
with TestRun.step(f"Prepare filesystem and mount {core.path} at {mountpoint}."):
core.create_filesystem(Filesystem.ext3)
core.mount(mountpoint)
@@ -374,7 +374,7 @@ def test_ioclass_file_size(filesystem):
with TestRun.step("Prepare and load IO class config."):
load_file_size_io_classes(cache, base_size)
with TestRun.step(f"Prepare {filesystem.name} filesystem and mount {core.system_path} "
with TestRun.step(f"Prepare {filesystem.name} filesystem and mount {core.path} "
f"at {mountpoint}."):
core.create_filesystem(filesystem)
core.mount(mountpoint)

View File

@@ -53,7 +53,7 @@ def test_ioclass_process_name():
dd = (
Dd()
.input("/dev/zero")
.output(core.system_path)
.output(core.path)
.count(dd_count)
.block_size(dd_size)
.seek(i)
@@ -91,7 +91,7 @@ def test_ioclass_pid():
dd_command = str(
Dd()
.input("/dev/zero")
.output(core.system_path)
.output(core.path)
.count(dd_count)
.block_size(dd_size)
)

View File

@@ -39,7 +39,7 @@ def test_ioclass_usage_sum():
Udev.disable()
with TestRun.step(
f"Prepare filesystem and mount {core.system_path} at {mountpoint}"
f"Prepare filesystem and mount {core.path} at {mountpoint}"
):
filesystem = Filesystem.xfs
core.create_filesystem(filesystem)

View File

@@ -66,7 +66,7 @@ def test_ioclass_lba():
for lba in range(min_cached_lba, max_cached_lba, 8):
dd = (
Dd().input("/dev/zero")
.output(f"{core.system_path}")
.output(f"{core.path}")
.count(dd_count)
.block_size(dd_size)
.seek(lba)
@@ -90,7 +90,7 @@ def test_ioclass_lba():
continue
dd = (
Dd().input("/dev/zero")
.output(f"{core.system_path}")
.output(f"{core.path}")
.count(dd_count)
.block_size(dd_size)
.seek(rand_lba)
@@ -140,7 +140,7 @@ def test_ioclass_request_size():
req_size = random.choice(cached_req_sizes)
dd = (
Dd().input("/dev/zero")
.output(core.system_path)
.output(core.path)
.count(1)
.block_size(req_size)
.oflag("direct")
@@ -163,7 +163,7 @@ def test_ioclass_request_size():
req_size = random.choice(not_cached_req_sizes)
dd = (
Dd().input("/dev/zero")
.output(core.system_path)
.output(core.path)
.count(1)
.block_size(req_size)
.oflag("direct")
@@ -212,12 +212,12 @@ def test_ioclass_direct(filesystem):
.io_engine(IoEngine.libaio) \
.size(io_size).offset(io_size) \
.read_write(ReadWrite.write) \
.target(f"{mountpoint}/tmp_file" if filesystem else core.system_path)
.target(f"{mountpoint}/tmp_file" if filesystem else core.path)
with TestRun.step("Prepare filesystem."):
if filesystem:
TestRun.LOGGER.info(
f"Preparing {filesystem.name} filesystem and mounting {core.system_path} at"
f"Preparing {filesystem.name} filesystem and mounting {core.path} at"
f" {mountpoint}"
)
core.create_filesystem(filesystem)
@@ -305,7 +305,7 @@ def test_ioclass_metadata(filesystem):
)
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare {filesystem.name} filesystem and mount {core.system_path} "
with TestRun.step(f"Prepare {filesystem.name} filesystem and mount {core.path} "
f"at {mountpoint}."):
core.create_filesystem(filesystem)
core.mount(mountpoint)
@@ -444,7 +444,7 @@ def test_ioclass_id_as_condition(filesystem):
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare {filesystem.name} filesystem "
f"and mount {core.system_path} at {mountpoint}."):
f"and mount {core.path} at {mountpoint}."):
core.create_filesystem(filesystem)
core.mount(mountpoint)
fs_utils.create_directory(base_dir_path)
@@ -553,7 +553,7 @@ def test_ioclass_conditions_or(filesystem):
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
with TestRun.step(f"Prepare {filesystem.name} filesystem "
f"and mount {core.system_path} at {mountpoint}."):
f"and mount {core.path} at {mountpoint}."):
core.create_filesystem(filesystem)
core.mount(mountpoint)
for i in range(1, 6):
@@ -614,7 +614,7 @@ def test_ioclass_conditions_and(filesystem):
casadm.load_io_classes(cache_id=cache.cache_id, file=ioclass_config_path)
TestRun.LOGGER.info(f"Preparing {filesystem.name} filesystem "
f"and mounting {core.system_path} at {mountpoint}")
f"and mounting {core.path} at {mountpoint}")
core.create_filesystem(filesystem)
core.mount(mountpoint)
sync()
@@ -662,7 +662,7 @@ def test_ioclass_effective_ioclass(filesystem):
f"file_size:ge:{file_size_bytes // 2}"]
with TestRun.LOGGER.step(f"Preparing {filesystem.name} filesystem "
f"and mounting {core.system_path} at {mountpoint}"):
f"and mounting {core.path} at {mountpoint}"):
core.create_filesystem(filesystem)
core.mount(mountpoint)
fs_utils.create_directory(test_dir)