1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00

test(live): the bulk migration live test sends moves

Since Bulk Migrate spreads VMs over hosts (#601) the job takes moves, each
VM with its destination, not a target and instances: the live test still
sent the old form and failed with KeyError 'moves'. Live suite on the
Vagrant computes: 3017 OK, 7 skipped.
This commit is contained in:
catborise 2026-11-20 09:32:07 +03:00
parent 3da55342da
commit 10607a7063

View file

@ -197,7 +197,7 @@ class LiveJobsTestCase(TransactionTestCase):
page = html.fromstring(self.client.get(reverse("bulk_migrate", args=[self.compute.pk]) + f"?target={dest.pk}").content)
disabled = {int(box.get("value")): box.get("disabled") is not None for box in page.xpath("//input[@name='instance']")}
self.assertEqual([disabled[vm.pk] for vm in (*vms, local)], [False, False, True]) # the host's other VMs as they are
raw = {"compute": self.compute.pk, "target": dest.pk, "parallel": 2, "instances": [vm.pk for vm in vms]}
raw = {"compute": self.compute.pk, "parallel": 2, "moves": [[vm.pk, dest.pk] for vm in vms]}
self.run_job(jobs.submit("host.bulk_migrate", self.admin, raw, "key-evac0001"), concurrency=4)
self.assertEqual(Operation.objects.filter(kind="instance.migrate", state=Operation.SUCCEEDED).count(), 2)
self.assertEqual([dest_conn.lookupByUUIDString(vm.uuid).isActive() for vm in vms], [True, False])