Skip to content

Commit

Permalink
Fix typo in tests, revert prints, tweak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jajik committed Jul 18, 2023
1 parent 82afc69 commit c064cfa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 47 deletions.
2 changes: 1 addition & 1 deletion test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./
Expand Down
47 changes: 3 additions & 44 deletions test/JBCS-1236/testit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!"
Expand Down Expand Up @@ -286,32 +258,19 @@ 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!"
clean_and_exit
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!"
Expand Down
2 changes: 1 addition & 1 deletion test/files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "/<Engine name=\"Catalina\"/c\<Engine name=\"Catalina\" defaultHost=\"localhost\" jvmRoute=\"${jvm_route}\">" ./conf/server.xml
fi
Expand Down
2 changes: 1 addition & 1 deletion test/includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c064cfa

Please sign in to comment.