summaryrefslogtreecommitdiffstats
path: root/run_test_suite
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2013-02-25 23:25:58 +0100
committerTails developers <amnesia@boum.org>2013-03-08 01:47:04 +0100
commitab4418a337f65ef270b20c4f9407f8f96772d422 (patch)
tree3fbbc24b01b61c4754cd73bb33725bd30453eb26 /run_test_suite
parent24d00713978e819e9e084026a0be144f2105cd3f (diff)
Put all temporary files in the same configurable directory.
Diffstat (limited to 'run_test_suite')
-rwxr-xr-xrun_test_suite28
1 files changed, 26 insertions, 2 deletions
diff --git a/run_test_suite b/run_test_suite
index acfcd25..38e70d0 100755
--- a/run_test_suite
+++ b/run_test_suite
@@ -14,6 +14,10 @@ from the Tails source directory.
Options:
--capture=FILE Captures the test session into FILE using VP8 encoding.
Requires ffmpeg and libvpx0.
+ --temp-dir Directory where various temporary files are written
+ during a test, e.g. VM snapshots and memory dumps,
+ failure screenshots, pcap files and disk images
+ (default is /tmp/TailsToaster).
--view Shows the test session in a windows. Requires x11vnc
and xtightvncviewer.
--vnc-server-only Starts a VNC server for the test session. Requires x11vnc.
@@ -82,7 +86,7 @@ capture_session() {
unset CAPTURE_FILE VNC_VIEWER VNC_SERVER
SHORTOPTS="a:c"
-LONGOPTS="view,vnc-server-only,capture:,help"
+LONGOPTS="view,vnc-server-only,capture:,help,temp-dir:"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "${NAME}" -- "$@")
eval set -- "$OPTS"
while [ $# -gt 0 ]; do
@@ -99,6 +103,10 @@ while [ $# -gt 0 ]; do
shift
CAPTURE_FILE="$1"
;;
+ --temp-dir)
+ shift
+ TEMP_DIR="$(readlink -f $1)"
+ ;;
--help)
usage
exit 0
@@ -124,6 +132,21 @@ for dep in git libvirt-bin libvirt-dev virt-viewer libsikuli-script-java \
check_dependency "${dep}"
done
+if [ -z "${TEMP_DIR}" ]; then
+ TEMP_DIR=/tmp/TailsToaster
+fi
+if [ ! -e "${TEMP_DIR}" ]; then
+ mkdir -p "${TEMP_DIR}"
+fi
+if [ ! -d "${TEMP_DIR}" ]; then
+ error "${TEMP_DIR} is not a directory"
+fi
+for t in r w x; do
+ if [ ! -${t} "${TEMP_DIR}" ]; then
+ error "Insufficient permissions for ${TEMP_DIR}"
+ fi
+done
+
TARGET_DISPLAY=$(next_free_display)
start_xvfb
@@ -143,7 +166,7 @@ fi
# them with more permissible permissions, which libvirt will preserve
# (although it will change ownership). so that the user running the
# script can grep the dumps for the fillram pattern.
-for file in features/tmpfs/after_wipe.dump features/tmpfs/before_wipe.dump; do
+for file in "${TEMP_DIR}"/after_wipe.dump "${TEMP_DIR}"/before_wipe.dump; do
if [ ! -e "${file}" ]; then
touch "${file}"
fi
@@ -162,6 +185,7 @@ fi
export SIKULI_HOME="/usr/share/java"
export DISPLAY=${TARGET_DISPLAY}
export ISO="${ISO}"
+export TEMP_DIR="${TEMP_DIR}"
. features/.rvmrc
check_dependency cucumber
if [ -z "${*}" ]; then