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:
committed by
Robert Baldyga
parent
ecbd4fbe30
commit
17f440de10
@@ -29,7 +29,7 @@ def test_another_cache_with_same_id():
|
||||
cache_dev_1.create_partitions([Size(2, Unit.GibiByte)])
|
||||
TestRun.executor.run_expect_success(
|
||||
cli.start_cmd(
|
||||
cache_dev_1.partitions[0].system_path, cache_id="1", force=True
|
||||
cache_dev_1.partitions[0].path, cache_id="1", force=True
|
||||
)
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ def test_another_cache_with_same_id():
|
||||
cache_dev_2.create_partitions([Size(2, Unit.GibiByte)])
|
||||
TestRun.executor.run_expect_fail(
|
||||
cli.start_cmd(
|
||||
cache_dev_2.partitions[0].system_path, cache_id="1", force=True
|
||||
cache_dev_2.partitions[0].path, cache_id="1", force=True
|
||||
)
|
||||
)
|
||||
|
||||
@@ -69,7 +69,7 @@ def test_another_core_with_same_id():
|
||||
TestRun.executor.run_expect_success(
|
||||
cli.add_core_cmd(
|
||||
cache_id=f"{cache.cache_id}",
|
||||
core_dev=f"{core_dev_1.partitions[0].system_path}",
|
||||
core_dev=f"{core_dev_1.partitions[0].path}",
|
||||
core_id="1",
|
||||
)
|
||||
)
|
||||
@@ -80,7 +80,7 @@ def test_another_core_with_same_id():
|
||||
TestRun.executor.run_expect_fail(
|
||||
cli.add_core_cmd(
|
||||
cache_id=f"{cache.cache_id}",
|
||||
core_dev=f"{core_dev_2.partitions[0].system_path}",
|
||||
core_dev=f"{core_dev_2.partitions[0].path}",
|
||||
core_id="1",
|
||||
)
|
||||
)
|
||||
|
||||
@@ -202,7 +202,7 @@ def test_one_core_fail(cache_mode):
|
||||
|
||||
with TestRun.step("Check if core device is really out of cache."):
|
||||
output = str(casadm.list_caches().stdout.splitlines())
|
||||
if core_part1.system_path in output:
|
||||
if core_part1.path in output:
|
||||
TestRun.fail("The first core device should be unplugged!")
|
||||
|
||||
with TestRun.step("Check if the remaining core is able to use cache."):
|
||||
@@ -232,7 +232,7 @@ def dd_builder(cache_mode: CacheMode, dev: Core, size: Size):
|
||||
.block_size(block_size)
|
||||
.count(blocks))
|
||||
if CacheModeTrait.InsertRead in CacheMode.get_traits(cache_mode):
|
||||
dd.input(dev.system_path).output("/dev/null")
|
||||
dd.input(dev.path).output("/dev/null")
|
||||
else:
|
||||
dd.input("/dev/urandom").output(dev.system_path)
|
||||
dd.input("/dev/urandom").output(dev.path)
|
||||
return dd
|
||||
|
||||
@@ -66,7 +66,7 @@ def test_stop_no_flush_load_cache(cache_mode, filesystem):
|
||||
|
||||
with TestRun.step("Try to start cache without loading metadata."):
|
||||
output = TestRun.executor.run_expect_fail(cli.start_cmd(
|
||||
cache_dev=str(cache_part.system_path), cache_mode=str(cache_mode.name.lower()),
|
||||
cache_dev=str(cache_part.path), cache_mode=str(cache_mode.name.lower()),
|
||||
force=False, load=False))
|
||||
cli_messages.check_stderr_msg(output, cli_messages.start_cache_with_existing_metadata)
|
||||
|
||||
@@ -127,7 +127,7 @@ def test_stop_no_flush_load_cache_no_fs(cache_mode):
|
||||
with TestRun.step("Fill exported object with data."):
|
||||
dd = (Dd()
|
||||
.input("/dev/zero")
|
||||
.output(core.system_path)
|
||||
.output(core.path)
|
||||
.block_size(Size(1, Unit.Blocks4096))
|
||||
.oflag("direct"))
|
||||
dd.run()
|
||||
@@ -143,7 +143,7 @@ def test_stop_no_flush_load_cache_no_fs(cache_mode):
|
||||
|
||||
with TestRun.step("Try to start cache without loading metadata."):
|
||||
output = TestRun.executor.run_expect_fail(cli.start_cmd(
|
||||
cache_dev=str(cache_part.system_path), cache_mode=str(cache_mode.name.lower()),
|
||||
cache_dev=str(cache_part.path), cache_mode=str(cache_mode.name.lower()),
|
||||
force=False, load=False))
|
||||
cli_messages.check_stderr_msg(output, cli_messages.start_cache_with_existing_metadata)
|
||||
|
||||
|
||||
@@ -156,13 +156,13 @@ def test_add_cached_core(cache_mode):
|
||||
|
||||
with TestRun.step("Try adding the same core device to the second cache instance."):
|
||||
output = TestRun.executor.run_expect_fail(
|
||||
cli.add_core_cmd(cache_id=str(cache2.cache_id), core_dev=str(core_part.system_path),
|
||||
cli.add_core_cmd(cache_id=str(cache2.cache_id), core_dev=str(core_part.path),
|
||||
core_id=str(core.core_id)))
|
||||
cli_messages.check_stderr_msg(output, cli_messages.add_cached_core)
|
||||
|
||||
with TestRun.step("Try adding the same core device to the same cache for the second time."):
|
||||
output = TestRun.executor.run_expect_fail(
|
||||
cli.add_core_cmd(cache_id=str(cache1.cache_id), core_dev=str(core_part.system_path)))
|
||||
cli.add_core_cmd(cache_id=str(cache1.cache_id), core_dev=str(core_part.path)))
|
||||
cli_messages.check_stderr_msg(output, cli_messages.add_cached_core)
|
||||
|
||||
with TestRun.step("Stop caches."):
|
||||
|
||||
@@ -37,7 +37,7 @@ def test_remove_core_during_io():
|
||||
.io_engine(IoEngine.libaio)
|
||||
.block_size(Size(4, Unit.KibiByte))
|
||||
.read_write(ReadWrite.randrw)
|
||||
.target(f"{core.system_path}")
|
||||
.target(f"{core.path}")
|
||||
.direct(1)
|
||||
.run_time(timedelta(minutes=4))
|
||||
.time_based()
|
||||
@@ -78,7 +78,7 @@ def test_stop_cache_during_io():
|
||||
.io_engine(IoEngine.libaio)
|
||||
.block_size(Size(4, Unit.KibiByte))
|
||||
.read_write(ReadWrite.randrw)
|
||||
.target(f"{core.system_path}")
|
||||
.target(f"{core.path}")
|
||||
.direct(1)
|
||||
.run_time(timedelta(minutes=4))
|
||||
.time_based()
|
||||
|
||||
@@ -205,7 +205,7 @@ def fio_prepare(core):
|
||||
.create_command()
|
||||
.io_engine(IoEngine.libaio)
|
||||
.read_write(ReadWrite.randrw)
|
||||
.target(core.system_path)
|
||||
.target(core.path)
|
||||
.continue_on_error(ErrorFilter.io)
|
||||
.direct(1)
|
||||
.run_time(timedelta(seconds=30))
|
||||
|
||||
Reference in New Issue
Block a user