tests: xmlconfig: Add tests for real uuid and mac generation

This commit is contained in:
Cole Robinson 2019-06-06 18:35:36 -04:00
parent 2bd08bee64
commit e58d765ae5
1 changed files with 13 additions and 0 deletions

View File

@ -215,3 +215,16 @@ class TestXMLMisc(unittest.TestCase):
self.assertTrue(not bool(fixlist))
finally:
os.environ["VIRTINST_TEST_SUITE"] = oldtest
def test_nonpredicatble_generate(self):
realconn = virtinst.cli.getConnection("test:///default")
testuuid = virtinst.Guest.generate_uuid(self.conn)
randomuuid = virtinst.Guest.generate_uuid(realconn)
self.assertTrue(randomuuid != testuuid)
self.assertTrue(len(randomuuid) == len(testuuid))
testmac = virtinst.DeviceInterface.generate_mac(self.conn)
randommac = virtinst.DeviceInterface.generate_mac(realconn)
self.assertTrue(randommac != testmac)
self.assertTrue(len(randommac) == len(testmac))