Skip to content

Commit fa073b9

Browse files
Merge pull request #13463 from rabbitmq/apply-not-backported-changes-to-selenium
v4.0.x: apply not previously backported Selenium test suite changes
2 parents 880ca8f + 52ef55a commit fa073b9

File tree

10 files changed

+62
-12
lines changed

10 files changed

+62
-12
lines changed

selenium/bin/components/fakeportal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ start_fakeportal() {
4444
--env UAA_URL="${UAA_URL_FOR_FAKEPORTAL}" \
4545
--env CLIENT_ID="${CLIENT_ID}" \
4646
--env CLIENT_SECRET="${CLIENT_SECRET}" \
47+
--env NODE_EXTRA_CA_CERTS=/etc/uaa/ca_uaa_certificate.pem \
48+
-v ${TEST_CONFIG_DIR}/uaa:/etc/uaa \
4749
-v ${FAKEPORTAL_DIR}:/code/fakeportal \
4850
mocha-test:${mocha_test_tag} run fakeportal
4951

selenium/bin/components/uaa

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ start_uaa() {
3737
--detach \
3838
--name uaa \
3939
--net ${DOCKER_NETWORK} \
40-
--publish 8080:8080 \
41-
--mount "type=bind,source=$MOUNT_UAA_CONF_DIR,target=/uaa" \
40+
--publish 8443:8443 \
41+
-v ${MOUNT_UAA_CONF_DIR}:/uaa \
42+
-v ${UAA_CONFIG_DIR}/server.xml:/layers/paketo-buildpacks_apache-tomcat/catalina-base/conf/server.xml \
4243
--env UAA_CONFIG_PATH="/uaa" \
43-
--env JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom" \
44+
--env JAVA_OPTS="-Djava.security.policy=unlimited -Djava.security.egd=file:/dev/./urandom" \
4445
${UAA_DOCKER_IMAGE}
45-
46+
4647
wait_for_oidc_endpoint uaa $UAA_URL
4748
end "UAA is ready"
4849
}

selenium/bin/suite_template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ wait_for_oidc_endpoint() {
170170
wait_for_oidc_endpoint_local() {
171171
NAME=$1
172172
BASE_URL=$2
173-
CURL_ARGS="-L --fail "
173+
CURL_ARGS="-L -k --fail "
174174
DELAY_BETWEEN_ATTEMPTS=5
175175
if [[ $# -eq 3 ]]; then
176176
CURL_ARGS="$CURL_ARGS --cacert $3"
@@ -191,7 +191,7 @@ wait_for_oidc_endpoint_local() {
191191
wait_for_oidc_endpoint_docker() {
192192
NAME=$1
193193
BASE_URL=$2
194-
CURL_ARGS="-L --fail "
194+
CURL_ARGS="-L -k --fail "
195195
DOCKER_ARGS="--rm --net ${DOCKER_NETWORK} "
196196
DELAY_BETWEEN_ATTEMPTS=5
197197
if [[ $# -gt 2 ]]; then

selenium/fakeportal/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function access_token(id, secret) {
5858
console.log("Token => " + token)
5959
return token;
6060
} else {
61-
throw new Error(req.status + " : " + req.responseText);
61+
throw new Error(req.status + " : " + " : " +
62+
req.response + " : " + req.responseText)
6263
}
6364
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export FAKEPORTAL_URL=http://fakeportal:3000
22
export RABBITMQ_HOST_FOR_FAKEPORTAL=${RABBITMQ_HOST}
3-
export UAA_URL_FOR_FAKEPORTAL=http://uaa:8080
3+
export UAA_URL_FOR_FAKEPORTAL=https://uaa:8443

selenium/test/oauth/env.docker.uaa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export UAA_URL=http://uaa:8080
1+
export UAA_URL=https://uaa:8443
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export FAKEPORTAL_URL=http://localhost:3000
22
export RABBITMQ_HOST_FOR_FAKEPORTAL=localhost:15672
3-
export UAA_URL_FOR_FAKEPORTAL=http://host.docker.internal:8080
3+
export UAA_URL_FOR_FAKEPORTAL=https://uaa:8443

selenium/test/oauth/env.local.uaa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export UAA_URL=http://localhost:8080
1+
export UAA_URL=https://localhost:8443

selenium/test/oauth/uaa/server.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<Server port="-1">
3+
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
4+
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
5+
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
6+
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
7+
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
8+
<Service name="Catalina">
9+
<Connector class="org.apache.coyote.http11.Http11NioProtocol" protocol="HTTP/1.1" connectionTimeout="20000"
10+
scheme="https"
11+
port="8443"
12+
SSLEnabled="true"
13+
sslEnabledProtocols="TLSv1.2"
14+
ciphers="TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
15+
secure="true"
16+
clientAuth="false"
17+
sslProtocol="TLS"
18+
keystoreFile="/uaa/server_uaa.jks"
19+
keystoreType="PKCS12"
20+
keyAlias="server-uaa-tls"
21+
keystorePass="foobar"
22+
bindOnInit="false"/>
23+
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
24+
connectionTimeout="20000"
25+
port="8989"
26+
address="127.0.0.1"
27+
bindOnInit="true"/>
28+
<Engine name="Catalina" defaultHost="localhost">
29+
<Host name="localhost"
30+
appBase="webapps"
31+
unpackWARs="true"
32+
autoDeploy="false"
33+
failCtxIfServletStartFails="true">
34+
<Valve className="org.apache.catalina.valves.RemoteIpValve"
35+
remoteIpHeader="x-forwarded-for"
36+
protocolHeader="x-forwarded-proto"
37+
internalProxies="10\.\d{1,3}\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3}|169\.254\.\d{1,3}\.\d{1,3}|127\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.1[6-9]{1}\.\d{1,3}\.\d{1,3}|172\.2[0-9]{1}\.\d{1,3}\.\d{1,3}|172\.3[0-1]{1}\.\d{1,3}\.\d{1,3}"/>
38+
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
39+
prefix="localhost_access" suffix=".log" rotatable="false" pattern="%h %l %u %t &quot;%r&quot; %s %b"/>
40+
</Host>
41+
</Engine>
42+
</Service>
43+
</Server>

selenium/test/oauth/uaa/uaa.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
require_https: true
2+
https_port: 8443
3+
14
logging:
25
config: /uaa/log4j2.properties
36

@@ -214,4 +217,4 @@ cors:
214217
- GET
215218
- PUT
216219
- POST
217-
- DELETE
220+
- DELETE

0 commit comments

Comments
 (0)