Skip to content

Commit

Permalink
Add removal of old source package in installation test (#229)
Browse files Browse the repository at this point in the history
* Add removal of old source package in installation test
  • Loading branch information
mmkayPL authored Apr 30, 2020
1 parent b08c60b commit 87745b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions tests/functional/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def test_source_package_installation():
with TestRun.step("Uninstall existing iotrace if needed"):
uninstall_iotrace()

with TestRun.step("Remove old source package"):
TestRun.executor.run_expect_success(f"cd {work_path} && "
f"rm -rf iotrace-*-Source")

with TestRun.step("Unpack and install source package"):
TestRun.executor.run_expect_success(
f"tar -xvf {work_path}/build/release/iotrace-*.tar.gz -C {work_path} &&"
Expand Down
4 changes: 3 additions & 1 deletion tests/utils/dut.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def dut_cleanup():
TestRun.LOGGER.info("Stopping fuzzing")
TestRun.executor.run(f'{iotrace.working_dir}/standalone-linux-io-tracer/tests/security/fuzzy/fuzz.sh clean')

iotrace.stop_tracing()
output = TestRun.executor.run('pgrep iotrace')
if output.stdout != "":
TestRun.executor.run(f'kill -2 {output.stdout}')

TestRun.LOGGER.info("Removing existing traces")
trace_repository_path: str = iotrace.get_trace_repository_path()
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/iotrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def check_if_tracing_active(self) -> bool:
TestRun.LOGGER.info("Iotrace processes not found.")
return False

elif self.pid not in output.stdout:
elif self.pid is not None and self.pid not in output.stdout:
TestRun.LOGGER.info(f"Found other iotrace process with PID {output.stdout}")
return False

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def kill_all_io():
TestRun.executor.run("pkill --signal SIGKILL dd")
TestRun.executor.run(
"kill -9 `ps aux | grep -i vdbench.* | awk '{ print $1 }'`")
TestRun.executor.run("pkill --signal SIGKILL fio*")
TestRun.executor.run("pkill --signal SIGKILL 'fio*'")

0 comments on commit 87745b2

Please sign in to comment.