diff --git a/console/tests/test_live_serial.py b/console/tests/test_live_serial.py index 728fbdac..aafd6adf 100644 --- a/console/tests/test_live_serial.py +++ b/console/tests/test_live_serial.py @@ -47,12 +47,12 @@ class LiveSerialConsoleTestCase(TransactionTestCase): self.server, self.port = start_socketiod(self) def token(self, host, login, password, conn_type): - compute = Compute.objects.create(name=P + host, hostname=host, login=login, password=password, type=conn_type) + compute = Compute.objects.create(name=f"{P}{host}-{conn_type}", hostname=host, login=login, password=password, type=conn_type) conn = connection_manager.get_connection(host, login, password, conn_type) before = livetest.inventory(conn) self.addCleanup(lambda: self.assertEqual(livetest.inventory(conn), before)) self.addCleanup(livetest.cleanup, conn) - dom = serial_vm(conn, P + "serial") + dom = serial_vm(conn, f"{P}serial-{conn_type}") vm = Instance.objects.create(compute=compute, name=dom.name(), uuid=dom.UUIDString()) UserInstance.objects.create(user=self.user, instance=vm) return tokens.SIGNER.sign(f"{compute.id}:{vm.uuid}:{self.user.id}"), dom diff --git a/vrtManager/tests/test_migration.py b/vrtManager/tests/test_migration.py index 194dbc7c..61bb949e 100644 --- a/vrtManager/tests/test_migration.py +++ b/vrtManager/tests/test_migration.py @@ -209,6 +209,11 @@ class ShutOffMigrationTestCase(unittest.TestCase): """libvirt's offline migration fails on some builds (RHEL-156800); a shut-off VM is only its definition, so the app moves that itself.""" + def setUp(self): + # a libvirtError built here takes the message of an earlier real error + # in this thread (an earlier live test) instead of its own + libvirt.virResetLastError() + def test_the_definition_moves_to_the_destination(self): host = FakeHost() source = FakeSource(5, xml="vm") @@ -434,6 +439,7 @@ class NvramCopyTestCase(unittest.TestCase): PATH = "/var/lib/libvirt/qemu/nvram/vm_VARS.fd" def setUp(self): + libvirt.virResetLastError() # see ShutOffMigrationTestCase.setUp self.source = FakeSource(5, nvram=self.PATH, xml="vm") self.source.wvm = mock.MagicMock() self.source.wvm.newStream.return_value.recvAll.side_effect = lambda fn, out: fn(None, b"vars", out)