Skip to content

Commit ff5b20f

Browse files
committed
[HAL-2043] Add tests for SSL Context parameters for JGroups subsystem
1 parent 1f07134 commit ff5b20f

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* Check that SSL attributes in JGroups are shown as expected
3+
*/
4+
describe("TESTS: JGroups => SSL configuration", () => {
5+
let managementEndpoint: string;
6+
7+
/**
8+
* Start server with standalone-ha-insecure.xml
9+
*/
10+
before(function () {
11+
cy.startWildflyContainerHa().then((result) => {
12+
managementEndpoint = result as string;
13+
});
14+
});
15+
16+
/**
17+
* stop server
18+
*/
19+
after(() => {
20+
cy.task("stop:containers");
21+
});
22+
23+
/**
24+
* Check that SSL Context attributes are shown in TCP transport settings
25+
*/
26+
it("TCP test", () => {
27+
cy.navigateTo(managementEndpoint, "jgroups");
28+
cy.get('#jgroups-stack-item a.clickable').click();
29+
cy.get('#jgroups-stack-table')
30+
.contains('tr', 'tcp')
31+
.contains('button', 'Transport')
32+
.click();
33+
cy.get('#transport-form-links')
34+
.find('a[data-operation="edit"]')
35+
.should('be.visible')
36+
.click();
37+
cy.get('[data-form-item-group="transport-form-client-ssl-context-editing"]')
38+
.should('exist')
39+
.within(() => {
40+
cy.get('label').should('contain.text', 'Client SSL Context');
41+
cy.get('input').should('have.attr', 'type', 'password');
42+
});
43+
cy.get('[data-form-item-group="transport-form-server-ssl-context-editing"]')
44+
.should('exist')
45+
.within(() => {
46+
cy.get('label').should('contain.text', 'Server SSL Context');
47+
cy.get('input').should('have.attr', 'type', 'password');
48+
});
49+
});
50+
51+
/**
52+
* Check that SSL Context attributes are not shown in UDP transport settings
53+
*/
54+
it("UDP test", () => {
55+
cy.navigateTo(managementEndpoint, "jgroups");
56+
cy.get('#jgroups-stack-item a.clickable').click();
57+
cy.get('#jgroups-stack-table')
58+
.contains('tr', 'udp')
59+
.contains('button', 'Transport')
60+
.click();
61+
cy.get('#transport-form-links')
62+
.find('a[data-operation="edit"]')
63+
.should('be.visible')
64+
.click();
65+
cy.get('[data-form-item-group="transport-form-client-ssl-context-editing"]')
66+
.should('not.exist');
67+
cy.get('[data-form-item-group="transport-form-server-ssl-context-editing"]')
68+
.should('not.exist');
69+
});
70+
});

packages/testsuite/cypress/support/containers-utils.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ Cypress.Commands.add("startWildflyContainerSecured", () => {
2525
);
2626
});
2727

28+
Cypress.Commands.add("startWildflyContainerHa", () => {
29+
return cy.task(
30+
"start:wildfly:container",
31+
{
32+
name: Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_"),
33+
configuration: "standalone-ha-insecure.xml",
34+
useNetworkHostMode: true,
35+
},
36+
{ timeout: 240_000 },
37+
);
38+
});
39+
2840
Cypress.Commands.add("startKeycloakContainer", () => {
2941
return cy.task("start:keycloak:container", {
3042
name: `keycloak_${Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_")}`,
@@ -67,6 +79,16 @@ declare global {
6779
*
6880
*/
6981
startWildflyContainerSecured(): Chainable<unknown>;
82+
/**
83+
* Start a Wildfly container with standalone-ha-incsecure.xml configuration. This command is could be executed in before method of the test cases/specifications.
84+
* Unsecured management interface is used and web console doesn't require any authentication.
85+
*
86+
* @param options.useNetworkHostMode - Whether to use network host mode
87+
* @param options.configuration - Configuration file to use (default: standalone-insecure.xml)
88+
*
89+
* @category Containers util
90+
*/
91+
startWildflyContainerHa(): Chainable<unknown>;
7092
/**
7193
* Start a Keycloak container. This command typically needs to be executed in `before` method of a test spec.
7294
*

0 commit comments

Comments
 (0)