summaryrefslogtreecommitdiffstats
path: root/run_test_suite
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2013-02-14 19:20:47 +0100
committerTails developers <amnesia@boum.org>2013-02-26 17:57:20 +0100
commit2c078ed73840c3f5e9a21d26624d69cacd01d253 (patch)
tree79bff12ab14e4f364ecf3b13ca787ab6ccae19d0 /run_test_suite
parentc030600c8f1cda2c3a198201fa00b59736beb5fa (diff)
Find the next unused display for Xvfb instead of using a static one.
Diffstat (limited to 'run_test_suite')
-rwxr-xr-xrun_test_suite21
1 files changed, 19 insertions, 2 deletions
diff --git a/run_test_suite b/run_test_suite
index 61808d3..2d8673c 100755
--- a/run_test_suite
+++ b/run_test_suite
@@ -5,8 +5,6 @@
set -e
NAME=$(basename ${0})
-TARGET_DISPLAY=:8
-
usage() {
echo "Usage: $NAME [OPTION]... ISO [FEATURE]...
@@ -34,11 +32,28 @@ check_dependency() {
fi
}
+display_in_use() {
+ xdpyinfo -display $1 >/dev/null 2>&1
+}
+
+next_free_display() {
+ display_nr=0
+ while display_in_use ":${display_nr}"; do
+ display_nr=$((display_nr+1))
+ done
+ echo ":${display_nr}"
+}
+
start_xvfb() {
check_dependency Xvfb
Xvfb $TARGET_DISPLAY -screen 0 1024x768x24+32 >/dev/null 2>&1 &
XVFB_PID=$!
trap "kill -9 ${XVFB_PID}" EXIT
+ # Wait for Xvfb to run on TARGET_DISPLAY
+ until display_in_use $TARGET_DISPLAY; do
+ sleep 1
+ done
+ echo "Virtual X framebuffer started on display ${TARGET_DISPLAY}"
}
start_vnc_server() {
@@ -103,6 +118,8 @@ if [ -z "${ISO}" ]; then
error "No ISO provided. Aborting..."
fi
+TARGET_DISPLAY=$(next_free_display)
+
start_xvfb
if [ -n "${CAPTURE_FILE}" ]; then