tests: port backupcompatibility to core3 API
This commit is contained in:
parent
8c5d42a095
commit
c55ca8004a
@ -822,7 +822,7 @@ def load_tests(loader, tests, pattern): # pylint: disable=unused-argument
|
||||
'qubes.tests.int.network',
|
||||
# 'qubes.tests.vm_qrexec_gui',
|
||||
'qubes.tests.int.backup',
|
||||
# 'qubes.tests.backupcompatibility',
|
||||
'qubes.tests.int.backupcompatibility',
|
||||
# 'qubes.tests.regressions',
|
||||
|
||||
# tool tests
|
||||
|
@ -29,8 +29,6 @@ import subprocess
|
||||
import unittest
|
||||
import sys
|
||||
import re
|
||||
from qubes.qubes import QubesVmCollection, QubesException
|
||||
from qubes import backup
|
||||
|
||||
import qubes.tests
|
||||
|
||||
@ -146,6 +144,11 @@ compression-filter=gzip
|
||||
'''
|
||||
|
||||
class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, qubes.tests.QubesTestCase):
|
||||
|
||||
def tearDown(self):
|
||||
self.remove_test_vms(prefix="test-")
|
||||
super(TC_00_BackupCompatibility, self).tearDown()
|
||||
|
||||
def create_whitelisted_appmenus(self, filename):
|
||||
f = open(filename, "w")
|
||||
f.write("gnome-terminal.desktop\n")
|
||||
@ -401,19 +404,22 @@ class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, qubes.tests.QubesT
|
||||
f.write(QUBESXML_R1)
|
||||
f.close()
|
||||
|
||||
self.restore_backup(self.backupdir, options={
|
||||
'use-default-template': True,
|
||||
'use-default-netvm': True,
|
||||
})
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testproxy"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-work"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-standalonevm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name(
|
||||
"test-custom-template-appvm"))
|
||||
self.assertEqual(self.qc.get_vm_by_name("test-custom-template-appvm")
|
||||
self.restore_backup(self.backupdir,
|
||||
options={
|
||||
'use-default-template': True,
|
||||
'use-default-netvm': True,
|
||||
},
|
||||
expect_errors=['Kernel None not installed, using default one']
|
||||
)
|
||||
with self.assertNotRaises(KeyError):
|
||||
vm = self.app.domains["test-template-clone"]
|
||||
vm = self.app.domains["test-testproxy"]
|
||||
vm = self.app.domains["test-work"]
|
||||
vm = self.app.domains["test-standalonevm"]
|
||||
vm = self.app.domains["test-custom-template-appvm"]
|
||||
self.assertEqual(self.app.domains["test-custom-template-appvm"]
|
||||
.template,
|
||||
self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.app.domains["test-template-clone"])
|
||||
|
||||
def test_200_r2b2(self):
|
||||
self.create_v1_files(r2b2=True)
|
||||
@ -425,16 +431,16 @@ class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, qubes.tests.QubesT
|
||||
self.restore_backup(self.backupdir, options={
|
||||
'use-default-template': True,
|
||||
})
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testproxy"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-work"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testhvm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-standalonevm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name(
|
||||
"test-custom-template-appvm"))
|
||||
self.assertEqual(self.qc.get_vm_by_name("test-custom-template-appvm")
|
||||
with self.assertNotRaises(KeyError):
|
||||
vm = self.app.domains["test-template-clone"]
|
||||
vm = self.app.domains["test-testproxy"]
|
||||
vm = self.app.domains["test-work"]
|
||||
vm = self.app.domains["test-testhvm"]
|
||||
vm = self.app.domains["test-standalonevm"]
|
||||
vm = self.app.domains["test-custom-template-appvm"]
|
||||
self.assertEqual(self.app.domains["test-custom-template-appvm"]
|
||||
.template,
|
||||
self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.app.domains["test-template-clone"])
|
||||
|
||||
def test_210_r2(self):
|
||||
self.create_v3_backup(False)
|
||||
@ -443,16 +449,16 @@ class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, qubes.tests.QubesT
|
||||
'use-default-template': True,
|
||||
'use-default-netvm': True,
|
||||
})
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testproxy"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-work"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testhvm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-standalonevm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name(
|
||||
"test-custom-template-appvm"))
|
||||
self.assertEqual(self.qc.get_vm_by_name("test-custom-template-appvm")
|
||||
with self.assertNotRaises(KeyError):
|
||||
vm = self.app.domains["test-template-clone"]
|
||||
vm = self.app.domains["test-testproxy"]
|
||||
vm = self.app.domains["test-work"]
|
||||
vm = self.app.domains["test-testhvm"]
|
||||
vm = self.app.domains["test-standalonevm"]
|
||||
vm = self.app.domains["test-custom-template-appvm"]
|
||||
self.assertEqual(self.app.domains["test-custom-template-appvm"]
|
||||
.template,
|
||||
self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.app.domains["test-template-clone"])
|
||||
|
||||
def test_220_r2_encrypted(self):
|
||||
self.create_v3_backup(True)
|
||||
@ -461,13 +467,13 @@ class TC_00_BackupCompatibility(qubes.tests.BackupTestsMixin, qubes.tests.QubesT
|
||||
'use-default-template': True,
|
||||
'use-default-netvm': True,
|
||||
})
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testproxy"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-work"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-testhvm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name("test-standalonevm"))
|
||||
self.assertIsNotNone(self.qc.get_vm_by_name(
|
||||
"test-custom-template-appvm"))
|
||||
self.assertEqual(self.qc.get_vm_by_name("test-custom-template-appvm")
|
||||
with self.assertNotRaises(KeyError):
|
||||
vm = self.app.domains["test-template-clone"]
|
||||
vm = self.app.domains["test-testproxy"]
|
||||
vm = self.app.domains["test-work"]
|
||||
vm = self.app.domains["test-testhvm"]
|
||||
vm = self.app.domains["test-standalonevm"]
|
||||
vm = self.app.domains["test-custom-template-appvm"]
|
||||
self.assertEqual(self.app.domains["test-custom-template-appvm"]
|
||||
.template,
|
||||
self.qc.get_vm_by_name("test-template-clone"))
|
||||
self.app.domains["test-template-clone"])
|
@ -275,6 +275,7 @@ fi
|
||||
%dir %{python_sitelib}/qubes/tests/int
|
||||
%{python_sitelib}/qubes/tests/int/__init__.py*
|
||||
%{python_sitelib}/qubes/tests/int/backup.py*
|
||||
%{python_sitelib}/qubes/tests/int/backupcompatibility.py*
|
||||
%{python_sitelib}/qubes/tests/int/basic.py*
|
||||
%{python_sitelib}/qubes/tests/int/dom0_update.py*
|
||||
%{python_sitelib}/qubes/tests/int/network.py*
|
||||
|
Loading…
Reference in New Issue
Block a user