From cbe53dd555d142ff81b4c47ba4f5325cc9c1456b Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 14 Nov 2015 17:16:38 +0100 Subject: use xvfb and schroot nicely together --- bin/test_torbrowser-launcher.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh index 0a2698fe..636dea20 100755 --- a/bin/test_torbrowser-launcher.sh +++ b/bin/test_torbrowser-launcher.sh @@ -15,6 +15,9 @@ cleanup_all() { schroot --end-session -c tbb-launcher-$SUITE-$(basename $TMPDIR) > /dev/null 2>&1 || true # delete main work dir rm $TMPDIR -r + # kill xvfb + kill $XPID + # end echo "$(date -u) - $TMPDIR deleted. Cleanup done." } @@ -24,8 +27,18 @@ first_test() { schroot --begin-session --session-name=$SESSION -c jenkins-torbrowser-launcher-$SUITE schroot --run-session -c $SESSION --directory /tmp -u root -- mkdir $HOME schroot --run-session -c $SESSION --directory /tmp -u root -- chown jenkins:jenkins $HOME - xvfb-run schroot --run-session -c $SESSION -- torbrowser-launcher https://www.debian.org + Xvfb :77 -screen 0 1024x768x16 & + XPID=$? + export DISPLAY=":77" + timeout -k 5m 4m schroot --run-session -c $SESSION --preserve-environment -- torbrowser-launcher https://www.debian.org & + sleep 2m + xwd -root -silent -display :77.0 | xwdtopnm > session.pnm + kill $XPID schroot --end-session -c $SESSION + gocr session.pnm + pnmtojpeg session.pnm > session.jpg + rm session.pnm + echo "session.jpg should be made availble for download" if ! "$DEBUG" ; then set +x ; fi } -- cgit v1.2.3-70-g09d2