Skip to content

Use only port 6666 in tests #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions test/MODCLUSTER-640/testit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions test/MODCLUSTER-785/testit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/basetests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/curlloop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/hangingtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions test/httpd/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions test/includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/includes/src/main/gvy/org/jboss/modcluster/Main.gvy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class WebHTTPTest {
Collection<String> 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)
Expand Down
36 changes: 18 additions & 18 deletions test/maintests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down