summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-11-19 03:29:28 +0100
committerHolger Levsen <holger@layer-acht.org>2015-11-19 03:51:34 +0100
commitcb7453e3bccd56e42609de8b1e1f76a339cd96cf (patch)
treee2bdcebc791b5fd28da7f6edd283c01203b8cb63
parent1249760ad127dec5b3155753a35ab3589b1bcd5b (diff)
downloadjenkins.debian.net-cb7453e3bccd56e42609de8b1e1f76a339cd96cf.tar.xz
torbrowser tests: refactor, sleep less first, later more
-rwxr-xr-xbin/test_torbrowser-launcher.sh28
1 files changed, 16 insertions, 12 deletions
diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh
index 9f32182a..158c1d52 100755
--- a/bin/test_torbrowser-launcher.sh
+++ b/bin/test_torbrowser-launcher.sh
@@ -189,10 +189,11 @@ download_and_launch() {
cleanup_duplicate_screenshots
exit 1
fi
- # allow the download to take up to 15 minutes
+ # allow the download to take up to ~15 minutes (891 seconds)
+ # ( echo -n "0" ; for i in $(seq 1 33) ; do echo -n "+$i+10" ; done ; echo ) | bc
# we watch the download directory and parse torbrowser-launchers stdout, so usually this loop won't run this long
- for i in $(seq 1 60) ; do
- sleep 15
+ for i in $(seq 1 33) ; do
+ sleep 10 ; sleep $i
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
@@ -219,9 +220,9 @@ download_and_launch() {
exit 1
fi
echo "$(date -u) - waiting for torbrowser to start."
- # allow up to 60 seconds for torbrowser to start
- for i in $(seq 1 6) ; do
- sleep 10
+ # allow up to 63 seconds for torbrowser to start
+ for i in $(seq 1 7) ; do
+ sleep 5 ; sleep $i
# this directory only exists once torbrower has successfully started
# (and pattern matching doesnt work because of schroot…)
local BROWSER_PROFILE=TorBrowser/Data/Browser/profile.default
@@ -242,8 +243,9 @@ download_and_launch() {
xvkbd -text "\r" > /dev/null 2>&1
sleep 3
update_screenshot
- for i in $(seq 1 6) ; do
- sleep 10
+ # allow up to 63 seconds for torbrowser to make the first connection through tor
+ for i in $(seq 1 7) ; do
+ sleep 5 ; sleep $i
update_screenshot
TOR_RUNNING=$(gocr $WORKSPACE/screenshot.png 2>/dev/null | egrep "(Search securely|Tor Is NOT all you need to browse|There are many ways you can help)" || true)
if [ -n "$TOR_RUNNING" ] ; then
@@ -268,8 +270,9 @@ download_and_launch() {
sleep 1
xvkbd -text "\r" > /dev/null 2>&1
sleep 2
- for i in $(seq 1 6) ; do
- sleep 5
+ # allow up up to 30 seconds to load the url
+ for i in $(seq 1 4) ; do
+ sleep 5 ; sleep $i
URL_LOADED=$(gocr $WORKSPACE/screenshot.png 2>/dev/null | grep -c -i "README" || true)
update_screenshot
if [ $URL_LOADED -ge 4 ] ; then
@@ -287,8 +290,9 @@ download_and_launch() {
sleep 1
xvkbd -text "\r" > /dev/null 2>&1
sleep 2
- for i in $(seq 1 6) ; do
- sleep 5
+ # allow up up to 30 seconds to load the url
+ for i in $(seq 1 4) ; do
+ sleep 5 ; sleep $i
URL_LOADED=$(gocr $WORKSPACE/screenshot.png 2>/dev/null | grep -c "Debian" || true)
update_screenshot
if [ $URL_LOADED -ge 6 ] ; then