diff --git a/test/Dockerfile b/test/Dockerfile index 40b72bd31..3955f9179 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -2,7 +2,7 @@ FROM tomcat:8.5 WORKDIR /usr/local/tomcat -COPY target/*.jar ./lib/ +COPY target/dependency/*.jar ./lib/ COPY ./files/server.xml ./conf/ COPY ./files/context.xml ./conf/ COPY ./files/start.sh ./ diff --git a/test/JBCS-1236/testit.sh b/test/JBCS-1236/testit.sh index 87aac1839..dd7d82586 100644 --- a/test/JBCS-1236/testit.sh +++ b/test/JBCS-1236/testit.sh @@ -75,7 +75,7 @@ singlecycle() { echo "singlecycle: Testing tomcat$1" R=$1 if [ "X$2" = "Xuseran" ]; then - R=$(echo $((1 + $RANDOM % 10))) + R=$(expr 1 + $RANDOM % 10 + 10) R=$(expr $R + 2) # TODO tomcat_start $1 $R || clean_and_exit @@ -207,49 +207,21 @@ runjbcs1236() { fi # cycle the tomcats runtomcatbatch - echo "##########" - echo "After tomcatbacth" - echo "Nodes are:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" - sleep 20 - if [ $? -ne 0 ]; then + if [ $? -ne 0 ]; then echo "runtomcatbatch: runjbcs1236 Failed!" clean_and_exit fi tomcat_shutdown 2 0 - echo "##########" - echo "After tomcat2 shutdown" - echo "Nodes are:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" - sleep 20 - tomcat_wait_for_n_nodes 2 if [ $? -ne 0 ]; then echo "tomcat_wait_for_n_nodes 2: runjbcs1236 Failed!" clean_and_exit fi tomcat_remove 2 - - echo "##########" - echo "Sleep I before starting tomcat5" - echo "Nodes are:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" - sleep 20 - tomcat_start 5 0 - echo "##########" - echo "After tomcat5 is started" - echo "Nodes are:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" - sleep 20 - tomcat_wait_for_n_nodes 3 if [ $? -ne 0 ]; then echo "tomcat_wait_for_n_nodes 3: runjbcs1236 Failed!" @@ -286,20 +258,12 @@ runjbcs1236() { clean_and_exit fi - echo "##########" - echo "Sleep II before shutting down tomcat5" - echo "Nodes are:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" sleep 20 # we have 5 3 4 2 in shared memory # if something was wrong 2 points to 5 tomcat_shutdown 5 0 - echo "##########" - echo "Nodes after shutdown:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" + tomcat_wait_for_n_nodes 3 if [ $? -ne 0 ]; then echo "tomcat_wait_for_n_nodes 3: runjbcs1236 Failed!" @@ -307,11 +271,6 @@ runjbcs1236() { fi tomcat_remove 5 - echo "##########" - echo "After tomcat5 removal before 2, 3, 4 tests; NODEs are:" - for d in $(docker ps --format {{.Names}}); do echo " $d"; done - echo "##########" - tomcat_test_app 2 if [ $? -ne 0 ]; then echo "tomcat_test_app 2: runjbcs1236 Failed!" diff --git a/test/files/start.sh b/test/files/start.sh index 80cbe8e11..eeb7f3d37 100644 --- a/test/files/start.sh +++ b/test/files/start.sh @@ -47,7 +47,7 @@ fi sed -i "s/proxyport/${cluster_port}/" ./conf/server.xml sed -i "s/proxyaddress/127.0.0.1/" ./conf/server.xml -echo "jvm_route: ${jvm_route} and tomcat_port: ${tomcat_port}" +echo "jvm_route: ${jvm_route} and tomcat_port: ${tomcat_port} and tomcat_address: ${tomcat_address}" if [ ! -z ${jvm_route} ]; then sed -i "/" ./conf/server.xml fi diff --git a/test/includes/common.sh b/test/includes/common.sh index 7b1317d86..d47a40f57 100644 --- a/test/includes/common.sh +++ b/test/includes/common.sh @@ -252,7 +252,7 @@ tomcat_shutdown() { # Remove the docker image tomcat$1 # Note: To succesfully remove an image it needs to be stopped tomcat_remove() { - docker stop tomcat$i &> /dev/null + docker stop tomcat$1 &> /dev/null docker rm tomcat$1 }