]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: dashboard cephadm e2e improvement
authorNizamudeen A <nia@redhat.com>
Fri, 24 Dec 2021 05:39:37 +0000 (11:09 +0530)
committerNizamudeen A <nia@redhat.com>
Wed, 5 Jan 2022 14:18:29 +0000 (19:48 +0530)
Fixes: https://tracker.ceph.com/issues/53742
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 26f86f6cd32fc86297e250472e3205d4d65744fb)

src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts

index aec174a99cdba26205b131dd82c36b0a2f1cbcbb..266983df155b90028661adaffdb68b1025eb9ad4 100644 (file)
@@ -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');
     });
   });
 });
index 46cd5fa19c9f121d5e43e010a320d24ceb089074..633d9733c99b5bad73c778bae3f3facaf5496c10 100644 (file)
@@ -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);
+    });
+  });
 });