Override DUT's disks in conftest.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-11-20 18:51:28 -05:00
parent 1ffe1dd0a2
commit 9c31e15d48

View File

@ -16,6 +16,7 @@ from api.cas import installer
from api.cas import casadm
from api.cas import git
from test_utils.os_utils import Udev
from test_tools.disk_utils import PartitionTable, create_partition_table
from log.logger import create_log, Log
from test_utils.singleton import Singleton
@ -181,6 +182,11 @@ def base_prepare(item):
except Exception:
pass # TODO: Reboot DUT if test is executed remotely
for disk in TestRun.dut.disks:
disk.umount_all_partitions()
if not create_partition_table(disk, PartitionTable.gpt):
TestRun.exception(f"Failed to remove partitions from {disk}")
if get_force_param(item) and not TestRun.plugins['opencas'].already_updated:
installer.reinstall_opencas()
elif not installer.check_if_installed():