From 10607a706364e65dc476f750a9a5a47fca8119bc Mon Sep 17 00:00:00 2001 From: catborise Date: Fri, 20 Nov 2026 09:32:07 +0300 Subject: [PATCH] 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. --- instances/tests/test_live_jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instances/tests/test_live_jobs.py b/instances/tests/test_live_jobs.py index fd75548c..9ff6b8a4 100644 --- a/instances/tests/test_live_jobs.py +++ b/instances/tests/test_live_jobs.py @@ -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])