-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E2e test deregistration cascading #1634
Changes from 9 commits
6b80421
4ca2be2
8a257c2
8166582
334494e
4342832
e342c32
99a9b43
c0c7e46
a7b6c77
fe7d617
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
context('Databases Overview', () => { | ||
before(() => { | ||
cy.visit('/databases'); | ||
cy.url().should('include', '/databases'); | ||
}); | ||
|
||
describe('Deregistration', () => { | ||
const hdqDatabase = { | ||
sid: 'HDQ', | ||
hanaPrimary: { | ||
name: 'vmhdbqas01', | ||
id: '99cf8a3a-48d6-57a4-b302-6e4482227ab6', | ||
}, | ||
}; | ||
|
||
it(`should not display DB ${hdqDatabase.sid} after deregistering the primary instance`, () => { | ||
cy.deregisterHost(hdqDatabase.hanaPrimary.id); | ||
cy.contains(hdqDatabase.sid).should('not.exist'); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,4 +128,14 @@ context('HANA database details', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('Deregistration', () => { | ||
before(() => { | ||
cy.deregisterHost(attachedHosts[0].AgentId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move to the test |
||
}); | ||
|
||
it(`should not include host ${attachedHosts[0].Name} in the list of hosts`, () => { | ||
cy.contains(attachedHosts[0].Name).should('not.exist'); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,4 +132,21 @@ context('SAP system details', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('Deregistration', () => { | ||
const hostToDeregister = { | ||
name: 'vmnwdev02', | ||
id: 'fb2c6b8a-9915-5969-a6b7-8b5a42de1971', | ||
}; | ||
|
||
before(() => { | ||
cy.visit(`/sap_systems/${selectedSystem.Id}`); | ||
cy.url().should('include', `/sap_systems/${selectedSystem.Id}`); | ||
}); | ||
|
||
it(`should not include ${hostToDeregister.name} in the list of hosts`, () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could improve this test (or add a new) to check that the SAP instance belonging to this SAP system is not there. @abravosuse reported some potential issue on this? |
||
cy.deregisterHost(hostToDeregister.id); | ||
cy.contains(hostToDeregister.name).should('not.exist'); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,4 +291,52 @@ context('SAP Systems Overview', () => { | |
cy.get('table.table-fixed').should('not.contain', 'DAA'); | ||
}); | ||
}); | ||
|
||
describe('Deregistration', () => { | ||
const sapSystemNwp = { | ||
sid: 'NWP', | ||
hanaPrimary: { | ||
name: 'vmhdbprd01', | ||
id: '9cd46919-5f19-59aa-993e-cf3736c71053', | ||
}, | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I miss a test here where we check that the SAP system is deregistered when the ASCS or PAS instances are deregistered |
||
const sapSystemNwq = { | ||
sid: 'NWQ', | ||
messageserverInstance: { | ||
name: 'vmnwqas01', | ||
id: '25677e37-fd33-5005-896c-9275b1284534', | ||
}, | ||
}; | ||
|
||
const sapSystemNwd = { | ||
sid: 'NWD', | ||
applicationInstances: [ | ||
{ | ||
name: 'vmnwdev03', | ||
id: '9a3ec76a-dd4f-5013-9cf0-5eb4cf89898f', | ||
}, | ||
{ | ||
name: 'vmnwdev04', | ||
id: '1b0e9297-97dd-55d6-9874-8efde4d84c90', | ||
}, | ||
], | ||
}; | ||
|
||
it(`should not display SAP System ${sapSystemNwp.sid} after deregistering the primary instance`, () => { | ||
arbulu89 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cy.deregisterHost(sapSystemNwp.hanaPrimary.id); | ||
cy.contains(sapSystemNwp.sid).should('not.exist'); | ||
}); | ||
|
||
it(`should not display SAP System ${sapSystemNwq.sid} after deregistering the instance running the messageserver`, () => { | ||
cy.deregisterHost(sapSystemNwq.messageserverInstance.id); | ||
cy.contains(sapSystemNwq.sid).should('not.exist'); | ||
}); | ||
|
||
it(`should not display SAP System ${sapSystemNwd.sid} after deregistering both application instances`, () => { | ||
cy.deregisterHost(sapSystemNwd.applicationInstances[0].id); | ||
cy.deregisterHost(sapSystemNwd.applicationInstances[1].id); | ||
cy.contains(sapSystemNwd.sid).should('not.exist'); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,3 +212,26 @@ Cypress.Commands.add('requestChecksExecution', (clusterId) => { | |
}); | ||
}); | ||
}); | ||
|
||
Cypress.Commands.add('deregisterHost', (hostId) => { | ||
const [webAPIHost, webAPIPort] = [ | ||
Cypress.env('web_api_host'), | ||
Cypress.env('web_api_port'), | ||
]; | ||
|
||
const headers = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could have this headers in a default constant. |
||
'Content-Type': 'application/json;charset=UTF-8', | ||
}; | ||
|
||
apiLogin().then(({ accessToken }) => { | ||
const url = `http://${webAPIHost}:${webAPIPort}/api/v1/hosts/${hostId}`; | ||
cy.request({ | ||
method: 'DELETE', | ||
url: url, | ||
headers: headers, | ||
auth: { | ||
bearer: accessToken, | ||
}, | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deregisterHost
move to the test