X-Git-Url: http://git.alex.org.uk diff --git a/simple_test b/simple_test index 0f12126..1ccf84b 100755 --- a/simple_test +++ b/simple_test @@ -1,9 +1,10 @@ #!/bin/sh # Yes, that's POSIX sh, not bash! -tmpnam=`mktemp` -conffile=${tmpnam}.conf -pidfile=${tmpnam}.pid +tmpdir=`mktemp -d` +conffile=${tmpdir}/nbd.conf +pidfile=${tmpdir}/nbd.pid +tmpnam=${tmpdir}/nbd.dd ulimit -c unlimited @@ -75,13 +76,12 @@ EOF if [ -f ${pidfile} ] then kill `cat ${pidfile}` - rm -f ${pidfile} else kill $PID fi if [ -z "$2" ] then - rm -f $tmpnam ${conffile} + rm -rf $tmpdir fi exit $retval fi @@ -130,6 +130,24 @@ EOF ./nbd-tester-client localhost -N export1 -w -f retval=$? ;; + */integrity) + # Integrity test + cat >${conffile} </dev/null 2>&1 + ./nbd-server -C ${conffile} -p ${pidfile} & + PID=$! + sleep 1 + ./nbd-tester-client localhost -N export1 -i -t $(dirname $1)/integrity-test.tr + retval=$? + ;; *) echo "E: unknown test $1" exit 1 @@ -138,13 +156,12 @@ esac if [ -f ${pidfile} ] then kill `cat ${pidfile}` - rm -f ${pidfile} else kill $PID fi if [ -z "$2" ] then - rm -f $tmpnam ${conffile} + rm -rf $tmpdir fi if [ $retval -ne 0 ] then