From 5edbf2a5a9a88562bce32a9fbec55bcba12f6237 Mon Sep 17 00:00:00 2001 From: Michal Rakowski Date: Thu, 2 Jan 2020 16:34:40 +0100 Subject: [PATCH] conftest: execute casadm-related cleanup only if CAS is installed during teardown Signed-off-by: Michal Rakowski --- test/functional/tests/conftest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/functional/tests/conftest.py b/test/functional/tests/conftest.py index 3390636..d3681b1 100644 --- a/test/functional/tests/conftest.py +++ b/test/functional/tests/conftest.py @@ -94,10 +94,11 @@ def pytest_runtest_teardown(): TestRun.executor.wait_for_connection() Udev.enable() unmount_cas_devices() - casadm.remove_all_detached_cores() - casadm.stop_all_caches() - from api.cas.init_config import InitConfig - InitConfig.create_default_init_config() + if installer.check_if_installed(): + casadm.remove_all_detached_cores() + casadm.stop_all_caches() + from api.cas.init_config import InitConfig + InitConfig.create_default_init_config() DeviceMapper.remove_all() except Exception as ex: TestRun.LOGGER.warning(f"Exception occured during platform cleanup.\n"