def base_prepare(item): with TestRun.LOGGER.step("Cleanup before test"): Udev.enable() kill_all_io() if installer.check_if_installed(): try: unmount_cas_devices() casadm.stop_all_caches() 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(): installer.install_opencas() TestRun.plugins['opencas'].already_updated = True from api.cas import init_config init_config.create_default_init_config() TestRun.LOGGER.add_build_info(f'Commit hash:') TestRun.LOGGER.add_build_info(f"{git.get_current_commit_hash()}") TestRun.LOGGER.add_build_info(f'Commit message:') TestRun.LOGGER.add_build_info(f'{git.get_current_commit_message()}')
def base_prepare(): TestRun.LOGGER.info("Base test prepare") TestRun.LOGGER.info(f"DUT info: {TestRun.dut}") Udev.enable() kill_all_io() if installer.check_if_installed(): try: unmount_cas_devices() casadm.stop_all_caches() except Exception: pass # TODO: Reboot DUT if test is executed remotely if get_force_param( ) is not "False" and not TestRun.plugins['opencas']['already_updated']: installer.reinstall_opencas() elif not installer.check_if_installed(): installer.install_opencas() TestRun.plugins['opencas']['already_updated'] = True