diff --git a/libvirt/tests/src/virsh_cmd/domain/virsh_restore.py b/libvirt/tests/src/virsh_cmd/domain/virsh_restore.py index e54cc21168..9e44215bac 100644 --- a/libvirt/tests/src/virsh_cmd/domain/virsh_restore.py +++ b/libvirt/tests/src/virsh_cmd/domain/virsh_restore.py @@ -216,3 +216,5 @@ def check_file_own(file_path, exp_uid, exp_gid): export_dir=params.get("export_dir"), rm_export_dir=False) if setup_iscsi: libvirt.setup_or_cleanup_iscsi(False) + if os.path.exists(tmp_file): + os.remove(tmp_file) diff --git a/libvirt/tests/src/virsh_cmd/domain/virsh_save.py b/libvirt/tests/src/virsh_cmd/domain/virsh_save.py index 068d33b476..d8d50cc552 100644 --- a/libvirt/tests/src/virsh_cmd/domain/virsh_save.py +++ b/libvirt/tests/src/virsh_cmd/domain/virsh_save.py @@ -155,3 +155,5 @@ def create_alter_xml(vm_name): finally: if vm.is_paused(): virsh.resume(vm_name) + if os.path.exists(savefile): + os.remove(savefile)