tests: try to change name to conflicting value

QubesOS/qubes-issues#1723
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-06 05:37:27 +01:00
parent f13abc2ace
commit be231421de
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -268,6 +268,45 @@ class TC_01_Properties(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
self.assertEquals(testvm1.get_firewall_conf(),
testvm3.get_firewall_conf())
def test_020_name_conflict_app(self):
with self.assertRaises(QubesException):
self.vm2 = self.qc.add_new_vm('QubesAppVm',
name=self.vmname, template=self.qc.get_default_template())
self.vm2.create_on_disk(verbose=False)
def test_021_name_conflict_hvm(self):
with self.assertRaises(QubesException):
self.vm2 = self.qc.add_new_vm('QubesHVm',
name=self.vmname, template=self.qc.get_default_template())
self.vm2.create_on_disk(verbose=False)
def test_022_name_conflict_net(self):
with self.assertRaises(QubesException):
self.vm2 = self.qc.add_new_vm('QubesNetVm',
name=self.vmname, template=self.qc.get_default_template())
self.vm2.create_on_disk(verbose=False)
def test_030_rename_conflict_app(self):
vm2name = self.make_vm_name('newname')
self.vm2 = self.qc.add_new_vm('QubesAppVm',
name=vm2name, template=self.qc.get_default_template())
self.vm2.create_on_disk(verbose=False)
with self.assertRaises(QubesException):
self.vm2.set_name(self.vmname)
def test_031_rename_conflict_net(self):
vm3name = self.make_vm_name('newname')
self.vm3 = self.qc.add_new_vm('QubesNetVm',
name=vm3name, template=self.qc.get_default_template())
self.vm3.create_on_disk(verbose=False)
with self.assertRaises(QubesException):
self.vm3.set_name(self.vmname)
class TC_02_QvmPrefs(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
def setup_appvm(self):
self.testvm = self.qc.add_new_vm(