From: Avan Thakkar Date: Tue, 1 Feb 2022 13:02:42 +0000 (+0530) Subject: mgr/dashboard: add snmp-gateway service e2e tests X-Git-Tag: v16.2.8~207^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f40c90f7dd8321701810de76b535332b20a4613c;p=ceph.git mgr/dashboard: add snmp-gateway service e2e tests Fixes: https://tracker.ceph.com/issues/54034 Signed-off-by: Avan Thakkar (cherry picked from commit 76dcf6a881f343bb3d93259701e57ccb572f94e8) --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts index 07bd3b58b8b7e..6987b6f20f52e 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts @@ -37,7 +37,7 @@ export class ServicesPageHelper extends PageHelper { }); } - addService(serviceType: string, exist?: boolean, count = '1') { + addService(serviceType: string, exist?: boolean, count = '1', snmpVersion?: string) { cy.get(`${this.pages.create.id}`).within(() => { this.selectServiceType(serviceType); switch (serviceType) { @@ -59,13 +59,33 @@ export class ServicesPageHelper extends PageHelper { cy.get('#count').type(count); break; + case 'snmp-gateway': + this.selectOption('snmp_version', snmpVersion); + cy.get('#snmp_destination').type('192.168.0.1:8443'); + if (snmpVersion === 'V2c') { + cy.get('#snmp_community').type('public'); + } else { + cy.get('#engine_id').type('800C53F00000'); + this.selectOption('auth_protocol', 'SHA'); + this.selectOption('privacy_protocol', 'DES'); + + // Credentials + cy.get('#snmp_v3_auth_username').type('test'); + cy.get('#snmp_v3_auth_password').type('testpass'); + cy.get('#snmp_v3_priv_password').type('testencrypt'); + } + break; + default: cy.get('#service_id').type('test'); cy.get('#count').type(count); break; } - - cy.get('cd-submit-button').click(); + if (serviceType === 'snmp-gateway') { + cy.get('cd-submit-button').dblclick(); + } else { + cy.get('cd-submit-button').click(); + } }); if (exist) { cy.get('#service_id').should('have.class', 'ng-invalid'); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/09-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/09-services.e2e-spec.ts index 9b49c75aca6a3..0c1eecb2b8a52 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/09-services.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/09-services.e2e-spec.ts @@ -24,4 +24,30 @@ describe('Services page', () => { services.deleteService('mds.test'); }); + + it('should create and delete snmp-gateway service with version V2c', () => { + services.navigateTo('create'); + services.addService('snmp-gateway', false, '1', 'V2c'); + services.checkExist('snmp-gateway', true); + + services.clickServiceTab('snmp-gateway', 'Details'); + cy.get('cd-service-details').within(() => { + services.checkServiceStatus('snmp-gateway'); + }); + + services.deleteService('snmp-gateway'); + }); + + it('should create and delete snmp-gateway service with version V3', () => { + services.navigateTo('create'); + services.addService('snmp-gateway', false, '1', 'V3'); + services.checkExist('snmp-gateway', true); + + services.clickServiceTab('snmp-gateway', 'Details'); + cy.get('cd-service-details').within(() => { + services.checkServiceStatus('snmp-gateway'); + }); + + services.deleteService('snmp-gateway'); + }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html index 8e4623be367f1..e1e8317e9bf65 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html @@ -449,7 +449,6 @@