occasionally, since this uses the regular nbd-client, it also tests
whether it will at least do something useful, and not crash and burn at
startup. We can't test whether it will connect properly, since we're not
sure we have the environment set up for that completely, but this is a
good idea regardless.
sbin_PROGRAMS = @NBD_CLIENT_NAME@
EXTRA_PROGRAMS = nbd-client make-integrityhuge
TESTS_ENVIRONMENT=$(srcdir)/simple_test
-TESTS = cmd cfg1 cfgmulti cfgnew cfgsize write flush integrity dirconfig #integrityhuge
+TESTS = cmd cfg1 cfgmulti cfgnew cfgsize write flush integrity dirconfig list #integrityhuge
check_PROGRAMS = nbd-tester-client
nbd_client_SOURCES = nbd-client.c cliserv.h
nbd_server_SOURCES = nbd-server.c cliserv.h lfs.h nbd.h
integrity:
integrityhuge:
dirconfig:
+list:
./nbd-tester-client localhost -N export1 -i -t ${mydir}/integrityhuge-test.tr
retval=$?
;;
+ */list)
+ # List exports
+ # This only works if we built nbd-client, which only exists on
+ # Linux. But hey, testing nbd-client itself isn't a bad idea,
+ # so here goes.
+ if [ ! -x ./nbd-client ]
+ then
+ retval=0
+ else
+ cat >${conffile} <<EOF
+[generic]
+ listenaddr = 127.0.0.1
+ allowlist = true
+[export1]
+ exportname = $tmpnam
+ readonly = true
+EOF
+ ./nbd-server -C ${conffile} -p ${pidfile} &
+ PID=$!
+ sleep 1
+ ./nbd-client -l localhost
+ retval=$?
+ fi
+ ;;
*)
echo "E: unknown test $1"
exit 1