From 7b25b3886ea95bc6495506fbe9472e45fcbde684 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 30 Aug 2012 17:24:36 +0300 Subject: Renamed tests -> uitest and tests/testbench -> uitest/src (#9299) --- uitest/integration_base_files/base.xml | 124 ++++++++++++++++++++++++++++++ uitest/integration_base_files/cleanup.sh | 26 +++++++ uitest/integration_base_files/lock_age.sh | 21 +++++ 3 files changed, 171 insertions(+) create mode 100644 uitest/integration_base_files/base.xml create mode 100644 uitest/integration_base_files/cleanup.sh create mode 100644 uitest/integration_base_files/lock_age.sh (limited to 'uitest/integration_base_files') diff --git a/uitest/integration_base_files/base.xml b/uitest/integration_base_files/base.xml new file mode 100644 index 0000000000..f9c2ff3d6b --- /dev/null +++ b/uitest/integration_base_files/base.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${server}: Getting the lock + + + + + + + + ${server}: Got the lock + + + + + + + + + + + + ${server}: Released the lock + + + + + + + diff --git a/uitest/integration_base_files/cleanup.sh b/uitest/integration_base_files/cleanup.sh new file mode 100644 index 0000000000..42fb5a434d --- /dev/null +++ b/uitest/integration_base_files/cleanup.sh @@ -0,0 +1,26 @@ +#! /bin/bash +echo checking and killing open servers + +# Find all java processes, except +# * grep, as we're running it +# * get-lock, as that one is just waiting for this cleanup to happen +# * shutdown-and-cleanup, as that could be the one we're running from +ps x | grep -E bin/java | grep -v grep | grep -v get-lock | grep -v shutdown-and-cleanup | awk '{print $1}' > temp + +#Read and kill processes marked to temp +while read line +do + kill -9 $line +done < temp + +#Remove temp +rm temp + +if [ -a /home/integration/demo.war ] + then + echo removing old demo.war + rm /home/integration/demo.war +fi + +echo Cleaning deploy dir +rm -rf /home/integration/deploy/* diff --git a/uitest/integration_base_files/lock_age.sh b/uitest/integration_base_files/lock_age.sh new file mode 100644 index 0000000000..115a8fef79 --- /dev/null +++ b/uitest/integration_base_files/lock_age.sh @@ -0,0 +1,21 @@ +#! /bin/bash +if lockfile -r0 -! /home/integration/deploy/lock.file &> /dev/null + then + # If we could not get the lock, check how old the lock file is + DATE=$(date +%s) + # What if the file is not there any more? + LOCK_AGE=$(stat -c %Z /home/integration/deploy/lock.file) + + AGE=$[($DATE - $LOCK_AGE)/60] + + if [ "$AGE" -gt "20" ] + then + echo lock.file is $AGE min old. + ./cleanup.sh +# else +# echo lock.file is $AGE min old. + fi + else + # If we got the lock, do a cleanup (releasing the lock) just in case something has still been left running + ./cleanup.sh &> /dev/null +fi -- cgit v1.2.3