JBoss Native SVN: r2842 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-08-08 07:57:09 -0400 (Mon, 08 Aug 2011)
New Revision: 2842
Modified:
trunk/build/unix/buildbin.TC7.sh
Log:
Arrange the logic to stop Tomcat after errors...
Modified: trunk/build/unix/buildbin.TC7.sh
===================================================================
--- trunk/build/unix/buildbin.TC7.sh 2011-08-08 08:03:11 UTC (rev 2841)
+++ trunk/build/unix/buildbin.TC7.sh 2011-08-08 11:57:09 UTC (rev 2842)
@@ -48,8 +48,20 @@
has_openssl_loc=$4
has_static_loc=$5
sources_loc=$6
+
+# Stop Tomcat
+stopTomcat()
+{
+(cd $native_sources/output/build; bin/shutdown.sh)
+sleep 10
+PID=`ps -ef | grep $native_sources | grep java | awk ' { print $2 } '`
+if [ x$PID != "x" ]; then
+ kill -15 $PID
+ sleep 10
+fi
+}
+
current_loc=`pwd`
-
native_sources=srclib/`ls srclib | grep TC7`
native_sources=`(cd $native_sources; pwd)`
cd $native_sources
@@ -58,13 +70,7 @@
echo ""
echo "Stopping tomcat (just in case)"
echo ""
-(cd $native_sources/output/build; bin/shutdown.sh)
-sleep 10
-PID=`ps -ef | grep $native_sources | grep java | awk ' { print $2 } '`
-if [ x$PID != "x" ]; then
- kill -15 $PID
- sleep 10
-fi
+stopTomcat
echo ""
echo "Running ant tests"
@@ -98,19 +104,35 @@
echo ""
export TS_HOME=/home/hudson/tcks/servlet/servlettck
export ANT_HOME=$TS_HOME/tools/ant
-(cd $TS_HOME/bin; ant run.all || exit 1) || exit 1
-(cd $TS_HOME/bin; ant report || exit 1) || exit 1
+(cd $TS_HOME/bin; ant run.all || exit 1)
+if [ $? -ne 0 ];then
+ stopTomcat
+ exit 1
+fi
+(cd $TS_HOME/bin; ant report || exit 1)
+if [ $? -ne 0 ];then
+ stopTomcat
+ exit 1
+fi
echo "JSP"
export TS_HOME=/home/hudson/tcks/jsp/jsptck
export ANT_HOME=$TS_HOME/tools/ant
-(cd $TS_HOME/bin; ant run.all || exit 1) || exit 1
-(cd $TS_HOME/bin; ant report || exit 1) || exit 1
+(cd $TS_HOME/bin; ant run.all || exit 1)
+if [ $? -ne 0 ];then
+ stopTomcat
+ exit 1
+fi
+(cd $TS_HOME/bin; ant report || exit 1)
+if [ $? -ne 0 ];then
+ stopTomcat
+ exit 1
+fi
echo ""
echo "Stopping TC7..."
echo ""
-(cd $native_sources/output/build; bin/shutdown.sh)
+stopTomcat
echo ""
echo "Testing with native"
@@ -161,7 +183,7 @@
grep http-apr $native_sources/output/build/logs/catalina.out
if [ $? -ne 0 ]; then
echo "Failed can't start native..."
- (cd $native_sources/output/build; bin/shutdown.sh)
+ stopTomcat
exit 1
fi
@@ -173,13 +195,13 @@
(cd $TS_HOME/bin; ant run.all || exit 1)
if [ $? -ne 0 ]; then
echo "Failed test failed..."
- (cd $native_sources/output/build; bin/shutdown.sh)
+ stopTomcat
exit 1
else
(cd $TS_HOME/bin; ant report || exit 1)
if [ $? -ne 0 ]; then
echo "Failed build test report failed..."
- (cd $native_sources/output/build; bin/shutdown.sh)
+ stopTomcat
exit 1
fi
fi
@@ -187,7 +209,7 @@
echo ""
echo "Stopping TC7..."
echo ""
-(cd $native_sources/output/build; bin/shutdown.sh)
+stopTomcat
echo "Done"
echo ""