Author: ozizka(a)redhat.com
Date: 2009-09-22 15:41:43 -0400 (Tue, 22 Sep 2009)
New Revision: 764
Added:
trunk/jsfunit/testdata/bash_functions.sh
Modified:
trunk/jsfunit/testdata/hudson_shell_script.sh
Log:
* hudson shell script: ~/config_repository/scripts/functions.d/kill-jboss copied to
bash_functions.sh # killJBossAS()
Added: trunk/jsfunit/testdata/bash_functions.sh
===================================================================
--- trunk/jsfunit/testdata/bash_functions.sh (rev 0)
+++ trunk/jsfunit/testdata/bash_functions.sh 2009-09-22 19:41:43 UTC (rev 764)
@@ -0,0 +1,22 @@
+function killJBossAS {
+ (
+ if [[ `uname -s` == 'Linux' ]]; then
+ local PS='ps -eaf --columns 2200 | grep run.jar | grep -v grep | awk
'\''{ print $2; }'\'
+ eval "$PS" | xargs kill -3
+ sleep 1
+ eval "$PS" | xargs kill
+ sleep 10
+ eval "$PS" | xargs kill -9
+ elif lsof -i TCP:8080 &> /dev/null; then
+ local LSOF='lsof -t -i TCP:8080,8443,1099,1098,4444,4445,1093,1701'
+ kill -3 `$LSOF`
+ sleep 1
+ kill `$LSOF`
+ sleep 10
+ kill -9 `$LSOF`
+ else
+ echo Not yet supported on `uname -s` UNIX favour without working lsof.
+ return 1
+ fi
+ ) || return 0
+}
Modified: trunk/jsfunit/testdata/hudson_shell_script.sh
===================================================================
--- trunk/jsfunit/testdata/hudson_shell_script.sh 2009-09-22 18:55:21 UTC (rev 763)
+++ trunk/jsfunit/testdata/hudson_shell_script.sh 2009-09-22 19:41:43 UTC (rev 764)
@@ -91,7 +91,9 @@
mvn $M2_SETTINGS -Pjboss5x -Pfoo$ADD_PROFILES install
-Dcargo.jboss.configuration=$JBOSS_CONFIG -Dhtmlunit.browser=$BROWSER --fail-never
--update-snapshots -DJBOSS_HOME=$JBOSS_HOME -Dcargo.jboss.bind.address=$MYTESTIP_1
else
## Include functions for Hudson.
- . ~/config_repository/scripts/common/common_bash.sh
+ #. ~/config_repository/scripts/common/common_bash.sh
+ . bash_functions.sh
+
## Split testsuite to parts, because of OOME
for part in Apps ConnFactories Datasources Jms theRest; do
echo "Running tests for part '$part'..."
@@ -99,7 +101,7 @@
echo "Performing 'patch -p0 <
testdata/pom_patches/pom-$part.patch'..."
patch -p0 < testdata/pom_patches/pom-$part.patch
echo "Killing JBoss AS..."
- kill-jboss
+ killJBossAS
rm -rf target/jboss5x # Empty Cargo's configuration dir
mvn $M2_SETTINGS -Pjboss5x -Pfoo$ADD_PROFILES install
-Dcargo.jboss.configuration=$JBOSS_CONFIG -Dhtmlunit.browser=$BROWSER --fail-never
--update-snapshots -DJBOSS_HOME=$JBOSS_HOME -Dcargo.jboss.bind.address=$MYTESTIP_1
#mv target/surefire-reports/TEST-TestSuite.xml TEST-TestSuite-$part.xml
Show replies by date