def cleanup(self): """ Clean up the host env. Umount NFS from the mount point. If there has some change for exported file system in host when setup, also clean up that. """ self.umount() if self.nfs_setup and self.unexportfs_in_clean: self.exportfs.reset_export() if self.mk_mount_dir and os.path.isdir(self.mount_dir): utils.safe_rmdir(self.mount_dir)
try: if status_error == "no": if options == "--config" and vm.is_alive(): vm.destroy() if vm.is_dead(): vm.start() session = vm.wait_for_login() check_media(session, check_file, action) session.close() finally: # Clean the iso dir and clean the device update_device(vm_name, "", options, start_vm) # Recover xml of vm. vmxml_backup.sync() utils.safe_rmdir(iso_dir) # Check status_error # Negative testing if status_error == "yes": if status: logging.info("Expected error (negative testing). Output: %s", result.stderr.strip()) else: raise error.TestFail("Unexpected return code %d " "(negative testing)" % status) # Positive testing elif status_error == "no": if status: if force_SKIP:
try: if status_error == "no": if options == "--config" and vm.is_alive(): vm.destroy() if vm.is_dead(): vm.start() session = vm.wait_for_login() check_media(session, check_file, action, rw_floppy_test) session.close() finally: # Clean the iso dir and clean the device update_device(vm_name, "", options, start_vm) # Recover xml of vm. vmxml_backup.sync() utils.safe_rmdir(iso_dir) # Check status_error # Negative testing if status_error == "yes": if status: logging.info("Expected error (negative testing). Output: %s", result.stderr.strip()) else: raise error.TestFail("Unexpected return code %d " "(negative testing)" % status) # Positive testing elif status_error == "no": if status: if force_SKIP: