]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts
589cbaa904c23ddc7f6e93ed2a3ea5b789775ca0
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / orchestrator / workflow / 06-cluster-check.e2e-spec.ts
1 /* tslint:disable*/
2 import { Input, ManagerModulesPageHelper } from '../../cluster/mgr-modules.po';
3 import { CreateClusterWizardHelper } from '../../cluster/create-cluster.po';
4 import { HostsPageHelper } from '../../cluster/hosts.po';
5 import { ServicesPageHelper } from '../../cluster/services.po';
6 /* tslint:enable*/
7
8 describe('when cluster creation is completed', () => {
9 const createCluster = new CreateClusterWizardHelper();
10 const services = new ServicesPageHelper();
11 const hosts = new HostsPageHelper();
12 const mgrmodules = new ManagerModulesPageHelper();
13
14 const hostnames = ['ceph-node-00', 'ceph-node-01', 'ceph-node-02', 'ceph-node-03'];
15
16 beforeEach(() => {
17 cy.login();
18 Cypress.Cookies.preserveOnce('token');
19 });
20
21 it('should redirect to dashboard landing page after cluster creation', () => {
22 createCluster.navigateTo();
23 createCluster.createCluster();
24
25 cy.get('.nav-link').contains('Review').click();
26 cy.get('button[aria-label="Next"]').click();
27 cy.get('cd-dashboard').should('exist');
28 });
29
30 describe('Hosts page', () => {
31 beforeEach(() => {
32 hosts.navigateTo();
33 });
34
35 it('should check if monitoring stacks are running on the root host', () => {
36 const monitoringStack = ['alertmanager', 'grafana', 'node-exporter', 'prometheus'];
37 hosts.clickTab('cd-host-details', 'ceph-node-00', 'Daemons');
38 for (const daemon of monitoringStack) {
39 cy.get('cd-host-details').within(() => {
40 services.checkServiceStatus(daemon);
41 });
42 }
43 });
44
45 // avoid creating node-exporter on the newly added host
46 // to favour the host draining process
47 it('should reduce the count for node-exporter', () => {
48 services.editService('node-exporter', '3');
49 });
50
51 // grafana ip address is set to the fqdn by default.
52 // kcli is not working with that, so setting the IP manually.
53 it('should change ip address of grafana', { retries: 2 }, () => {
54 const dashboardArr: Input[] = [
55 {
56 id: 'GRAFANA_API_URL',
57 newValue: 'https://192.168.100.100:3000',
58 oldValue: ''
59 }
60 ];
61 mgrmodules.editMgrModule('dashboard', dashboardArr);
62 });
63
64 it('should add one more host', () => {
65 hosts.navigateTo('add');
66 hosts.add(hostnames[3]);
67 hosts.checkExist(hostnames[3], true);
68 });
69
70 it('should have removed "_no_schedule" label', () => {
71 for (const hostname of hostnames) {
72 hosts.checkLabelExists(hostname, ['_no_schedule'], false);
73 }
74 });
75
76 it('should display inventory', () => {
77 hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
78 cy.get('cd-host-details').within(() => {
79 hosts.getTableCount('total').should('be.gte', 0);
80 });
81 });
82
83 it('should display daemons', () => {
84 hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
85 cy.get('cd-host-details').within(() => {
86 hosts.getTableCount('total').should('be.gte', 0);
87 });
88 });
89
90 it('should check if mon daemon is running on all hosts', () => {
91 for (const hostname of hostnames) {
92 hosts.clickTab('cd-host-details', hostname, 'Daemons');
93 cy.get('cd-host-details').within(() => {
94 services.checkServiceStatus('mon');
95 });
96 }
97 });
98 });
99 });