From a880b4cf8cae3ac55882b6229822206ab95bd713 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 30 Dec 2021 13:58:58 +0530 Subject: [PATCH] mgr/dashboard: stabilizing the cephadm dashboard e2e Reordering the tests and adding some more tests to verify the cluster is healthy before proceeding to do some complex tasks like maintenance and drain host Fixes: https://tracker.ceph.com/issues/53742 Signed-off-by: Nizamudeen A (cherry picked from commit fbc9f46459537d0799c448e27f80623d7d4805c8) --- .../integration/cluster/services.po.ts | 4 ++-- ...reate-cluster-create-services.e2e-spec.ts} | 6 +++--- ...04-create-cluster-create-osds.e2e-spec.ts} | 0 .../workflow/06-cluster-check.e2e-spec.ts | 21 +++++++++++++------ 4 files changed, 20 insertions(+), 11 deletions(-) rename src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/{04-create-cluster-create-services.e2e-spec.ts => 03-create-cluster-create-services.e2e-spec.ts} (93%) rename src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/{03-create-cluster-create-osds.e2e-spec.ts => 04-create-cluster-create-osds.e2e-spec.ts} (100%) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts index 0b70e90b6563..2d1969b75bd0 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts @@ -70,12 +70,12 @@ export class ServicesPageHelper extends PageHelper { } } - editService(name: string, count: string) { + editService(name: string, daemonCount: string) { this.navigateEdit(name, true, false); cy.get(`${this.pages.create.id}`).within(() => { cy.get('#service_type').should('be.disabled'); cy.get('#service_id').should('be.disabled'); - cy.get('#count').clear().type(count); + cy.get('#count').clear().type(daemonCount); cy.get('cd-submit-button').click(); }); } diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts similarity index 93% rename from src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts rename to src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts index 266983df155b..e1b33fea34f7 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-services.e2e-spec.ts @@ -39,9 +39,9 @@ describe('Create cluster create services page', () => { }); it('should edit a service', () => { - const count = '3'; - createClusterServicePage.editService(serviceName, count); - createClusterServicePage.expectPlacementCount(serviceName, count); + const daemonCount = '4'; + createClusterServicePage.editService(serviceName, daemonCount); + createClusterServicePage.expectPlacementCount(serviceName, daemonCount); }); it('should create an ingress service', () => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts similarity index 100% rename from src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts rename to src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-osds.e2e-spec.ts diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts index 633d9733c99b..ff6017559f2e 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts @@ -55,11 +55,13 @@ describe('when cluster creation is completed', () => { }); }); - it('should check if rgw service is running', () => { - hosts.clickTab('cd-host-details', hostnames[3], 'Daemons'); - cy.get('cd-host-details').within(() => { - services.checkServiceStatus('rgw'); - }); + it('should check if mon daemon is running on all hosts', () => { + for (const hostname of hostnames) { + hosts.clickTab('cd-host-details', hostname, 'Daemons'); + cy.get('cd-host-details').within(() => { + services.checkServiceStatus('mon'); + }); + } }); }); @@ -71,7 +73,7 @@ describe('when cluster creation is completed', () => { }); it('should check if osds are created', { retries: 1 }, () => { - osds.getTableCount('total').should('be.gte', 1); + osds.getTableCount('total').should('be.gte', 2); }); }); @@ -90,6 +92,13 @@ describe('when cluster creation is completed', () => { hosts.navigateTo(); }); + it('should check if rgw daemon is running', () => { + hosts.clickTab('cd-host-details', hostnames[3], 'Daemons'); + cy.get('cd-host-details').within(() => { + services.checkServiceStatus('rgw'); + }); + }); + it('should force maintenance and exit', { retries: 1 }, () => { hosts.maintenance(hostnames[3], true, true); }); -- 2.47.3