tests/backup: ignore automatic 'servicevm' feature...

...when verifying old backup restored. It wasn't present in the backup,
but its presence is expected in some cases. Properly setting 'servicevm'
feature is tested elsewhere.
This commit is contained in:
Marek Marczykowski-Górecki 2020-05-16 13:00:40 +02:00
parent c7d3635972
commit 88c7c66bb9
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -384,6 +384,9 @@ class TC_00_BackupCompatibility(
output.close() output.close()
def assertRestored(self, name, **kwargs): def assertRestored(self, name, **kwargs):
# ignore automatically added features
ignore_features = ['servicevm']
with self.assertNotRaises((KeyError, qubes.exc.QubesException)): with self.assertNotRaises((KeyError, qubes.exc.QubesException)):
vm = self.app.domains[name] vm = self.app.domains[name]
asyncio.get_event_loop().run_until_complete(vm.storage.verify()) asyncio.get_event_loop().run_until_complete(vm.storage.verify())
@ -391,7 +394,10 @@ class TC_00_BackupCompatibility(
if prop == 'klass': if prop == 'klass':
self.assertIsInstance(vm, value) self.assertIsInstance(vm, value)
elif prop == 'features': elif prop == 'features':
self.assertEqual(dict(vm.features), value, self.assertEqual(
dict((k, v) for k, v in vm.features.items()
if k not in ignore_features),
value,
'VM {} - features mismatch'.format(vm.name)) 'VM {} - features mismatch'.format(vm.name))
elif value is qubes.property.DEFAULT: elif value is qubes.property.DEFAULT:
self.assertTrue(vm.property_is_default(prop), self.assertTrue(vm.property_is_default(prop),