From 4faba183d1571010406ed5688d1285eed6209003 Mon Sep 17 00:00:00 2001 From: Mihaela Balutoiu Date: Mon, 13 Jan 2025 14:04:17 +0000 Subject: [PATCH] Update `e2e integration tests` Signed-off-by: Mihaela Balutoiu --- cypress/e2e/dashboard/dashboard.cy.ts | 45 +- .../deployments-list.cy.ts} | 56 +-- cypress/e2e/page header/page-header.cy.ts | 10 +- .../transfers-list.cy.ts} | 58 +-- cypress/fixtures/transfers/migrations.json | 408 +++++++++++++++--- .../transfers/replica-unexecuted.json | 11 +- cypress/fixtures/transfers/replicas.json | 125 +++++- cypress/support/commands.ts | 16 +- cypress/support/routeSelectors.ts | 6 +- 9 files changed, 549 insertions(+), 186 deletions(-) rename cypress/e2e/{migrations/migrations-list.cy.ts => deployments/deployments-list.cy.ts} (67%) rename cypress/e2e/{replicas/replicas-list.cy.ts => transfers/transfers-list.cy.ts} (74%) diff --git a/cypress/e2e/dashboard/dashboard.cy.ts b/cypress/e2e/dashboard/dashboard.cy.ts index 403e7efb..ac8fdc17 100644 --- a/cypress/e2e/dashboard/dashboard.cy.ts +++ b/cypress/e2e/dashboard/dashboard.cy.ts @@ -27,19 +27,19 @@ describe("Dashboard", () => { }; it("renders empty dashboard", () => { - cy.intercept(routeSelectors.REPLICAS, { - body: { replicas: [] }, - }).as("replicas"); - cy.intercept(routeSelectors.MIGRATIONS, { - body: { migrations: [] }, - }).as("migrations"); + cy.intercept(routeSelectors.TRANSFERS, { + body: { transfers: [] }, + }).as("transfers"); + cy.intercept(routeSelectors.DEPLOYMENTS, { + body: { deployments: [] }, + }).as("deployments"); cy.intercept(routeSelectors.ENDPOINTS, { body: { endpoints: [] }, }).as("endpoints"); cy.visit("/"); waitForAll(); - cy.wait(["@replicas", "@migrations", "@endpoints"]); + cy.wait(["@transfers", "@deployments", "@endpoints"]); cy.get("*[class^='DashboardActivity__Message']").should( "contain.text", @@ -58,43 +58,42 @@ describe("Dashboard", () => { cy.get("*[class^='DashboardLicence__ChartHeaderCurrent']").should( "contain.text", - `${applianceStatus.appliance_licence_status.current_performed_replicas} Fulfilled Replica ${applianceStatus.appliance_licence_status.current_performed_migrations} Fulfilled Migrations` + `${applianceStatus.appliance_licence_status.current_performed_replicas} Used Replica ${applianceStatus.appliance_licence_status.current_performed_migrations} Used Migrations` ); }); - cy.get("button").should("contain.text", "New Replica / Migration"); + cy.get("button").should("contain.text", "New Transfer"); cy.get("button").should("contain.text", "New Endpoint"); }); it("renders dashboard with data", () => { - cy.intercept(routeSelectors.REPLICAS, { + cy.intercept(routeSelectors.TRANSFERS, { fixture: "transfers/replicas.json", - }).as("replicas"); - cy.intercept(routeSelectors.MIGRATIONS, { - fixture: "transfers/migrations.json", - }).as("migrations"); + }).as("transfers"); cy.intercept(routeSelectors.ENDPOINTS, { fixture: "endpoints/endpoints.json", }).as("endpoints"); cy.visit("/"); waitForAll(); - cy.wait(["@replicas", "@migrations", "@endpoints"]); + cy.wait(["@transfers", "@endpoints"]); cy.loadFixtures( [ "transfers/replicas.json", - "transfers/migrations.json", "endpoints/endpoints.json", ], results => { - const [replicasFixture, migrationsFixture, endpointsFixture] = results; + const [transfersFixture, endpointsFixture] = results; + const replicasCount = transfersFixture.transfers.filter(transfer => transfer.scenario === "replica").length; + const migrationsCount = transfersFixture.transfers.filter(transfer => transfer.scenario === "live_migration").length; + cy.get("div[class^='DashboardInfoCount__CountBlock']").should( "contain.text", - `${replicasFixture.replicas.length}Replicas${migrationsFixture.migrations.length}Migrations${endpointsFixture.endpoints.length}Endpoints` + `${replicasCount}Replicas${migrationsCount}Migrations${endpointsFixture.endpoints.length}Endpoints` ); - const checkItem = (type: "migration" | "replica", item: any) => { + const checkItem = (type: "transfer", item: any) => { cy.get("div[class^='NotificationDropdown__ItemDescription']").should( "contain.text", `New ${type} ${item.id.substr( @@ -104,12 +103,8 @@ describe("Dashboard", () => { ); }; - migrationsFixture.migrations.forEach((migration: any) => { - checkItem("migration", migration); - }); - - replicasFixture.replicas.forEach((replica: any) => { - checkItem("replica", replica); + transfersFixture.transfers.forEach((transfer: any) => { + checkItem("transfer", transfer); }); } ); diff --git a/cypress/e2e/migrations/migrations-list.cy.ts b/cypress/e2e/deployments/deployments-list.cy.ts similarity index 67% rename from cypress/e2e/migrations/migrations-list.cy.ts rename to cypress/e2e/deployments/deployments-list.cy.ts index 63df4ae0..2f97a68a 100644 --- a/cypress/e2e/migrations/migrations-list.cy.ts +++ b/cypress/e2e/deployments/deployments-list.cy.ts @@ -2,7 +2,7 @@ import { routeSelectors } from "../../support/routeSelectors"; -describe("Migrations list", () => { +describe("Deployments list", () => { beforeEach(() => { cy.setProjectIdCookie(); @@ -20,28 +20,27 @@ describe("Migrations list", () => { }; it("renders empty list", () => { - cy.intercept(routeSelectors.MIGRATIONS, { - body: { replicas: [] }, - }).as("migrations"); + cy.intercept(routeSelectors.DEPLOYMENTS, { + body: { deployments: [] }, + }).as("deployments"); - cy.visit("/migrations"); + cy.visit("/deployments"); waitForAll(); - cy.wait(["@migrations"]); + cy.wait(["@deployments"]); cy.get("div[class^='MainList__EmptyListMessage']").should( "contain.text", - "don't have any Migrations in this project" + "don't have any Deployments in this project" ); - cy.get("button").should("contain.text", "Create a Migration"); }); it("filters list", () => { - cy.visit("/migrations"); + cy.visit("/deployments"); waitForAll(); cy.loadFixtures(["transfers/migrations"], (results: any[]) => { - const migrations = results[0].migrations; + const deployments = results[0].deployments; cy.get("div[class^='MainListFilter__FilterItem']") .contains("Running") @@ -53,7 +52,7 @@ describe("Migrations list", () => { .click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - migrations.filter(r => r.last_execution_status === "ERROR").length + deployments.filter(r => r.last_execution_status === "ERROR").length ); cy.get("div[class^='MainListFilter__FilterItem']") @@ -61,7 +60,7 @@ describe("Migrations list", () => { .click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - migrations.filter(r => r.last_execution_status === "COMPLETED").length + deployments.filter(r => r.last_execution_status === "COMPLETED").length ); cy.get("div[class^='MainListFilter__FilterItem']") @@ -69,7 +68,7 @@ describe("Migrations list", () => { .click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - migrations.filter(r => r.last_execution_status === "CANCELED").length + deployments.filter(r => r.last_execution_status === "CANCELED").length ); cy.get("div[class^='MainListFilter__FilterItem']") @@ -77,14 +76,14 @@ describe("Migrations list", () => { .click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - migrations.length + deployments.length ); cy.get("div[class^='SearchButton__Wrapper']").click(); cy.get("input[class*='SearchInput']").type("ol88-uefi"); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - migrations.filter(r => r.instances.find(i => i.includes("ol88-uefi"))) + deployments.filter(r => r.instances.find(i => i.includes("ol88-uefi"))) .length ); cy.get("div[class^='TextInput__Close']").click(); @@ -92,18 +91,18 @@ describe("Migrations list", () => { }); it("does bulk actions", () => { - cy.visit("/migrations"); + cy.visit("/deployments"); waitForAll(); cy.loadFixtures(["transfers/migrations"], (results: any[]) => { - const migrations: any[] = results[0].migrations; + const deployments: any[] = results[0].deployments; cy.get("div[class*='TransferListItem__Checkbox']").eq(0).click(); cy.get("div[class^='SearchButton__Wrapper']").click(); cy.get("input[class*='SearchInput']").type("ol88-uefi"); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - migrations.filter(r => r.instances.find(i => i.includes("ol88-uefi"))) + deployments.filter(r => r.instances.find(i => i.includes("ol88-uefi"))) .length ); cy.get("div[class*='TransferListItem__Checkbox']").eq(0).click(); @@ -114,29 +113,20 @@ describe("Migrations list", () => { cy.get("div[class^='ActionDropdown__Wrapper']").click(); cy.get("div[class^='ActionDropdown__ListItem']") - .contains("Recreate Migrations") + .contains("Recreate Deployments") .click(); cy.get("div[class^='AlertModal__Message']").should( "contain.text", "Are you sure you want to recreate" ); - let postCount = 0; - cy.intercept("POST", routeSelectors.MIGRATIONS, req => { - postCount += 1; - if (postCount === 1) { - expect(req.body.migration.instances).to.deep.eq([ - "Datacenter/ol88-bios", - ]); - } else if (postCount === 2) { - expect(req.body.migration.instances).to.deep.eq([ - "Datacenter/ol88-uefi", - ]); - } - }).as("migrations-recreate"); + cy.intercept("POST", routeSelectors.DEPLOYMENTS, req => { + expect(req.body.deployment.transfer_id, + "Transfer ID should be present in the request body").to.exist; + }).as("deployments-recreate"); cy.get("button").contains("Yes").click(); - cy.wait(["@migrations-recreate"]); + cy.wait(["@deployments-recreate"]); }); }); }); diff --git a/cypress/e2e/page header/page-header.cy.ts b/cypress/e2e/page header/page-header.cy.ts index 4f6e0e24..4d4fda4e 100644 --- a/cypress/e2e/page header/page-header.cy.ts +++ b/cypress/e2e/page header/page-header.cy.ts @@ -23,7 +23,7 @@ describe("Page header", () => { }; it("switches project", () => { - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.get("div[class^='Dropdown__Wrapper']").contains("admin").click(); @@ -44,7 +44,7 @@ describe("Page header", () => { }); it("redirects to user info", () => { - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.get("div[class^='UserDropdown__Wrapper']").click(); cy.get("a[class^='UserDropdown__Username']").click(); @@ -52,7 +52,7 @@ describe("Page header", () => { }); it("shows about coriolis", () => { - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.get("div[class^='UserDropdown__Wrapper']").click(); @@ -82,7 +82,7 @@ describe("Page header", () => { }); it("redirects to help", () => { - cy.visit("/replicas", { + cy.visit("/transfers", { onBeforeLoad(win) { cy.stub(win, "open").as("winOpen"); }, @@ -98,7 +98,7 @@ describe("Page header", () => { }); it("logs out", () => { - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.get("div[class^='UserDropdown__Wrapper']").click(); diff --git a/cypress/e2e/replicas/replicas-list.cy.ts b/cypress/e2e/transfers/transfers-list.cy.ts similarity index 74% rename from cypress/e2e/replicas/replicas-list.cy.ts rename to cypress/e2e/transfers/transfers-list.cy.ts index d8d0deb0..56965d61 100644 --- a/cypress/e2e/replicas/replicas-list.cy.ts +++ b/cypress/e2e/transfers/transfers-list.cy.ts @@ -20,20 +20,20 @@ describe("Replicas list", () => { }; it("renders empty list", () => { - cy.intercept(routeSelectors.REPLICAS, { - body: { replicas: [] }, - }).as("replicas"); + cy.intercept(routeSelectors.TRANSFERS, { + body: { transfers: [] }, + }).as("transfers"); - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); - cy.wait(["@replicas"]); + cy.wait(["@transfers"]); cy.get("div[class^='MainList__EmptyListMessage']").should( "contain.text", - "don't have any Replicas in this project" + "don't have any Transfers in this project" ); - cy.get("button").should("contain.text", "Create a Replica"); + cy.get("button").should("contain.text", "Create a Transfer"); }); it("renders list with scheduled icon", () => { @@ -46,14 +46,14 @@ describe("Replicas list", () => { "transfers/schedules-disabled", ], (results: any[]) => { - const replicas = results[0].replicas; - schedules = replicas.map((_, index) => + const transfers = results[0].transfers; + schedules = transfers.map((_, index) => index % 2 === 0 ? results[1].schedules : results[2].schedules ); - for (const [index, replica] of replicas.entries()) { + for (const [index, transfer] of transfers.entries()) { const scheduleAlias = `schedule-${index}`; - cy.intercept(`**/coriolis/**/replicas/${replica.id}/schedules`, { + cy.intercept(`**/coriolis/**/transfers/${transfer.id}/schedules`, { body: { schedules: schedules[index], }, @@ -63,7 +63,7 @@ describe("Replicas list", () => { } ); - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.wait(scheduleAliases); @@ -87,12 +87,12 @@ describe("Replicas list", () => { cy.intercept(routeSelectors.SCHEDULES, { fixture: "transfers/schedules-enabled.json", }).as("schedules"); - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.wait(["@schedules"]); cy.loadFixtures(["transfers/replicas"], (results: any[]) => { - const replicas = results[0].replicas; + const transfers = results[0].transfers; cy.get("div[class^='MainListFilter__FilterItem']") .contains("Error") @@ -104,7 +104,7 @@ describe("Replicas list", () => { .click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - replicas.filter(r => r.last_execution_status === "COMPLETED").length + transfers.filter(r => r.last_execution_status === "COMPLETED").length ); cy.get("div[class^='MainListFilter__FilterItem']") @@ -112,20 +112,20 @@ describe("Replicas list", () => { .click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - replicas.length + transfers.length ); cy.get("div[class^='SearchButton__Wrapper']").click(); cy.get("input[class*='SearchInput']").type("ol88"); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - replicas.filter(r => r.instances.find(i => i.includes("ol88"))).length + transfers.filter(r => r.instances.find(i => i.includes("ol88"))).length ); cy.get("div[class^='TextInput__Close']").click(); cy.get("div[class^='TransferListItem__Wrapper']").should( "have.length", - replicas.length + transfers.length ); }); }); @@ -134,33 +134,33 @@ describe("Replicas list", () => { cy.intercept(routeSelectors.SCHEDULES, { fixture: "transfers/schedules-enabled.json", }).as("schedules"); - cy.visit("/replicas"); + cy.visit("/transfers"); waitForAll(); cy.wait(["@schedules"]); cy.get("div[class*='TransferListItem__Checkbox']").eq(0).click(); cy.get("div[class*='MainListFilter__SelectionText']").should( "contain.text", - "1 of 2" + "1 of 3" ); cy.get("div[class^='ActionDropdown__Wrapper']").click(); cy.loadFixtures(["transfers/replicas"], (results: any[]) => { - const replicas = results[0].replicas; - cy.intercept(`**/coriolis/**/replicas/${replicas[0].id}`, { + const transfers = results[0].transfers; + cy.intercept(`**/coriolis/**/transfers/${transfers[0].id}`, { fixture: "transfers/replica-unexecuted", - }).as("replica"); + }).as("transfer"); cy.get("div[class^='ActionDropdown__ListItem']") - .contains("Delete Replicas") + .contains("Delete Transfers") .click(); - cy.wait(["@replica"]); + cy.wait(["@transfer"]); - cy.intercept("DELETE", `**/coriolis/**/replicas/${replicas[0].id}`, { + cy.intercept("DELETE", `**/coriolis/**/transfers/${transfers[0].id}`, { fixture: "transfers/replica-unexecuted", - }).as("delete-replica"); - cy.get("button").contains("Delete Replica").click(); - cy.wait(["@delete-replica"]); + }).as("delete-transfer"); + cy.get("button").contains("Delete Transfer").click(); + cy.wait(["@delete-transfer"]); }); }); }); diff --git a/cypress/fixtures/transfers/migrations.json b/cypress/fixtures/transfers/migrations.json index a327abc0..080edc13 100644 --- a/cypress/fixtures/transfers/migrations.json +++ b/cypress/fixtures/transfers/migrations.json @@ -1,5 +1,5 @@ { - "migrations": [ + "deployments": [ { "base_id": "549caaa0-e84e-43b3-b5fc-c28f51ceb6a0", "user_id": "eff03964a29b4f89b9fefc4c16de5f4f", @@ -7,9 +7,8 @@ "destination_environment": { "migr_worker_cpu_limit": 2, "migr_worker_memory_limit": 4, - "use_network_forwarding": true, - "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "4be82ece0d5d7a2265e2d15d19d539f280186b10549fcc0c19f347fa41305103" }, @@ -17,13 +16,27 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] } }, - "type": "migration", + "type": "deployment", "executions": [], - "instances": ["Datacenter/ol88-bios"], - "reservation_id": "f8f94f7d-07b5-4e78-aee7-2935a8683c10", + "instances": [ + "Datacenter/ol88-bios" + ], + "reservation_id": null, "notes": "", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", @@ -32,7 +45,19 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -46,11 +71,14 @@ "origin_minion_pool_id": null, "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, - "user_scripts": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, "id": "549caaa0-e84e-43b3-b5fc-c28f51ceb6a0", - "replica_id": null, - "shutdown_instances": false, - "replication_count": 2 + "transfer_id": "a9868952-85bf-48d7-bde4-bc866745c124", + "transfer_scenario_type": "replica", + "shutdown_instances": false }, { "base_id": "760b955c-f321-45f6-aa2f-3bb8d298d43d", @@ -59,9 +87,8 @@ "destination_environment": { "migr_worker_cpu_limit": 2, "migr_worker_memory_limit": 4, - "use_network_forwarding": true, - "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "ba714c2aca06757c2c19faa0b1bf1409757bb4574174ff12073ef951a195f3f2" }, @@ -69,22 +96,93 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] } }, - "type": "migration", + "type": "deployment", "executions": [], - "instances": ["Datacenter/ol88-uefi"], - "reservation_id": "91a77449-7ada-4e03-8f4f-438445aaadb3", + "instances": [ + "Datacenter/ol88-uefi" + ], + "reservation_id": null, "notes": null, "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", - "transfer_result": null, + "transfer_result": { + "Datacenter/ol88-uefi": { + "num_cpu": 4, + "memory_mb": 4096, + "name": "ol88-uefi", + "id": "ol88-uefi", + "firmware_type": "EFI", + "secure_boot": false, + "os_type": "linux", + "nested_virtualization": false, + "devices": { + "cdroms": [], + "floppies": [], + "serial_ports": [], + "controllers": [], + "disks": [ + { + "format": "raw", + "id": "root", + "size_bytes": 13958643712.0, + "path": "/" + }, + { + "format": "raw", + "id": "/dev/sdb", + "size_bytes": 1073741824.0, + "path": "" + } + ], + "nics": [ + { + "id": "eth0", + "name": "eth0", + "mac_address": "00:x:x:x:x:b0", + "ip_addresses": [ + "10.x.x.6", + "fd42:x:x:x:x:x:x:c1b0" + ], + "network_name": "tapff00339e", + "network_id": "tapff00339e" + } + ] + }, + "public_ip_address": "10.x.x.6" + } + }, "network_map": { "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -98,11 +196,14 @@ "origin_minion_pool_id": null, "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, - "user_scripts": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, "id": "760b955c-f321-45f6-aa2f-3bb8d298d43d", - "replica_id": null, - "shutdown_instances": false, - "replication_count": 2 + "transfer_id": "a9868952-85bf-48d7-bde4-bc866745c124", + "transfer_scenario_type": "replica", + "shutdown_instances": false }, { "base_id": "97add5e0-cbf2-4f1d-94ff-bb2aa8d05295", @@ -111,9 +212,8 @@ "destination_environment": { "migr_worker_cpu_limit": 2, "migr_worker_memory_limit": 4, - "use_network_forwarding": true, - "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "1e5c8a4627a4121bbde2749e4e6fbb313dba3052e2053c3f3f624e0543724cba" }, @@ -121,13 +221,27 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] } }, - "type": "migration", + "type": "deployment", "executions": [], - "instances": ["Datacenter/ol88-bios"], - "reservation_id": "e3fbc524-c5af-46bc-a4e5-01697539fb0b", + "instances": [ + "Datacenter/ol88-bios" + ], + "reservation_id": null, "notes": "", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", @@ -136,7 +250,19 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -150,11 +276,14 @@ "origin_minion_pool_id": null, "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, - "user_scripts": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, "id": "97add5e0-cbf2-4f1d-94ff-bb2aa8d05295", - "replica_id": null, - "shutdown_instances": false, - "replication_count": 2 + "transfer_id": "a9868952-85bf-48d7-bde4-bc866745c124", + "transfer_scenario_type": "replica", + "shutdown_instances": false }, { "base_id": "9aad18e1-4c20-4a98-b16f-7a2f7655d18e", @@ -163,9 +292,8 @@ "destination_environment": { "migr_worker_cpu_limit": 2, "migr_worker_memory_limit": 4, - "use_network_forwarding": true, - "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "1e5c8a4627a4121bbde2749e4e6fbb313dba3052e2053c3f3f624e0543724cba" }, @@ -173,22 +301,93 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] } }, - "type": "migration", + "type": "deployment", "executions": [], - "instances": ["Datacenter/ol88-bios"], - "reservation_id": "fb44d241-8c97-4687-891f-2a3a21ba85d0", + "instances": [ + "Datacenter/ol88-bios" + ], + "reservation_id": null, "notes": "", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", - "transfer_result": null, + "transfer_result": { + "Datacenter/ol88-bios": { + "num_cpu": 4, + "memory_mb": 4096, + "name": "ol88-bios", + "id": "ol88-bios", + "firmware_type": "EFI", + "secure_boot": false, + "os_type": "linux", + "nested_virtualization": false, + "devices": { + "cdroms": [], + "floppies": [], + "serial_ports": [], + "controllers": [], + "disks": [ + { + "format": "raw", + "id": "root", + "size_bytes": 13958643712.0, + "path": "/" + }, + { + "format": "raw", + "id": "/dev/sdb", + "size_bytes": 1073741824.0, + "path": "" + } + ], + "nics": [ + { + "id": "eth0", + "name": "eth0", + "mac_address": "00:x:x:x:x:b0", + "ip_addresses": [ + "10.x.x.6", + "fd42:x:x:x:x:x:x:c1b0" + ], + "network_name": "tapff00339e", + "network_id": "tapff00339e" + } + ] + }, + "public_ip_address": "10.x.x.6" + } + }, "network_map": { "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -202,11 +401,14 @@ "origin_minion_pool_id": null, "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, - "user_scripts": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, "id": "9aad18e1-4c20-4a98-b16f-7a2f7655d18e", - "replica_id": null, - "shutdown_instances": false, - "replication_count": 2 + "transfer_id": "a9868952-85bf-48d7-bde4-bc866745c124", + "transfer_scenario_type": "replica", + "shutdown_instances": false }, { "base_id": "d8ad2fe7-57ef-4940-ae80-c392383831b5", @@ -215,9 +417,8 @@ "destination_environment": { "migr_worker_cpu_limit": 2, "migr_worker_memory_limit": 4, - "use_network_forwarding": true, - "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "1e5c8a4627a4121bbde2749e4e6fbb313dba3052e2053c3f3f624e0543724cba" }, @@ -225,13 +426,27 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] } }, - "type": "migration", + "type": "deployment", "executions": [], - "instances": ["Datacenter/ol88-bios"], - "reservation_id": "28c1a203-22da-49a6-9a49-134069eb5e20", + "instances": [ + "Datacenter/ol88-bios" + ], + "reservation_id": null, "notes": "", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", @@ -242,6 +457,7 @@ "name": "ol88-bios", "id": "ol88-bios", "firmware_type": "EFI", + "secure_boot": false, "os_type": "linux", "nested_virtualization": false, "devices": { @@ -268,7 +484,10 @@ "id": "eth0", "name": "eth0", "mac_address": "00:x:x:x:x:b0", - "ip_addresses": ["10.x.x.6", "fd42:x:x:x:x:x:x:c1b0"], + "ip_addresses": [ + "10.x.x.6", + "fd42:x:x:x:x:x:x:c1b0" + ], "network_name": "tapff00339e", "network_id": "tapff00339e" } @@ -281,7 +500,19 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -295,11 +526,14 @@ "origin_minion_pool_id": null, "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, - "user_scripts": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, "id": "d8ad2fe7-57ef-4940-ae80-c392383831b5", - "replica_id": null, - "shutdown_instances": false, - "replication_count": 2 + "transfer_id": "a9868952-85bf-48d7-bde4-bc866745c124", + "transfer_scenario_type": "replica", + "shutdown_instances": false }, { "base_id": "e25ffdc0-c81a-4003-a2d6-2592bdc19c9d", @@ -308,9 +542,8 @@ "destination_environment": { "migr_worker_cpu_limit": 2, "migr_worker_memory_limit": 4, - "use_network_forwarding": true, - "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "1e5c8a4627a4121bbde2749e4e6fbb313dba3052e2053c3f3f624e0543724cba" }, @@ -318,13 +551,27 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] } }, - "type": "migration", + "type": "deployment", "executions": [], - "instances": ["Datacenter/ol88-bios"], - "reservation_id": "c791029e-8f58-4c34-bc37-abc2427ab1e6", + "instances": [ + "Datacenter/ol88-bios" + ], + "reservation_id": null, "notes": "", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", @@ -335,6 +582,7 @@ "name": "ol88-bios", "id": "ol88-bios", "firmware_type": "EFI", + "secure_boot": false, "os_type": "linux", "nested_virtualization": false, "devices": { @@ -361,7 +609,10 @@ "id": "eth0", "name": "eth0", "mac_address": "00:x:x:x:x:f4", - "ip_addresses": ["10.x.x.x", "fd42:x:x:x:x:x:x:79f4"], + "ip_addresses": [ + "10.x.x.x", + "fd42:x:x:x:x:x:x:79f4" + ], "network_name": "tapx10", "network_id": "tapx10" } @@ -374,7 +625,19 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -388,11 +651,14 @@ "origin_minion_pool_id": null, "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, - "user_scripts": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, "id": "e25ffdc0-c81a-4003-a2d6-2592bdc19c9d", - "replica_id": null, - "shutdown_instances": false, - "replication_count": 2 + "transfer_id": "8f4ea499-0cc1-4199-800a-ea673b963c43", + "transfer_scenario_type": "live_migration", + "shutdown_instances": false } ] } diff --git a/cypress/fixtures/transfers/replica-unexecuted.json b/cypress/fixtures/transfers/replica-unexecuted.json index acac8314..47a7a7f3 100644 --- a/cypress/fixtures/transfers/replica-unexecuted.json +++ b/cypress/fixtures/transfers/replica-unexecuted.json @@ -1,5 +1,5 @@ { - "replica": { + "transfers": { "base_id": "5395842a-7006-41a3-95ac-e5083561a4d9", "user_id": "eff03964a29b4f89b9fefc4c16de5f4f", "project_id": "a379d2b6bd8d4b898733fb1e1b7967f7", @@ -16,9 +16,11 @@ }, "storage_mappings": {} }, - "type": "replica", + "type": "transfer", "executions": [], - "instances": ["Datacenter/dvincze-ol9-bios"], + "instances": [ + "Datacenter/dvincze-ol9-bios" + ], "reservation_id": "3e147d9c-7259-48a6-bf73-db399e972bae", "notes": "dvincze-ol9-bios", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", @@ -41,6 +43,7 @@ "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, "user_scripts": {}, - "id": "5395842a-7006-41a3-95ac-e5083561a4d9" + "id": "5395842a-7006-41a3-95ac-e5083561a4d9", + "scenario": "replica" } } diff --git a/cypress/fixtures/transfers/replicas.json b/cypress/fixtures/transfers/replicas.json index 60556a08..b7f250d9 100644 --- a/cypress/fixtures/transfers/replicas.json +++ b/cypress/fixtures/transfers/replicas.json @@ -1,5 +1,5 @@ { - "replicas": [ + "transfers": [ { "base_id": "5395842a-7006-41a3-95ac-e5083561a4d9", "user_id": "eff03964a29b4f89b9fefc4c16de5f4f", @@ -17,9 +17,11 @@ }, "storage_mappings": {} }, - "type": "replica", + "type": "transfer", "executions": [], - "instances": ["Datacenter/dvincze-ol9-bios"], + "instances": [ + "Datacenter/dvincze-ol9-bios" + ], "reservation_id": "3e147d9c-7259-48a6-bf73-db399e972bae", "notes": "dvincze-ol9-bios", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", @@ -42,7 +44,8 @@ "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, "user_scripts": {}, - "id": "5395842a-7006-41a3-95ac-e5083561a4d9" + "id": "5395842a-7006-41a3-95ac-e5083561a4d9", + "scenario": "live_migration" }, { "base_id": "a9868952-85bf-48d7-bde4-bc866745c124", @@ -54,6 +57,7 @@ "use_network_forwarding": true, "retain_user_credentials": true, "migr_network": "default", + "migr_worker_network_forwarding": true, "migr_image_map": { "linux": "ba714c2aca06757c2c19faa0b1bf1409757bb4574174ff12073ef951a195f3f2" }, @@ -61,12 +65,104 @@ "VM Network": "default" }, "storage_mappings": { + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ], "default": "remote" } }, - "type": "replica", + "type": "transfer", "executions": [], - "instances": ["Datacenter/ol88-bios"], + "instances": [ + "Datacenter/ol88-bios" + ], + "reservation_id": "c45dc2fc-a222-4f0b-b8bd-b527ac32c695", + "notes": "", + "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", + "destination_endpoint_id": "72ebf901-85c8-4a7a-9842-cb058c38b65d", + "transfer_result": null, + "network_map": { + "VM Network": "default" + }, + "storage_mappings": { + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] + }, + "source_environment": { + "automatically_enable_cbt": true, + "vixdisklib_compatibility_version": "6.7" + }, + "last_execution_status": "COMPLETED", + "created_at": "2023-09-17T13:28:13.000000", + "updated_at": "2023-09-17T13:44:33.000000", + "deleted_at": null, + "deleted": "0", + "origin_minion_pool_id": null, + "destination_minion_pool_id": null, + "instance_osmorphing_minion_pool_mappings": {}, + "user_scripts": { + "global": {}, + "instances": {} + }, + "id": "a9868952-85bf-48d7-bde4-bc866745c124", + "scenario": "replica" + }, + { + "base_id": "8f4ea499-0cc1-4199-800a-ea673b963c43", + "user_id": "eff03964a29b4f89b9fefc4c16de5f4f", + "project_id": "a379d2b6bd8d4b898733fb1e1b7967f7", + "destination_environment": { + "migr_worker_cpu_limit": 2, + "migr_worker_memory_limit": 4, + "migr_network": "default", + "migr_image_map": { + "linux": "e892f376d85619000fd80d3f7adced6c72aac9e94f53cdc0dd6ab1fd0c5400a9" + }, + "migr_worker_network_forwarding": true, + "network_map": { + "VM Network": "default" + }, + "storage_mappings": { + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] + } + }, + "type": "transfer", + "executions": [], + "instances": [ + "Datacenter/ol88-bios" + ], "reservation_id": "09ee12d0-f0d0-4603-949e-6312f17430a8", "notes": "ol88-bios", "origin_endpoint_id": "f8fd5f35-2c54-4786-b32d-8f6fb3b057e7", @@ -76,7 +172,19 @@ "VM Network": "default" }, "storage_mappings": { - "default": "remote" + "default": "remote", + "backend_mappings": [ + { + "source": "datastore0", + "destination": "remote" + } + ], + "disk_mappings": [ + { + "disk_id": "2000", + "destination": "remote" + } + ] }, "source_environment": { "automatically_enable_cbt": true, @@ -91,7 +199,8 @@ "destination_minion_pool_id": null, "instance_osmorphing_minion_pool_mappings": {}, "user_scripts": {}, - "id": "a9868952-85bf-48d7-bde4-bc866745c124" + "id": "8f4ea499-0cc1-4199-800a-ea673b963c43", + "scenario": "live_migration" } ] } diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index d53dc656..d2156b93 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -30,8 +30,8 @@ const AUTH_RESOURCES = [ "users", "projects", "roles", - "replicas", - "migrations", + "transfers", + "deployments", ]; Cypress.Commands.add("mockAuth", (options?: { filterResources?: string[] }) => { @@ -65,15 +65,15 @@ Cypress.Commands.add("mockAuth", (options?: { filterResources?: string[] }) => { fixture: "auth/role-assignments", }).as("roles"); break; - case "replicas": - cy.intercept(routeSelectors.REPLICAS, { + case "transfers": + cy.intercept(routeSelectors.TRANSFERS, { fixture: "transfers/replicas", - }).as("replicas"); + }).as("transfers"); break; - case "migrations": - cy.intercept(routeSelectors.MIGRATIONS, { + case "deployments": + cy.intercept(routeSelectors.DEPLOYMENTS, { fixture: "transfers/migrations", - }).as("migrations"); + }).as("deployments"); break; } } diff --git a/cypress/support/routeSelectors.ts b/cypress/support/routeSelectors.ts index 6b347d5f..1be8a7b7 100644 --- a/cypress/support/routeSelectors.ts +++ b/cypress/support/routeSelectors.ts @@ -4,13 +4,13 @@ export const routeSelectors = { AUTH_TOKENS: "**/identity/auth/tokens", CONN_SCHEMA_OPENSTACK: "**/coriolis/**/providers/openstack/schemas/16", ENDPOINTS: "**/coriolis/**/endpoints", - MIGRATIONS: "**/coriolis/**/migrations", + DEPLOYMENTS: "**/coriolis/**/deployments", PROJECTS: "**/identity/auth/projects", PROVIDERS: "**/coriolis/**/providers", REGIONS: "**/coriolis/**/regions", - REPLICAS: "**/coriolis/**/replicas", + TRANSFERS: "**/coriolis/**/transfers", ROLE_ASSIGNMENTS: "**/identity/role_assignments*", - SCHEDULES: "**/coriolis/**/replicas/**/schedules", + SCHEDULES: "**/coriolis/**/transfers/**/schedules", SECRETS: "**/barbican/**/secrets", STATUS: "**/licensing/status", USER: "**/identity/users/*",