test-api: reformat api files
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
@@ -22,27 +22,23 @@ def rsync_opencas_sources():
|
||||
# to make sure path ends with directory separator.
|
||||
# Needed for rsync to copy only contents of a directory
|
||||
# and not the directory itself.
|
||||
os.path.join(TestRun.usr.repo_dir, ''),
|
||||
os.path.join(TestRun.usr.working_dir, ''),
|
||||
os.path.join(TestRun.usr.repo_dir, ""),
|
||||
os.path.join(TestRun.usr.working_dir, ""),
|
||||
exclude_list=["test/functional/results/"],
|
||||
delete=True)
|
||||
delete=True,
|
||||
)
|
||||
|
||||
|
||||
def clean_opencas_repo():
|
||||
TestRun.LOGGER.info("Cleaning Open CAS repo")
|
||||
output = TestRun.executor.run(
|
||||
f"cd {TestRun.usr.working_dir} && "
|
||||
"make distclean")
|
||||
output = TestRun.executor.run(f"cd {TestRun.usr.working_dir} && " "make distclean")
|
||||
if output.exit_code != 0:
|
||||
raise CmdException("make distclean command executed with nonzero status", output)
|
||||
|
||||
|
||||
def build_opencas():
|
||||
TestRun.LOGGER.info("Building Open CAS")
|
||||
output = TestRun.executor.run(
|
||||
f"cd {TestRun.usr.working_dir} && "
|
||||
"./configure && "
|
||||
"make -j")
|
||||
output = TestRun.executor.run(f"cd {TestRun.usr.working_dir} && " "./configure && " "make -j")
|
||||
if output.exit_code != 0:
|
||||
raise CmdException("Make command executed with nonzero status", output)
|
||||
|
||||
@@ -54,8 +50,8 @@ def install_opencas(destdir: str = ""):
|
||||
destdir = os.path.join(TestRun.usr.working_dir, destdir)
|
||||
|
||||
output = TestRun.executor.run(
|
||||
f"cd {TestRun.usr.working_dir} && "
|
||||
f"make {'DESTDIR='+destdir if destdir else ''} install")
|
||||
f"cd {TestRun.usr.working_dir} && " f"make {'DESTDIR='+destdir if destdir else ''} install"
|
||||
)
|
||||
if output.exit_code != 0:
|
||||
raise CmdException("Failed to install Open CAS", output)
|
||||
|
||||
@@ -90,9 +86,7 @@ def uninstall_opencas():
|
||||
if output.exit_code != 0:
|
||||
raise CmdException("Open CAS is not properly installed", output)
|
||||
else:
|
||||
TestRun.executor.run(
|
||||
f"cd {TestRun.usr.working_dir} && "
|
||||
f"make uninstall")
|
||||
TestRun.executor.run(f"cd {TestRun.usr.working_dir} && " f"make uninstall")
|
||||
if output.exit_code != 0:
|
||||
raise CmdException("There was an error during uninstall process", output)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user