summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-11-16 19:29:57 +0100
committerHolger Levsen <holger@layer-acht.org>2015-11-16 19:29:57 +0100
commitba2388ba622524f4feba0525cee1dfca612640ba (patch)
tree1e261c9e6aab263ad0606660f409ecea90e5505b
parent976f414ff946e60d8dd041040e6f81e49812257d (diff)
downloadjenkins.debian.net-ba2388ba622524f4feba0525cee1dfca612640ba.tar.xz
torbrowser tests: parse log for download problems, prevent concurrent runs
-rw-r--r--TODO5
-rwxr-xr-xbin/test_torbrowser-launcher.sh16
-rw-r--r--job-cfg/torbrowser-launcher.yaml14
3 files changed, 28 insertions, 7 deletions
diff --git a/TODO b/TODO
index 7a28c04d..39776284 100644
--- a/TODO
+++ b/TODO
@@ -411,12 +411,11 @@ The following ideas should really only be implemented for the new 'lvc*' tests..
=== torbrowser-launcher_*
-* tee tbl-l output and grep for "Download error: Download Error: 404 Not Found" and fail earlier
* not sure how to test updates. maybe just run in yesterdays schroot before upgrading
-* notifications to somewhere public
+* notifications should go somewhere public
* debug why iceweasel is needed to be installed… and ca-certificates too.
* run this in qemu and enable apparmor too?
-* test with python-pygame installed too?
+* probably not: test with python-pygame installed too?
== Further ideas...
diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh
index 4834db6c..7a935e67 100755
--- a/bin/test_torbrowser-launcher.sh
+++ b/bin/test_torbrowser-launcher.sh
@@ -34,7 +34,7 @@ cleanup_all() {
fi
# delete main work dir
cd
- rm $TMPDIR -r
+ rm $TMPDIR $TBL_LOGFILE -rf
# end
echo "$(date -u) - $TMPDIR deleted. Cleanup done."
}
@@ -131,13 +131,13 @@ download_and_launch() {
echo "'$(date -u) - starting torbrowser tests'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send
update_screenshot
echo "$(date -u) - starting torbrowser-launcher the first time, opening settings…"
- ( timeout -k 30m 29m schroot --run-session -c $SESSION --preserve-environment -- torbrowser-launcher --settings || true ) &
+ timeout -k 30m 29m schroot --run-session -c $SESSION --preserve-environment -- torbrowser-launcher --settings | tee $TBL_LOGFILE &
sleep 10
update_screenshot
echo "$(date -u) - pressing <tab>"
xvkbd -text "\t" > /dev/null 2>&1
sleep 1
- TBL_VERSION=$(schroot --run-session -c $SESSION -- dpkg -l torbrowser-launcher | grep torbrowser-launcher | cut -b 25-34 | cut -d " " -f1)
+ TBL_VERSION=$(schroot --run-session -c $SESSION -- dpkg --status torbrowser-launcher |grep ^Version|cut -d " " -f2)
if dpkg --compare-versions $TBL_VERSION lt 0.2.0-1~ ; then
echo "$(date -u) - torbrowser-launcher version <0.2.0-1~ detected ($TBL_VERSION), pressing <tab> three times more>"
xvkbd -text "\t\t\t" > /dev/null 2>&1
@@ -161,7 +161,13 @@ download_and_launch() {
fi
for i in $(seq 1 20) ; do
sleep 30
- update_screenshot
+ STATUS="$(grep '^Download error:' $TBL_LOGFILE || true)"
+ if [ -n "$STATUS" ] ; then
+ echo "'$(date -u) - $STATUS'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical
+ update_screenshot
+ cleanup_duplicate_screenshots
+ exit 1
+ fi
# this directory only exist once torbrower has been successfully installed
STATUS="$(schroot --run-session -c $SESSION -- test ! -d $HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser || echo $(date -u ) - torbrowser downloaded and installed, configuring tor now. )"
@@ -171,6 +177,7 @@ download_and_launch() {
update_screenshot
break
fi
+ update_screenshot
done
if [ ! -n "$STATUS" ] ; then
echo "'$(date -u) - could not download torbrowser, please investigate.'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical
@@ -250,6 +257,7 @@ if [ -z "$1" ] ; then
fi
SUITE=$1
TMPDIR=$(mktemp -d) # where everything actually happens
+TBL_LOGFILE=$(mktemp)
SESSION="tbb-launcher-$SUITE-$(basename $TMPDIR)"
STARTTIME=$(date +%Y%m%d%H%M)
VIDEO=test-torbrowser-${SUITE}_$STARTTIME.mpg
diff --git a/job-cfg/torbrowser-launcher.yaml b/job-cfg/torbrowser-launcher.yaml
index 428d048f..49c31d16 100644
--- a/job-cfg/torbrowser-launcher.yaml
+++ b/job-cfg/torbrowser-launcher.yaml
@@ -51,6 +51,13 @@
url: http://www.profitbricks.co.uk
text: Sponsored by Profitbricks
icon: /userContent/images/profitbricks-24x24.png
+ - throttle:
+ max-total: 3
+ max-per-node: 1
+ enabled: true
+ option: category
+ categories:
+ - torbrowser-launcher
description: '{my_description}<br>Job configuration source is <a href="http://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/tree/job-cfg/torbrowser-launcher.yaml">torbrowser-launcher.yaml</a>.<br>Results are available at <a href="https://torbrowser-launcher.debian.net/">https://torbrowser-launcher.debian.net</a>.'
logrotate:
daysToKeep: 90
@@ -100,6 +107,13 @@
url: http://www.profitbricks.co.uk
text: Sponsored by Profitbricks
icon: /userContent/images/profitbricks-24x24.png
+ - throttle:
+ max-total: 3
+ max-per-node: 1
+ enabled: true
+ option: category
+ categories:
+ - torbrowser-launcher
description: '{my_description}<br>Job configuration source is <a href="http://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/tree/job-cfg/torbrowser-launcher.yaml">torbrowser-launcher.yaml</a>.<br>Results are available at <a href="https://torbrowser-launcher.debian.net/">https://torbrowser-launcher.debian.net</a>.'
logrotate:
daysToKeep: 90