1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 03:36:48 +00:00

test: live tests with one host for TCP and SSH, and order-independent migration fakes

The serial console test names its compute and VM per connection type, so
the TCP and SSH host can be the same machine. The shut-off migration
fakes reset libvirt's last error first: a libvirtError takes the message
of an earlier real error in the thread, which a live test can leave.
This commit is contained in:
catborise 2026-10-18 11:21:06 +03:00
parent 38ff195a27
commit ade47c08af
2 changed files with 8 additions and 2 deletions

View file

@ -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