diff --git a/tests/__init__.py b/tests/__init__.py index 639b0bb2..227b97f3 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -147,8 +147,8 @@ class SystemTestsMixin(object): try: vm.remove_from_disk() except: pass - try: vm.libvirtDomain.undefine() - except (AttributeError, libvirt.libvirtError): pass + try: vm.libvirt_domain.undefine() + except libvirt.libvirtError: pass self.qc.pop(vm.qid) self.qc.save() @@ -337,7 +337,7 @@ class BackupTestsMixin(SystemTestsMixin): self.qc.load() - def restore_backup(self, source=None, appvm=None): + def restore_backup(self, source=None, appvm=None, options=None): if source is None: backupfile = os.path.join(self.backupdir, sorted(os.listdir(self.backupdir))[-1]) @@ -349,7 +349,8 @@ class BackupTestsMixin(SystemTestsMixin): backupfile, "qubes", host_collection=self.qc, print_callback=self.print_callback, - appvm=appvm) + appvm=appvm, + options=options or {}) if self.verbose: qubes.backup.backup_restore_print_summary(backup_info) @@ -361,6 +362,9 @@ class BackupTestsMixin(SystemTestsMixin): print_callback=self.print_callback if self.verbose else None, error_callback=self.error_callback) + # maybe someone forgot to call .save() + self.qc.load() + errors = [] while not self.error_detected.empty(): errors.append(self.error_detected.get()) diff --git a/tests/backupcompatibility.py b/tests/backupcompatibility.py index 5e35ab4f..f9883f7c 100644 --- a/tests/backupcompatibility.py +++ b/tests/backupcompatibility.py @@ -34,150 +34,21 @@ from qubes import backup import qubes.tests QUBESXML_R2B2 = ''' - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + ''' @@ -232,143 +103,10 @@ Icon=%VMDIR%/icon.png ''' QUBESXML_R1 = ''' - - - - - - - - - - - - - - + ''' + class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, unittest.TestCase): def create_whitelisted_appmenus(self, filename): f = open(filename, "w") @@ -546,4 +284,3 @@ class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, unittest.TestCase) self.assertEqual(self.qc.get_vm_by_name("test-custom-template-appvm") .template, self.qc.get_vm_by_name("test-template-clone")) -