r219: Support checking on devel builds, too.
authoryoe <yoe>
Mon, 6 Nov 2006 17:13:16 +0000 (17:13 +0000)
committeryoe <yoe>
Mon, 6 Nov 2006 17:13:16 +0000 (17:13 +0000)
simple_test

index 06af876..3432592 100755 (executable)
@@ -7,9 +7,17 @@ tmpnam=`mktemp`
 dd if=/dev/zero of=$tmpnam bs=1024 count=1024
 
 ./nbd-server -C /dev/null -p ./nbd-server.pid 11111 $tmpnam &
+# -p only works if nbd-server wasn't compiled with -DNOFORK or -DNODAEMON,
+# which I sometimes do for testing and debugging.
+PID=$!
 sleep 1
 ./nbd-tester-client localhost 11111
 retval=$?
-kill `cat nbd-server.pid`
+if [ -f nbd-server.pid ]
+then
+       kill `cat nbd-server.pid`
+else
+       kill $PID
+fi
 rm -f nbd-server.pid
 exit $retval