diff --git a/packages/testsuite/cypress.config.ts b/packages/testsuite/cypress.config.ts index bb4d1aa65..b9db5b4e3 100644 --- a/packages/testsuite/cypress.config.ts +++ b/packages/testsuite/cypress.config.ts @@ -19,6 +19,11 @@ export default defineConfig({ "start:wildfly:container": ({ name, configuration, useNetworkHostMode }) => { return new Promise((resolve, reject) => { let portOffset = 0; + let wildflyCmdParameters = ["-c", configuration || "standalone-insecure.xml"]; + if (process.env.WILDFLY_STABILITY_LEVEL) { + wildflyCmdParameters.push("--stability=" + process.env.WILDFLY_STABILITY_LEVEL); + } + console.log(wildflyCmdParameters as String[]); const wildfly = new GenericContainer( process.env.WILDFLY_IMAGE || "quay.io/halconsole/wildfly-development:latest" ) @@ -35,16 +40,11 @@ export default defineConfig({ .withStartupTimeout(333000); if (useNetworkHostMode === true) { console.log("host mode"); + wildflyCmdParameters.push(`-Djboss.socket.binding.port-offset=${portOffset.toString()}`); findAPortNotInUse(8080, 8180) .then((freePort) => { portOffset = freePort - 8080; - wildfly - .withNetworkMode("host") - .withCommand([ - "-c", - configuration || "standalone-insecure.xml", - `-Djboss.socket.binding.port-offset=${portOffset.toString()}`, - ] as string[]); + wildfly.withNetworkMode("host").withCommand(wildflyCmdParameters as string[]); }) .catch((error) => { console.log(error); @@ -55,7 +55,7 @@ export default defineConfig({ .withNetworkMode(config.env.NETWORK_NAME as string) .withNetworkAliases("wildfly") .withExposedPorts(9990) - .withCommand(["-c", configuration || "standalone-insecure.xml"] as string[]); + .withCommand(wildflyCmdParameters as string[]); } wildfly .start() diff --git a/packages/testsuite/cypress/e2e/undertow/test-configuration-subsystem-undertow-ajp-listener.cy.ts b/packages/testsuite/cypress/e2e/undertow/test-configuration-subsystem-undertow-ajp-listener.cy.ts new file mode 100644 index 000000000..5aabf9819 --- /dev/null +++ b/packages/testsuite/cypress/e2e/undertow/test-configuration-subsystem-undertow-ajp-listener.cy.ts @@ -0,0 +1,68 @@ +describe("TESTS: Configuration => Subsystem => Undertow => Global settings", () => { + let managementEndpoint: string; + + const testValues = { + serverName: "default-server", + ajpListener: "test-ajp", + ajpSocketBindings: "ajp", + allowedReqAttrsPatternExpression: "${NON-EXISTING:value.*}", + allowedReqAttrsPatternResolved: "value.*", + }; + const address = ["subsystem", "undertow", "server", testValues.serverName, "ajp-listener", testValues.ajpListener]; + const serverSelectors = { + serverListenersItem: "#undertow-server-listener-item", + ajpListenerItem: "#undertow-server-ajp-listener-item", + }; + const ajpListenerPageSelectors = { + ajpListenersTableId: "undertow-server-ajp-listener-table", + }; + const ajpListenerForm = { + id: "undertow-server-ajp-listener-form", + allowedReqAttrsPattern: "allowed-request-attributes-pattern", + }; + + before(() => { + cy.startWildflyContainer() + .then((result) => { + managementEndpoint = result as string; + }) + .then(() => { + // create fixtures + cy.task("execute:cli", { + managementApi: managementEndpoint + "/management", + address: address, + operation: "add", + "socket-binding": testValues.ajpSocketBindings, + }); + }); + }); + + after(() => { + cy.task("stop:containers"); + }); + + beforeEach(() => { + cy.navigateTo(managementEndpoint, "undertow-server;name=default-server"); + // the form takes a brief moment to initialize + cy.wait(200); + cy.get(serverSelectors.serverListenersItem).click(); + cy.get(serverSelectors.ajpListenerItem).click(); + }); + + it("Test AJP Listener: allowed request attributes pattern", () => { + cy.selectInTable(ajpListenerPageSelectors.ajpListenersTableId, testValues.ajpListener); + + cy.editForm(ajpListenerForm.id); + cy.text(ajpListenerForm.id, ajpListenerForm.allowedReqAttrsPattern, testValues.allowedReqAttrsPatternExpression, { + parseSpecialCharSequences: false, + }); + cy.saveForm(ajpListenerForm.id); + cy.verifySuccess(); + cy.verifyAttributeAsExpression( + managementEndpoint, + ["subsystem", "undertow", "server", testValues.serverName, "ajp-listener", testValues.ajpListener], + ajpListenerForm.allowedReqAttrsPattern, + testValues.allowedReqAttrsPatternExpression + ); + }); +});