From 20248e429f13bd9489867b471507cf5dafd7b9f0 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 16 Nov 2015 03:13:43 +0100 Subject: torbrowser tests: fix git jobs and use notify-send --- bin/test_torbrowser-launcher.sh | 21 ++++++++++++--------- job-cfg/torbrowser-launcher.yaml | 12 ++++++------ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh index 9a835600..f7113a0d 100755 --- a/bin/test_torbrowser-launcher.sh +++ b/bin/test_torbrowser-launcher.sh @@ -104,8 +104,8 @@ download_and_launch() { rm $DBUS_SESSION_FILE ffmpeg -f x11grab -s $SIZE -i :$SCREEN.0 $VIDEO > /dev/null 2>&1 & FFMPEGPID=$! - echo "$(date -u) - starting torbrowser tests" - #echo "naughty.notify({ text = '$(date -u) - starting torbrowser tests' })" | schroot --run-session -c $SESSION --preserve-environment -- awesome-client + 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…" ( timeout -k 30m 29m schroot --run-session -c $SESSION --preserve-environment -- torbrowser-launcher --settings || true ) & sleep 10 @@ -119,32 +119,34 @@ download_and_launch() { sleep 10 update_screenshot # this directory only exist once torbrower has been successfully installed - STATUS="$(schroot --run-session -c $SESSION -- [ ! -d $HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser ] || echo 'Torbrowser downloaded and installed.')" + STATUS="$(schroot --run-session -c $SESSION -- [ ! -d $HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser ] || echo '$(date -u ) - torbrowser downloaded and installed.')" if [ -n "$STATUS" ] ; then sleep 10 + echo "'$STATUS'" | tee >( xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send ) update_screenshot - echo "Status: $STATUS" break fi done if [ ! -n "$STATUS" ] ; then - echo "$(date -u) - could not download torbrowser, please investigate." + echo "'$(date -u) - could not download torbrowser, please investigate.'" | tee >( xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical ) + update_screenshot exit 1 fi echo "$(date -u) - waiting for torbrowser to start…" for i in $(seq 1 6) ; do sleep 10 # this directory only exist once torbrower has successfully started - STATUS="$(schroot --run-session -c $SESSION -- [ ! -d $HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default ] || echo 'Torbrowser running.')" + STATUS="$(schroot --run-session -c $SESSION -- [ ! -d $HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default ] || echo '$(date -u ) - torbrowser running.')" if [ -n "$STATUS" ] ; then sleep 10 + echo "'$STATUS'" | tee >( xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send ) update_screenshot - echo "Status: $STATUS" break fi done if [ ! -n "$STATUS" ] ; then - echo "$(date -u) - could not start torbrowser, please investigate." + echo "'$(date -u) - could not start torbrowser, please investigate.'" | tee >( xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical ) + update_screenshot exit 1 fi echo "$(date -u) - pressing , to connect directly via tor…" @@ -168,7 +170,7 @@ download_and_launch() { update_screenshot done sleep 1 - #echo "naughty.notify({ text = '$(date -u) - torbrowser tests end' })" | schroot --run-session -c $SESSION --preserve-environment -- awesome-client + echo "'$(date -u) - torbrowser tests end.'" | tee >( xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send ) update_screenshot echo "$(date) - telling awesome to quit." echo 'awesome.quit()' | schroot --run-session -c $SESSION --preserve-environment -- awesome-client @@ -207,6 +209,7 @@ if [ "$2" = "git" ] ; then mkdir $TMPDIR/git cp -r * $TMPDIR/git elif [ "$SUITE" = "experimental" ] || [ "$2" = "experimental" ] ; then + SUITE=unstable EXPERIMENTAL=yes fi WORKSPACE=$(pwd) diff --git a/job-cfg/torbrowser-launcher.yaml b/job-cfg/torbrowser-launcher.yaml index ea0da8cf..84946d47 100644 --- a/job-cfg/torbrowser-launcher.yaml +++ b/job-cfg/torbrowser-launcher.yaml @@ -149,7 +149,7 @@ - job-template: defaults: torbrowser-launcher_git - name: '{name}_test_unstable_amd64_git_debian_sid': + name: '{name}_test_unstable_amd64_git_debian_sid' - job-template: defaults: torbrowser-launcher_packages @@ -165,11 +165,11 @@ - job-template: defaults: torbrowser-launcher_git - name: '{name}_test_jessie_amd64_git_debian_experimental': + name: '{name}_test_jessie_amd64_git_debian_experimental' - job-template: defaults: torbrowser-launcher_git - name: '{name}_test_jessie_amd64_git_debian_sid': + name: '{name}_test_jessie_amd64_git_debian_sid' - project: name: torbrowser-launcher @@ -177,19 +177,19 @@ - '{name}_setup_schroot_unstable_amd64': my_description: 'Setup unstable/amd64 schroot for testing torbrowser-launcher.' my_timed: '42 1 * * *' - my_shell: '/srv/jenkins/bin/schroot-create.sh torbrowser-launcher torbrowser-launcher-unstable unstable torbrowser-launcher ca-certificates awesome dbus xterm x11-utils build-essential devscripts python-all debhelper dh-apparmor' + my_shell: '/srv/jenkins/bin/schroot-create.sh torbrowser-launcher torbrowser-launcher-unstable unstable torbrowser-launcher ca-certificates awesome dbus xterm x11-utils libnotify-bin build-essential devscripts python-all debhelper dh-apparmor' my_recipients: 'holger@layer-acht.org' my_node: '' - '{name}_setup_schroot_stretch_amd64': my_description: 'Setup stretch/amd64 schroot for testing torbrowser-launcher.' my_timed: '42 2 * * *' - my_shell: '/srv/jenkins/bin/schroot-create.sh torbrowser-launcher torbrowser-launcher-stretch stretch torbrowser-launcher ca-certificates awesome dbus xterm x11-utils build-essential devscripts python-all debhelper dh-apparmor' + my_shell: '/srv/jenkins/bin/schroot-create.sh torbrowser-launcher torbrowser-launcher-stretch stretch torbrowser-launcher ca-certificates awesome dbus xterm x11-utils libnotify-bin build-essential devscripts python-all debhelper dh-apparmor' my_recipients: 'holger@layer-acht.org' my_node: '' - '{name}_setup_schroot_jessie_amd64': my_description: 'Setup jessie/amd64 schroot for testing torbrowser-launcher.' my_timed: '42 3 * * *' - my_shell: '/srv/jenkins/bin/schroot-create.sh torbrowser-launcher torbrowser-launcher-jessie jessie torbrowser-launcher ca-certificates awesome dbus xterm x11-utils build-essential devscripts python-all debhelper dh-apparmor' + my_shell: '/srv/jenkins/bin/schroot-create.sh torbrowser-launcher torbrowser-launcher-jessie jessie torbrowser-launcher ca-certificates awesome dbus xterm x11-utils libnotify-bin build-essential devscripts python-all debhelper dh-apparmor' my_recipients: 'holger@layer-acht.org' my_node: '' - '{name}_test_experimental_amd64': -- cgit v1.2.3-70-g09d2