diff --git a/test/MODCLUSTER-640/testit.sh b/test/MODCLUSTER-640/testit.sh index 4532b90fa..8fb26a947 100755 --- a/test/MODCLUSTER-640/testit.sh +++ b/test/MODCLUSTER-640/testit.sh @@ -29,12 +29,12 @@ docker cp MODCLUSTER-640/webapp1 tomcat2:/usr/local/tomcat/webapps/webapp1 sleep 12 # test the URL -code=$(/usr/bin/curl -o /dev/null -s -m 20 --write-out '%{http_code}' http://localhost:8000/webapp1/index.html) +code=$(/usr/bin/curl -o /dev/null -s -m 20 --write-out '%{http_code}' http://localhost:6666/webapp1/index.html) if [ "${code}" != "200" ]; then - echo "nocanon test failed, we get ${code} on http://localhost:8000/webapp1/index.html" + echo "nocanon test failed, we get ${code} on http://localhost:6666/webapp1/index.html" exit 1 fi -curl -v -m 20 "http://localhost:8000/webapp1/jsr%3aroot/toto" | grep "jsr:root" +curl -v -m 20 "http://localhost:6666/webapp1/jsr%3aroot/toto" | grep "jsr:root" if [ $? -eq 0 ]; then echo "nocanon test failed, we get \"jsr:root\"!!!" exit 1 @@ -49,12 +49,12 @@ docker exec MODCLUSTER-640 /usr/local/apache2/bin/apachectl restart tomcat_wait_for_n_nodes 2 # test the URL -code=$(/usr/bin/curl -o /dev/null -s -m 20 --write-out '%{http_code}' http://localhost:8000/webapp1/index.html) +code=$(/usr/bin/curl -o /dev/null -s -m 20 --write-out '%{http_code}' http://localhost:6666/webapp1/index.html) if [ "${code}" != "200" ]; then - echo "nocanon test failed, we get ${code} on http://localhost:8000/webapp1/index.html" + echo "nocanon test failed, we get ${code} on http://localhost:6666/webapp1/index.html" exit 1 fi -curl -v -m 20 "http://localhost:8000/webapp1/jsr%3aroot/toto" | grep "jsr:root" +curl -v -m 20 "http://localhost:6666/webapp1/jsr%3aroot/toto" | grep "jsr:root" if [ $? -ne 0 ]; then echo "NO nocanon test failed, we don't get \"jsr:root\"!!!" exit 1 @@ -68,12 +68,12 @@ docker exec MODCLUSTER-640 /usr/local/apache2/bin/apachectl restart tomcat_wait_for_n_nodes 2 # test the URL -code=$(/usr/bin/curl -o /dev/null -s -m 20 --write-out '%{http_code}' http://localhost:8000/webapp1/index.html) +code=$(/usr/bin/curl -o /dev/null -s -m 20 --write-out '%{http_code}' http://localhost:6666/webapp1/index.html) if [ "${code}" != "200" ]; then - echo "nocanon test failed, we get ${code} on http://localhost:8000/webapp1/index.html" + echo "nocanon test failed, we get ${code} on http://localhost:6666/webapp1/index.html" exit 1 fi -curl -v -m 20 "http://localhost:8000/webapp1/jsr%3aroot/toto" | grep "jsr:root" +curl -v -m 20 "http://localhost:6666/webapp1/jsr%3aroot/toto" | grep "jsr:root" if [ $? -eq 0 ]; then echo "nocanon test failed, we get \"jsr:root\"!!!" tomcat_all_remove diff --git a/test/MODCLUSTER-785/testit.sh b/test/MODCLUSTER-785/testit.sh index 99ea7a1c8..5c26b812d 100755 --- a/test/MODCLUSTER-785/testit.sh +++ b/test/MODCLUSTER-785/testit.sh @@ -25,7 +25,7 @@ docker cp MODCLUSTER-785/app tomcat1:/usr/local/tomcat/webapps/app # check that the app is answering sleep 15 -curl -s -m 20 http://localhost:8000/app/status.jsp | grep "785" +curl -s -m 20 http://localhost:6666/app/status.jsp | grep "785" if [ $? -ne 0 ]; then echo "MODCLUSTER-785 Failed!" exit 1 @@ -36,8 +36,8 @@ tomcat_remove 1 # it return 503 # make sure we use enough workers -ab -c 10 -n100 http://localhost:8000/app/ -http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:8000/app/) +ab -c 10 -n100 http://localhost:6666/app/ +http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:6666/app/) if [ ${http_code} != 503 ]; then echo "MODCLUSTER-785 Failed! not 503 but ${http_code}" exit 1 @@ -57,12 +57,12 @@ sleep 15 # check that the app is answering # does it return 503 -http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:8000/app/status.jsp) +http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:6666/app/status.jsp) i=0 while true do sleep 1 - http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:8000/app/status.jsp) + http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:6666/app/status.jsp) if [ ${http_code} == 200 ]; then break fi @@ -86,7 +86,7 @@ i=0 while true do sleep 1 - http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:8000/app/status.jsp) + http_code=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:6666/app/status.jsp) if [ ${http_code} == 503 ]; then echo "MODCLUSTER-785 Failed! return 503" exit 1 diff --git a/test/basetests.sh b/test/basetests.sh index 33b92760e..be423dab5 100644 --- a/test/basetests.sh +++ b/test/basetests.sh @@ -20,12 +20,12 @@ sleep 12 # Basic 200 and 404 tests. echo "basic 200 and 404 tests" -CODE=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:8000/testapp/test.jsp) +CODE=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:6666/testapp/test.jsp) if [ ${CODE} != "200" ]; then echo "Failed can't reach webapp: ${CODE}" exit 1 fi -CODE=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:8000/testapp/toto.jsp) +CODE=$(curl -s -m 20 -o /dev/null -w "%{http_code}" http://localhost:6666/testapp/toto.jsp) if [ ${CODE} != "404" ]; then echo "Failed should get 404" exit 1 diff --git a/test/curlloop.sh b/test/curlloop.sh index 428d01339..7d33a2bc2 100644 --- a/test/curlloop.sh +++ b/test/curlloop.sh @@ -11,7 +11,7 @@ done while true do found=0 - http_code=$(curl -s -m 10 -o /dev/null -w "%{http_code}" http://localhost:8000/testapp/test.jsp) + http_code=$(curl -s -m 10 -o /dev/null -w "%{http_code}" http://localhost:6666/testapp/test.jsp) for var in "$@" do if [ "${http_code}" -eq "${var}" ]; then diff --git a/test/hangingtests.sh b/test/hangingtests.sh index 79cf22a30..0590019b6 100644 --- a/test/hangingtests.sh +++ b/test/hangingtests.sh @@ -43,7 +43,7 @@ echo "hanging a tomcat checking it is removed after a while no requests" tomcat_start_two sleep 10 tomcat_wait_for_n_nodes 2 || exit 1 -# curlloop.sh checks for http://localhost:8000/testapp/test.jsp +# curlloop.sh checks for http://localhost:6666/testapp/test.jsp docker cp testapp tomcat1:/usr/local/tomcat/webapps docker cp testapp tomcat2:/usr/local/tomcat/webapps diff --git a/test/httpd/Containerfile b/test/httpd/Containerfile index d4e42bd09..6620b5801 100644 --- a/test/httpd/Containerfile +++ b/test/httpd/Containerfile @@ -21,10 +21,11 @@ RUN ./configure --enable-proxy \ --enable-proxy-http \ --enable-proxy-ajp \ --enable-proxy-wstunnel \ - --enable-proxy-hcheck \ - --with-port=8000 + --enable-proxy-hcheck RUN make RUN make install +# we don't need any other listeners except the ones we define in our config files +RUN sed -i 's/\(Listen 80\)/#\1/' /usr/local/apache2/conf/httpd.conf # httpd is installed in /usr/local/apache2/bin/ # build and install mod_proxy_cluster *.so files. diff --git a/test/includes/common.sh b/test/includes/common.sh index 2253091fe..543d719fb 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -274,7 +274,7 @@ tomcat_remove() { # # Run a load test for the given tomcat$1 using ab tomcat_run_ab() { - ab -c10 -n10 http://localhost:8000/tomcat$1/test.jsp > /dev/null + ab -c10 -n10 http://localhost:6666/tomcat$1/test.jsp > /dev/null if [ $? -ne 0 ]; then echo "abtomcat: Loading tomcat$1 failed" exit 1 @@ -298,7 +298,7 @@ tomcat_all_run_ab() { # Test whether the webapp is working (responding) tomcat_test_app() { - CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" http://localhost:8000/tomcat$1/test.jsp) + CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" http://localhost:6666/tomcat$1/test.jsp) if [ ${CODE} != "200" ]; then echo "Failed can't reach tomcat$1: ${CODE}" exit 1 diff --git a/test/includes/src/main/gvy/org/jboss/modcluster/Main.gvy b/test/includes/src/main/gvy/org/jboss/modcluster/Main.gvy index 03408d686..36b91c168 100644 --- a/test/includes/src/main/gvy/org/jboss/modcluster/Main.gvy +++ b/test/includes/src/main/gvy/org/jboss/modcluster/Main.gvy @@ -3,7 +3,7 @@ package org.jboss.modcluster static void main(String[] args) { if ( args[0] == "WebSocketsTest" ) { t = new WebSocketsTest() - t.performWsTunnelTest("TEST", "ws://localhost:8000/websocket-hello-0.0.1/websocket/helloName", "Hello") + t.performWsTunnelTest("TEST", "ws://localhost:6666/websocket-hello-0.0.1/websocket/helloName", "Hello") } else { t = new WebHTTPTest() t.performHTTPTest() diff --git a/test/includes/src/main/gvy/org/jboss/modcluster/WebHTTPTest.gvy b/test/includes/src/main/gvy/org/jboss/modcluster/WebHTTPTest.gvy index 4d79b1df8..fc40d808a 100644 --- a/test/includes/src/main/gvy/org/jboss/modcluster/WebHTTPTest.gvy +++ b/test/includes/src/main/gvy/org/jboss/modcluster/WebHTTPTest.gvy @@ -19,11 +19,11 @@ class WebHTTPTest { Collection confirms = [] WebClient webClient = new WebClient() webClient.getOptions().setThrowExceptionOnFailingStatusCode(false) - WebRequest request1 = new WebRequest(new URL('http://localhost:8000/testapp1/test.jsp')) + WebRequest request1 = new WebRequest(new URL('http://localhost:6666/testapp1/test.jsp')) // request1.setCharset(StandardCharsets.UTF_8) WebResponse response1 = webClient.loadWebResponse(request1) assertTrue("Can't find test1!", response1.getStatusCode() == 200) - WebRequest request2 = new WebRequest(new URL('http://localhost:8000/testapp2/test.jsp')) + WebRequest request2 = new WebRequest(new URL('http://localhost:6666/testapp2/test.jsp')) // request2.setCharset(StandardCharsets.UTF_8) WebResponse response2 = webClient.loadWebResponse(request2) assertTrue("Can't find test2!", response2.getStatusCode() == 200) diff --git a/test/maintests.sh b/test/maintests.sh index 1508acbfa..59b9e4bc6 100644 --- a/test/maintests.sh +++ b/test/maintests.sh @@ -29,13 +29,13 @@ sleep 12 # Sticky (yes, there is only one app!!!) echotestlabel "sticky one app" -SESSIONCO=$(curl -v http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') +SESSIONCO=$(curl -v http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') if [ "${SESSIONCO}" == "" ];then echo "Failed no sessionid in curl output..." - curl -v http://localhost:8000/testapp/test.jsp + curl -v http://localhost:6666/testapp/test.jsp fi echo ${SESSIONCO} -NEWCO=$(curl -v --cookie "${SESSIONCO}" http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') +NEWCO=$(curl -v --cookie "${SESSIONCO}" http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') if [ "${NEWCO}" != "" ]; then echo "Failed not sticky received : ${NEWCO}???" exit 1 @@ -47,17 +47,17 @@ sleep 12 # Sticky (yes there are 2 apps now) echotestlabel "sticky 2 app" -SESSIONCO=$(curl -v http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') +SESSIONCO=$(curl -v http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') NODE=$(echo ${SESSIONCO} | awk -F = '{ print $2 }' | awk -F . '{ print $2 }') echo "first: ${SESSIONCO} node: ${NODE}" -NEWCO=$(curl -v http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') +NEWCO=$(curl -v http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') NEWNODE=$(echo ${NEWCO} | awk -F = '{ print $2 }' | awk -F . '{ print $2 }') echo "second: ${NEWCO} node: ${NEWNODE}" echo "Checking we can reach the 2 nodes" i=0 while [ "${NODE}" == "${NEWNODE}" ] do - NEWCO=$(curl -v http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') + NEWCO=$(curl -v http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') NEWNODE=$(echo ${NEWCO} | awk -F = '{ print $2 }' | awk -F . '{ print $2 }') i=$(expr $i + 1) if [ $i -gt 40 ]; then @@ -73,12 +73,12 @@ done echo "${i} try gives: ${NEWCO} node: ${NEWNODE}" # Still sticky -CO=$(curl -v --cookie "${SESSIONCO}" http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') +CO=$(curl -v --cookie "${SESSIONCO}" http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') if [ "${CO}" != "" ]; then echo "Failed not sticky received : ${CO}???" exit 1 fi -CO=$(curl -v --cookie "${NEWCO}" http://localhost:8000/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') +CO=$(curl -v --cookie "${NEWCO}" http://localhost:6666/testapp/test.jsp -m 20 -o /dev/null 2>&1 | grep Set-Cookie | awk '{ print $3 } ' | sed 's:;::') if [ "${CO}" != "" ]; then echo "Failed not sticky received : ${CO}???" exit 1 @@ -99,7 +99,7 @@ do echo "Done remaining tomcat still answering!" break fi - CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --cookie "${NEWCO}" http://localhost:8000/testapp/test.jsp) + CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --cookie "${NEWCO}" http://localhost:6666/testapp/test.jsp) if [ $i -eq 0 ]; then # stop the tomcat echo "tomcat${NAME} being stopped" @@ -109,7 +109,7 @@ do done if [ ${CODE} != "200" ]; then echo "Something was wrong... got: ${CODE}" - curl -v --cookie "${NEWCO}" -m 20 http://localhost:8000/testapp/test.jsp + curl -v --cookie "${NEWCO}" -m 20 http://localhost:6666/testapp/test.jsp exit 1 fi @@ -141,32 +141,32 @@ tomcat_wait_for_n_nodes 1 # Start the node. IMG=${IMG}-temporary tomcat_start 2 & tomcat_wait_for_n_nodes 2 || exit 1 -# Basically curl --header "Host: example.com" http://127.0.0.1:8000/test/test.jsp gives 200 +# Basically curl --header "Host: example.com" http://127.0.0.1:6666/test/test.jsp gives 200 # in fact the headers are: # X-Forwarded-For: 127.0.0.1 # X-Forwarded-Host: example.com # X-Forwarded-Server: fe80::faf4:935b:9dda:2adf # therefore don't forget ProxyPreserveHost On (otherwise UseAlias On failed...) # -CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: example.com" http://127.0.0.1:8000/test/test.jsp) +CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: example.com" http://127.0.0.1:6666/test/test.jsp) if [ ${CODE} != "200" ]; then echo "Failed can't rearch webapp at example.com: ${CODE}" exit 1 fi -# Basically curl --header "Host: localhost" http://127.0.0.1:8000/test/test.jsp gives 400 -CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: localhost" http://127.0.0.1:8000/test/test.jsp) +# Basically curl --header "Host: localhost" http://127.0.0.1:6666/test/test.jsp gives 400 +CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: localhost" http://127.0.0.1:6666/test/test.jsp) if [ ${CODE} != "404" ]; then echo "Failed should NOT rearch webapp at localhost: ${CODE}" exit 1 fi -# Same using localhost/testapp2 and curl --header "Host: localhost" http://127.0.0.1:8000/testapp2/test.jsp -CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: localhost" http://127.0.0.1:8000/testapp2/test.jsp) +# Same using localhost/testapp2 and curl --header "Host: localhost" http://127.0.0.1:6666/testapp2/test.jsp +CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: localhost" http://127.0.0.1:6666/testapp2/test.jsp) if [ ${CODE} != "200" ]; then echo "Failed can't rearch webapp at localhost: ${CODE}" exit 1 fi -# Basically curl --header "Host: example.com" http://127.0.0.1:8000/testapp2/test.jsp gives 400 -CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: example.com" http://127.0.0.1:8000/testapp2/test.jsp) +# Basically curl --header "Host: example.com" http://127.0.0.1:6666/testapp2/test.jsp gives 400 +CODE=$(curl -s -o /dev/null -m 20 -w "%{http_code}" --header "Host: example.com" http://127.0.0.1:6666/testapp2/test.jsp) if [ ${CODE} != "404" ]; then echo "Failed should NOT rearch webapp at localhost: ${CODE}" exit 1