]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
94cb36c1929e339b8e83d71cced5c929e4be5aa1
[ceph.git] /
1 /* tslint:disable*/
2 import { CreateClusterWizardHelper } from '../../cluster/create-cluster.po';
3 import { HostsPageHelper } from '../../cluster/hosts.po';
4 import { ServicesPageHelper } from '../../cluster/services.po';
5 /* tslint:enable*/
6
7 describe('when cluster creation is completed', () => {
8   const createCluster = new CreateClusterWizardHelper();
9   const services = new ServicesPageHelper();
10   const hosts = new HostsPageHelper();
11
12   const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];
13
14   beforeEach(() => {
15     cy.login();
16     Cypress.Cookies.preserveOnce('token');
17   });
18
19   it('should redirect to dashboard landing page after cluster creation', () => {
20     createCluster.navigateTo();
21     createCluster.createCluster();
22
23     // Explicitly skip OSD Creation Step so that it prevents from
24     // deploying OSDs to the hosts automatically.
25     cy.get('.nav-link').contains('Create OSDs').click();
26     cy.get('button[aria-label="Skip this step"]').click();
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 add one more host', () => {
39       hosts.navigateTo('add');
40       hosts.add(hostnames[3]);
41       hosts.checkExist(hostnames[3], true);
42     });
43
44     it('should check if monitoring stacks are running on the root host', { retries: 2 }, () => {
45       const monitoringStack = ['alertmanager', 'grafana', 'node-exporter', 'prometheus'];
46       hosts.clickTab('cd-host-details', 'ceph-node-00', 'Daemons');
47       for (const daemon of monitoringStack) {
48         cy.get('cd-host-details').within(() => {
49           services.checkServiceStatus(daemon);
50         });
51       }
52     });
53
54     it('should have removed "_no_schedule" label', () => {
55       for (const hostname of hostnames) {
56         hosts.checkLabelExists(hostname, ['_no_schedule'], false);
57       }
58     });
59
60     it('should display inventory', () => {
61       hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
62       cy.get('cd-host-details').within(() => {
63         hosts.getTableCount('total').should('be.gte', 0);
64       });
65     });
66
67     it('should display daemons', () => {
68       hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
69       cy.get('cd-host-details').within(() => {
70         hosts.getTableCount('total').should('be.gte', 0);
71       });
72     });
73
74     it('should check if mon daemon is running on all hosts', () => {
75       for (const hostname of hostnames) {
76         hosts.clickTab('cd-host-details', hostname, 'Daemons');
77         cy.get('cd-host-details').within(() => {
78           services.checkServiceStatus('mon');
79         });
80       }
81     });
82   });
83 });