summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-11-16 02:14:51 +0100
committerHolger Levsen <holger@layer-acht.org>2015-11-16 02:16:12 +0100
commit7517808c01ae43ac4712f4a23ec72136bb0c11d3 (patch)
tree313a389220c2a348847e28c201b9058b20801f4a /bin
parent6494be1d523fa914ccce1b82ed7d8c9b5cd671ef (diff)
downloadjenkins.debian.net-7517808c01ae43ac4712f4a23ec72136bb0c11d3.tar.xz
torbrowser tests: two new jobs: build package from git and use the one from experimental on jessie
Diffstat (limited to 'bin')
-rwxr-xr-xbin/test_torbrowser-launcher.sh45
1 files changed, 36 insertions, 9 deletions
diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh
index 11dc823f..9a835600 100755
--- a/bin/test_torbrowser-launcher.sh
+++ b/bin/test_torbrowser-launcher.sh
@@ -62,16 +62,23 @@ end_session() {
}
upgrade_to_experimental_version() {
- if [ "$SUITE" != "experimental" ] ; then
- return
- fi
echo
- echo "Upgrading to torbrowser-launcher from experimental…"
+ echo "$(date -u ) - upgrading to torbrowser-launcher from experimental…"
echo "deb $MIRROR experimental main contrib" | schroot --run-session -c $SESSION --directory /tmp -u root -- tee -a /etc/apt/sources.list
schroot --run-session -c $SESSION --directory /tmp -u root -- apt-get update
schroot --run-session -c $SESSION --directory /tmp -u root -- apt-get -y install -t experimental torbrowser-launcher
}
+build_and_upgrade_to_git_version() {
+ echo
+ echo "$(date -u ) - building torbrowser-launcher from git, branch $BRANCH…"
+ schroot --run-session -c $SESSION --directory $TMPDIR/git -- debuild -b
+ DEB=$(cd $TMPDIR/git ; ls torbrowser-launcher_*deb)
+ echo "$(date -u ) - installing $DEB…"
+ schroot --run-session -c $SESSION --directory $TMPDIR/git -u root -- dpkg -i $DEB
+ rm $TMPDIR/git -r
+}
+
download_and_launch() {
echo
echo "$(date -u) - Test download_and_launch begins."
@@ -176,7 +183,7 @@ download_and_launch() {
}
#
-# main
+# prepare
#
if [ -z "$1" ] ; then
echo "call $0 with a suite as param."
@@ -185,20 +192,40 @@ fi
SUITE=$1
TMPDIR=$(mktemp -d) # where everything actually happens
SESSION="tbb-launcher-$SUITE-$(basename $TMPDIR)"
+STARTTIME=$(date +%Y%m%d%H%M)
+VIDEO=test-torbrowser-${SUITE}_$STARTTIME.mpg
+SIZE=1024x768
SCREEN=$EXECUTOR_NUMBER
+if [ "$2" = "git" ] ; then
+ if [ -z "$3" ] ; then
+ BRANCH=master
+ else
+ BRANCH=$3
+ fi
+ echo "$(date -u) - preserving git workspace."
+ git branch -av
+ mkdir $TMPDIR/git
+ cp -r * $TMPDIR/git
+elif [ "$SUITE" = "experimental" ] || [ "$2" = "experimental" ] ; then
+ EXPERIMENTAL=yes
+fi
WORKSPACE=$(pwd)
RESULTS=$WORKSPACE/results
[ ! -f screenshot.png ] || mv screenshot.png screenshot_from_git.png
mkdir -p $RESULTS
cd $TMPDIR
-STARTTIME=$(date +%Y%m%d%H%M)
-VIDEO=test-torbrowser-${SUITE}_$STARTTIME.mpg
-SIZE=1024x768
trap cleanup_all INT TERM EXIT
+#
+# main
+#
echo "$(date -u) - testing torbrowser-launcher on $SUITE now."
begin_session
-upgrade_to_experimental_version
+if [ "$2" = "git" ] ; then
+ build_and_upgrade_to_git_version
+elif [ "$EXPERIMENTAL" = "yes" ] ; then
+ upgrade_to_experimental_version
+fi
download_and_launch
end_session