]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
ff6017559f2e6ff9013a5bbdecb06696000fedc4
[ceph.git] /
1 import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
2 import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
3 import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
4 import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
5
6 describe('when cluster creation is completed', () => {
7   const createCluster = new CreateClusterWizardHelper();
8   const services = new ServicesPageHelper();
9   const hosts = new HostsPageHelper();
10
11   const serviceName = 'rgw.foo';
12   const hostnames = [
13     'ceph-node-00.cephlab.com',
14     'ceph-node-01.cephlab.com',
15     'ceph-node-02.cephlab.com',
16     'ceph-node-03.cephlab.com'
17   ];
18
19   beforeEach(() => {
20     cy.login();
21     Cypress.Cookies.preserveOnce('token');
22   });
23
24   it('should redirect to dashboard landing page after cluster creation', () => {
25     createCluster.navigateTo();
26     createCluster.createCluster();
27
28     cy.get('.nav-link').contains('Review').click();
29     cy.get('button[aria-label="Next"]').click();
30     cy.get('cd-dashboard').should('exist');
31   });
32
33   describe('Hosts page', () => {
34     beforeEach(() => {
35       hosts.navigateTo();
36     });
37
38     it('should have removed "_no_schedule" label', () => {
39       for (const hostname of hostnames) {
40         hosts.checkLabelExists(hostname, ['_no_schedule'], false);
41       }
42     });
43
44     it('should display inventory', () => {
45       hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
46       cy.get('cd-host-details').within(() => {
47         hosts.getTableCount('total').should('be.gte', 0);
48       });
49     });
50
51     it('should display daemons', () => {
52       hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
53       cy.get('cd-host-details').within(() => {
54         hosts.getTableCount('total').should('be.gte', 0);
55       });
56     });
57
58     it('should check if mon daemon is running on all hosts', () => {
59       for (const hostname of hostnames) {
60         hosts.clickTab('cd-host-details', hostname, 'Daemons');
61         cy.get('cd-host-details').within(() => {
62           services.checkServiceStatus('mon');
63         });
64       }
65     });
66   });
67
68   describe('OSDs page', () => {
69     const osds = new OSDsPageHelper();
70
71     beforeEach(() => {
72       osds.navigateTo();
73     });
74
75     it('should check if osds are created', { retries: 1 }, () => {
76       osds.getTableCount('total').should('be.gte', 2);
77     });
78   });
79
80   describe('Services page', () => {
81     beforeEach(() => {
82       services.navigateTo();
83     });
84
85     it('should check if services are created', () => {
86       services.checkExist(serviceName, true);
87     });
88   });
89
90   describe('Host actions', () => {
91     beforeEach(() => {
92       hosts.navigateTo();
93     });
94
95     it('should check if rgw daemon is running', () => {
96       hosts.clickTab('cd-host-details', hostnames[3], 'Daemons');
97       cy.get('cd-host-details').within(() => {
98         services.checkServiceStatus('rgw');
99       });
100     });
101
102     it('should force maintenance and exit', { retries: 1 }, () => {
103       hosts.maintenance(hostnames[3], true, true);
104     });
105
106     it('should drain, remove and add the host back', () => {
107       hosts.drain(hostnames[1]);
108       hosts.remove(hostnames[1]);
109       hosts.navigateTo('add');
110       hosts.add(hostnames[1]);
111       hosts.checkExist(hostnames[1], true);
112     });
113   });
114 });