Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Check that SSL attributes in JGroups are shown as expected
*/
describe("TESTS: JGroups => SSL configuration", () => {
let managementEndpoint: string;

/**
* Start server with standalone-ha-insecure.xml
*/
before(function () {
cy.startWildflyContainerHa().then((result) => {
managementEndpoint = result as string;
});
});

/**
* stop server
*/
after(() => {
cy.task("stop:containers");
});

/**
* Check that SSL Context attributes are shown in TCP transport settings
*/
it("TCP test", () => {
cy.navigateTo(managementEndpoint, "jgroups");
cy.get('#jgroups-stack-item a.clickable').click();
cy.get('#jgroups-stack-table')
.contains('tr', 'tcp')
.contains('button', 'Transport')
.click();
cy.get('#transport-form-links')
.find('a[data-operation="edit"]')
.should('be.visible')
.click();
cy.get('[data-form-item-group="transport-form-client-ssl-context-editing"]')
.should('exist')
.within(() => {
cy.get('label').should('contain.text', 'Client SSL Context');
cy.get('input').should('have.attr', 'type', 'password');
});
cy.get('[data-form-item-group="transport-form-server-ssl-context-editing"]')
.should('exist')
.within(() => {
cy.get('label').should('contain.text', 'Server SSL Context');
cy.get('input').should('have.attr', 'type', 'password');
});
});

/**
* Check that SSL Context attributes are not shown in UDP transport settings
*/
it("UDP test", () => {
cy.navigateTo(managementEndpoint, "jgroups");
cy.get('#jgroups-stack-item a.clickable').click();
cy.get('#jgroups-stack-table')
.contains('tr', 'udp')
.contains('button', 'Transport')
.click();
cy.get('#transport-form-links')
.find('a[data-operation="edit"]')
.should('be.visible')
.click();
cy.get('[data-form-item-group="transport-form-client-ssl-context-editing"]')
.should('not.exist');
cy.get('[data-form-item-group="transport-form-server-ssl-context-editing"]')
.should('not.exist');
});
});
22 changes: 22 additions & 0 deletions packages/testsuite/cypress/support/containers-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ Cypress.Commands.add("startWildflyContainerSecured", () => {
);
});

Cypress.Commands.add("startWildflyContainerHa", () => {
return cy.task(
"start:wildfly:container",
{
name: Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_"),
configuration: "standalone-ha-insecure.xml",
useNetworkHostMode: true,
},
{ timeout: 240_000 },
);
});

Cypress.Commands.add("startKeycloakContainer", () => {
return cy.task("start:keycloak:container", {
name: `keycloak_${Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_")}`,
Expand Down Expand Up @@ -67,6 +79,16 @@ declare global {
*
*/
startWildflyContainerSecured(): Chainable<unknown>;
/**
* Start a Wildfly container with standalone-ha-incsecure.xml configuration. This command is could be executed in before method of the test cases/specifications.
* Unsecured management interface is used and web console doesn't require any authentication.
*
* @param options.useNetworkHostMode - Whether to use network host mode
* @param options.configuration - Configuration file to use (default: standalone-insecure.xml)
*
* @category Containers util
*/
startWildflyContainerHa(): Chainable<unknown>;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need method like this. you can set different standalone.xml in parameter of the function. startWildflyContainer like this https://github.com/hal/berg/blob/main/packages/testsuite/cypress/e2e/opentelemetry/test-configuration-subsystem-opentelemetry.cy.ts#L20

You saw a startWildflyContainerSecured which is similar. You could think we need similar method like this for HA. But the reason why we created the secured variant are OIDC test. We need different networking for it. The wildfly and keycloak are started and as services on "local" server. NonSecured variant have a it own network and IP so you are using the container IP which have exposed some services you need. like UI, management API etc.

If it is only about different "standalone.xml" please set it as a parameter without a new method.

/**
* Start a Keycloak container. This command typically needs to be executed in `before` method of a test spec.
*
Expand Down
Loading