@@ -16,34 +16,62 @@ source $(dirname "$0")/test_base_functions.sh
1616# Set up Java to be used by the tomcat test
1717echo_setup
1818
19- git clone -q -b 1.6.x --single-branch https://github.com/apache/apr.git $TEST_HOME /tmp/apr
20- cd $TEST_HOME /tmp/apr
21- ./buildconf
22- ./configure --prefix=$TEST_HOME /tmp/apr-build
23- make
24- make install
25- export LD_LIBRARY_PATH=" $LD_LIBRARY_PATH :$TEST_HOME /tmp/apr-build/lib"
26-
27- git clone -q https://github.com/apache/tomcat-native.git $TEST_HOME /tmp/tomcat-native
28- cd $TEST_HOME /tmp/tomcat-native/native
29- sh buildconf --with-apr=$TEST_HOME /tmp/apr
30- ./configure --with-apr=$TEST_HOME /tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$TEST_HOME /tmp/tomcat-native-build
31- make
32- make install
33- cd $TEST_HOME
34- yes | cp build.properties.default build.properties
35- echo >> build.properties
36- echo " test.threads=4" >> build.properties
37- echo " test.relaxTiming=true" >> build.properties
38- echo " test.excludePerformance=true" >> build.properties
39- echo " test.openssl.path=/dev/null/openssl" >> build.properties
40- echo " test.apr.loc=$TEST_HOME /tmp/tomcat-native-build/lib" >> build.properties
19+ TEST_TARGET=" ${1:- smoke} "
4120
4221set -e
43- echo " Building tomcat" && \
44- ant && \
22+ if [ " $TEST_TARGET " = " full" ]; then
23+ git clone -q -b 1.6.x --single-branch https://github.com/apache/apr.git $TEST_HOME /tmp/apr
24+ cd $TEST_HOME /tmp/apr
25+ ./buildconf
26+ ./configure --prefix=$TEST_HOME /tmp/apr-build
27+ make
28+ make install
29+ export LD_LIBRARY_PATH=" $LD_LIBRARY_PATH :$TEST_HOME /tmp/apr-build/lib"
4530
46- echo " Running tomcat tests"
47- # Run tests
48- ant test
49- set +e
31+ git clone -q https://github.com/apache/tomcat-native.git $TEST_HOME /tmp/tomcat-native
32+ cd $TEST_HOME /tmp/tomcat-native/native
33+ sh buildconf --with-apr=$TEST_HOME /tmp/apr
34+ ./configure --with-apr=$TEST_HOME /tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$TEST_HOME /tmp/tomcat-native-build
35+ make
36+ make install
37+ cd $TEST_HOME
38+ yes | cp build.properties.default build.properties
39+ echo >> build.properties
40+ echo " test.threads=4" >> build.properties
41+ echo " test.relaxTiming=true" >> build.properties
42+ echo " test.excludePerformance=true" >> build.properties
43+ echo " test.openssl.path=/dev/null/openssl" >> build.properties
44+ echo " test.apr.loc=$TEST_HOME /tmp/tomcat-native-build/lib" >> build.properties
45+
46+ echo " Building tomcat" && \
47+ ant && \
48+
49+ echo " Running tomcat tests"
50+ # Run tests
51+ ant test
52+ else
53+ echo " Building tomcat" && \
54+ ant
55+ set +e
56+
57+ TOMCAT_BUILD_DIR=" ${TEST_HOME} /output/build"
58+
59+ cleanup () {
60+ " ${TOMCAT_BUILD_DIR} /bin/catalina.sh" stop || true
61+ }
62+ trap cleanup EXIT
63+
64+ echo " Starting Tomcat"
65+ cd " ${TOMCAT_BUILD_DIR} "
66+ bin/catalina.sh start
67+
68+ echo " Waiting for Tomcat to respond at ${TOMCAT_URL:- http:// localhost: 8080/ } "
69+ if timeout " ${STARTUP_TIMEOUT:- 120} " bash -c " until curl -sf '${TOMCAT_URL:- http:// localhost: 8080/ } ' >/dev/null; do sleep 2; done" ; then
70+ echo " Tomcat startup verification PASSED"
71+ exit 0
72+ else
73+ echo " Tomcat startup verification FAILED"
74+ tail -n 200 logs/catalina.out || true
75+ exit 1
76+ fi
77+ fi
0 commit comments