From fa119a97b9f5369aae08238183e6e66bf4c989f7 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Fri, 24 Dec 2021 11:09:37 +0530 Subject: [PATCH] mgr/dashboard: dashboard cephadm e2e improvement Fixes: https://tracker.ceph.com/issues/53742 Signed-off-by: Nizamudeen A (cherry picked from commit 26f86f6cd32fc86297e250472e3205d4d65744fb) --- ...create-cluster-create-services.e2e-spec.ts | 23 ++++++---- .../workflow/06-cluster-check.e2e-spec.ts | 46 +++++++++++-------- 2 files changed, 40 insertions(+), 29 deletions(-) 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/04-create-cluster-create-services.e2e-spec.ts index aec174a99cdba..266983df155b9 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/04-create-cluster-create-services.e2e-spec.ts @@ -7,6 +7,12 @@ describe('Create cluster create services page', () => { const createCluster = new CreateClusterWizardHelper(); const createClusterServicePage = new CreateClusterServicePageHelper(); + const createService = (serviceType: string, serviceName: string, count?: string) => { + cy.get('.btn.btn-accent').first().click({ force: true }); + createClusterServicePage.addService(serviceType, false, count); + createClusterServicePage.checkExist(serviceName, true); + }; + beforeEach(() => { cy.login(); Cypress.Cookies.preserveOnce('token'); @@ -23,10 +29,13 @@ describe('Create cluster create services page', () => { const serviceName = 'rgw.foo'; it('should create an rgw service', () => { - cy.get('.btn.btn-accent').first().click({ force: true }); + createService('rgw', serviceName, '2'); + }); - createClusterServicePage.addService('rgw', false, '2'); - createClusterServicePage.checkExist(serviceName, true); + it('should delete the service and add it back', () => { + createClusterServicePage.deleteService(serviceName); + + createService('rgw', serviceName, '2'); }); it('should edit a service', () => { @@ -35,12 +44,8 @@ describe('Create cluster create services page', () => { createClusterServicePage.expectPlacementCount(serviceName, count); }); - it('should create and delete an ingress service', () => { - cy.get('.btn.btn-accent').first().click({ force: true }); - - createClusterServicePage.addService('ingress'); - createClusterServicePage.checkExist('ingress.rgw.foo', true); - createClusterServicePage.deleteService('ingress.rgw.foo'); + it('should create an ingress service', () => { + createService('ingress', 'ingress.rgw.foo', '2'); }); }); }); 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 46cd5fa19c9f1..633d9733c99b5 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 @@ -6,7 +6,15 @@ import { ServicesPageHelper } from 'cypress/integration/cluster/services.po'; describe('when cluster creation is completed', () => { const createCluster = new CreateClusterWizardHelper(); const services = new ServicesPageHelper(); + const hosts = new HostsPageHelper(); + const serviceName = 'rgw.foo'; + const hostnames = [ + 'ceph-node-00.cephlab.com', + 'ceph-node-01.cephlab.com', + 'ceph-node-02.cephlab.com', + 'ceph-node-03.cephlab.com' + ]; beforeEach(() => { cy.login(); @@ -23,14 +31,6 @@ describe('when cluster creation is completed', () => { }); describe('Hosts page', () => { - const hosts = new HostsPageHelper(); - const hostnames = [ - 'ceph-node-00.cephlab.com', - 'ceph-node-01.cephlab.com', - 'ceph-node-02.cephlab.com', - 'ceph-node-03.cephlab.com' - ]; - beforeEach(() => { hosts.navigateTo(); }); @@ -61,18 +61,6 @@ describe('when cluster creation is completed', () => { services.checkServiceStatus('rgw'); }); }); - - it('should drain, remove and add the host back', () => { - hosts.drain(hostnames[1]); - hosts.remove(hostnames[1]); - hosts.navigateTo('add'); - hosts.add(hostnames[1]); - hosts.checkExist(hostnames[1], true); - }); - - it('should force maintenance and exit', { retries: 1 }, () => { - hosts.maintenance(hostnames[3], true, true); - }); }); describe('OSDs page', () => { @@ -96,4 +84,22 @@ describe('when cluster creation is completed', () => { services.checkExist(serviceName, true); }); }); + + describe('Host actions', () => { + beforeEach(() => { + hosts.navigateTo(); + }); + + it('should force maintenance and exit', { retries: 1 }, () => { + hosts.maintenance(hostnames[3], true, true); + }); + + it('should drain, remove and add the host back', () => { + hosts.drain(hostnames[1]); + hosts.remove(hostnames[1]); + hosts.navigateTo('add'); + hosts.add(hostnames[1]); + hosts.checkExist(hostnames[1], true); + }); + }); }); -- 2.39.5