diff --git a/lightningd/test/Makefile b/lightningd/test/Makefile index 84076a26d..fa0f9c33d 100644 --- a/lightningd/test/Makefile +++ b/lightningd/test/Makefile @@ -1,4 +1,7 @@ -check: lightningd/tests +# FIXME: check doesn't cover lightningd-blackbox-tests, since they +# can't run in parallel with daemon blackbox tests. + +check: lightningd/tests #lightningd-blackbox-tests # Note that these actually #include everything they need, except ccan/ and bitcoin/. # That allows for unit testing of statics, and special effects. @@ -14,3 +17,22 @@ $(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS lightningd/tests: $(LIGHTNINGD_TEST_PROGRAMS:%=unittest/%) +# So far, only basic test. +lightningd-test-0-basic: lightningd-test-setup-0 + +lightningd-test-0-%: + NO_VALGRIND=$(NO_VALGRIND) VARIANT=0 lightningd/test/test-$* + +# We shutdown first in case something is left over. +lightningd-test-setup-%: lightningd-all daemon/lightning-cli + VARIANT=$* daemon/test/scripts/shutdown.sh 2>/dev/null || true + VARIANT=$* daemon/test/scripts/setup.sh + +lightningd-test-shutdown-0: lightningd-test-0-basic + VARIANT=0 daemon/test/scripts/shutdown.sh +lightningd-test-shutdown-1: lightningd-test-1-basic\ --restart + VARIANT=1 daemon/test/scripts/shutdown.sh +lightningd-test-shutdown-2: lightningd-test-2-basic\ --reconnect + VARIANT=2 daemon/test/scripts/shutdown.sh + +lightningd-blackbox-tests: lightningd-test-shutdown-0 #lightningd-test-shutdown-1 lightningd-test-shutdown-2 diff --git a/lightningd/test/test-basic b/lightningd/test/test-basic new file mode 100755 index 000000000..6b3eb9804 --- /dev/null +++ b/lightningd/test/test-basic @@ -0,0 +1,22 @@ +#! /bin/sh -e + +# Wherever we are, we want to be in daemon/test dir. +cd `git rev-parse --show-toplevel`/daemon/test + +. scripts/vars.sh +. scripts/helpers.sh + +parse_cmdline 2 "$@" +setup_lightning 2 + +start_lightningd 2 lightningd/lightningd + +# FIXME: Try to connect. +# lcli1 connect localhost $PORT2 $ID2 + +# FIXME: Check status. + +lcli1 stop +lcli2 stop + +all_ok