-#!/bin/sh
+#!/bin/zsh
TIMEOUT_TIME=60
export URL_PREFIX=http://10.0.2.2
BAILOUT_CMD=""
+
timeout_handler() {
wget -q --post-data="Timeout" -O /dev/null http://localhost:$STATUS_PORT//FAIL
bailout
KVM_PID=$!
$SERVER_STATUS -p $STATUS_PORT -t "$TEST_NAME" &
SERVER_PID=$!
+ if [ -n "$VNC" -a -n "$VNCVIEWER" ] ; then
+ while $VNCSTATUS; do
+ VNCSTATUS=true
+ sleep 1
+ if lsof -i -n | grep ':5900' ; then
+ $VNCVIEWER localhost &
+ VNCSTATUS=false
+ fi
+ done
+ fi
}
+
timeout()
{
( sleep $TIMEOUT_TIME ; kill -16 $$; )2>/dev/null &
COMMON_PORT=0
STATUS_PORT=0
-# $RANDOM is not set in dash
+# $RANDOM is not set in dash, make sure a user who doesn't use
+# something like /bin/zsh in his test scripts doesn't get obscure
+# shell error messages
if [ -z "$RANDOM" ] ; then
echo "Variable \$RANDOM not set, can not choose random port. Exiting.">&2
bailout
#!/bin/zsh
if [ $# -lt 2 ] ; then
- echo "Usage: $0 cdrom mountpoint [tests]"
+ echo "Usage: $0 cdrom mountpoint [tests]">&2
exit 1
fi
+# support VNC=1 for automatically starting up vncviewer while running tests
+# if $VNCVIEWER isn't set try to figure out which one could be used
+if [ -z "$VNCVIEWER" ] ; then
+ for vncviewer in xvnc4viewer Xtightvnc x11vnc vncviewer; do
+ [[ -n ${commands[$vncviewer]} ]] && export VNCVIEWER=$vncviewer
+ done
+fi
+
export CDROM="$1"
export KERNEL=$(find "$2"/boot/ -name linux26)
export INITRD=$(find "$2"/boot/ -name initrd.gz)
else
TESTS=(*(/))
fi
+
for dir in $TESTS ; do
[ ! -x $dir ] && continue
cd $dir