From 6bf41f4807ce1908be166464f4a2b46c1315a03b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 17 Jul 2024 17:25:55 +0930 Subject: [PATCH] unittests: use current version of BOLTS when reading specs. We check out the master bolts branch, and that recently changed test vectors causing our CI to change. We should test them against our current BOLTVERSION, which is in .tmp.lightningrfc/ Signed-off-by: Rusty Russell --- Makefile | 4 ++-- common/test/run-bolt12-offer-decode.c | 2 +- common/test/run-bolt12_decode.c | 2 +- common/test/run-bolt12_merkle-json.c | 2 +- common/test/run-bolt12_period.c | 2 +- common/test/run-onion-test-vector.c | 2 +- common/test/run-route_blinding_onion_test.c | 2 +- common/test/run-route_blinding_test.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index d17be84f3898..adbd60098c6a 100644 --- a/Makefile +++ b/Makefile @@ -752,8 +752,8 @@ $(ALL_TEST_PROGRAMS:%=update-mocks/%.c): $(ALL_GEN_HEADERS) $(EXTERNAL_LIBS) lib update-mocks/%: % $(ALL_GEN_HEADERS) $(ALL_GEN_SOURCES) @MAKE=$(MAKE) tools/update-mocks.sh "$*" $(SUPPRESS_OUTPUT) -unittest/%: % - $(VG) $(VG_TEST_ARGS) $* > /dev/null +unittest/%: % bolt-precheck + BOLTDIR=$(LOCAL_BOLTDIR) $(VG) $(VG_TEST_ARGS) $* > /dev/null # Installation directories exec_prefix = $(PREFIX) diff --git a/common/test/run-bolt12-offer-decode.c b/common/test/run-bolt12-offer-decode.c index bb7ec3e28199..c88a4afdff40 100644 --- a/common/test/run-bolt12-offer-decode.c +++ b/common/test/run-bolt12-offer-decode.c @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt12/offers-test.json")); if (!json) { printf("test file not found, skipping\n"); diff --git a/common/test/run-bolt12_decode.c b/common/test/run-bolt12_decode.c index 3f68cc3bddb7..0faa8ccef1fb 100644 --- a/common/test/run-bolt12_decode.c +++ b/common/test/run-bolt12_decode.c @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt12/format-string-test.json")); if (!json) { printf("test file not found, skipping\n"); diff --git a/common/test/run-bolt12_merkle-json.c b/common/test/run-bolt12_merkle-json.c index bcfc9ee6b0bc..bf6131ec99c5 100644 --- a/common/test/run-bolt12_merkle-json.c +++ b/common/test/run-bolt12_merkle-json.c @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt12/merkle-test.json")); if (!json) { printf("test file not found, skipping\n"); diff --git a/common/test/run-bolt12_period.c b/common/test/run-bolt12_period.c index ed3276243b71..a87ecb169841 100644 --- a/common/test/run-bolt12_period.c +++ b/common/test/run-bolt12_period.c @@ -179,7 +179,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt12/offer-period-test.json")); if (!json) { printf("test file not found, skipping\n"); diff --git a/common/test/run-onion-test-vector.c b/common/test/run-onion-test-vector.c index 897b7bba3321..a42cf1e9b802 100644 --- a/common/test/run-onion-test-vector.c +++ b/common/test/run-onion-test-vector.c @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt04/onion-test.json")); if (!json) { printf("test file not found, skipping\n"); diff --git a/common/test/run-route_blinding_onion_test.c b/common/test/run-route_blinding_onion_test.c index 8b963c343e2b..45610fa7c61f 100644 --- a/common/test/run-route_blinding_onion_test.c +++ b/common/test/run-route_blinding_onion_test.c @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt04/blinded-payment-onion-test.json")); if (!json) { printf("test file not found, skipping\n"); diff --git a/common/test/run-route_blinding_test.c b/common/test/run-route_blinding_test.c index c28257e7d542..6cc627762ddb 100644 --- a/common/test/run-route_blinding_test.c +++ b/common/test/run-route_blinding_test.c @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) char *dir = getenv("BOLTDIR"); json = grab_file(tmpctx, path_join(tmpctx, - dir ? dir : "../bolts", + dir ? dir : ".tmp.lightningrfc", "bolt04/route-blinding-test.json")); if (!json) { printf("test file not found, skipping\n");