X-Git-Url: http://git.alex.org.uk diff --git a/simple_test b/simple_test index 7a5b1d3..9acb4e1 100755 --- a/simple_test +++ b/simple_test @@ -3,40 +3,119 @@ tmpnam=`mktemp` +ulimit -c unlimited + # Create a one-meg device -dd if=/dev/zero of=$tmpnam bs=1024 count=1024 +dd if=/dev/zero of=$tmpnam bs=1024 count=4096 + +echo $1 -./nbd-server -C /dev/null -p `pwd`/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=$? +case $1 in + */cmd) + # Test with export specified on command line + ./nbd-server -C /dev/null -p `pwd`/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 127.0.0.1 11111 + retval=$? + ;; + */cfgsize) + # Test oversized requests + ./nbd-server -C /dev/null -p `pwd`/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 127.0.0.1 11111 -o + retval=$? + ;; + */cfg1) + # Test with export specified in config file + cat > nbd-server.conf <nbd-server.conf <nbd-server.conf < nbd-server.conf <