aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.test.include
diff options
context:
space:
mode:
authorGleb Naumenko <[email protected]>2019-12-24 13:18:44 -0500
committerGleb Naumenko <[email protected]>2019-12-25 08:59:08 -0500
commitec45646de9e62b3d42c85716bfeb06d8f2b507dc (patch)
tree2d3717818d8ea1b9a53f9b53af2390f7aee9ac21 /src/Makefile.test.include
parent Add asmap utility which queries a mapping (diff)
downloaddiscoin-ec45646de9e62b3d42c85716bfeb06d8f2b507dc.tar.xz
discoin-ec45646de9e62b3d42c85716bfeb06d8f2b507dc.zip
Integrate ASN bucketing in Addrman and add tests
Instead of using /16 netgroups to bucket nodes in Addrman for connection diversification, ASN, which better represents an actor in terms of network-layer infrastructure, is used. For testing, asmap.raw is used. It represents a minimal asmap needed for testing purposes.
Diffstat (limited to 'src/Makefile.test.include')
-rw-r--r--src/Makefile.test.include12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index b4ca01b1f..f3fc6c706 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -53,7 +53,8 @@ JSON_TEST_FILES = \
test/data/tx_invalid.json \
test/data/tx_valid.json
-RAW_TEST_FILES =
+RAW_TEST_FILES = \
+ test/data/asmap.raw
GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
@@ -429,3 +430,12 @@ endif
echo "};};"; \
} > "[email protected]" && mv -f "[email protected]" "$@"
@echo "Generated $@"
+
+%.raw.h: %.raw
+ @$(MKDIR_P) $(@D)
+ @{ \
+ echo "static unsigned const char $(*F)_raw[] = {" && \
+ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
+ echo "};"; \
+ } > "[email protected]" && mv -f "[email protected]" "$@"
+ @echo "Generated $@"