diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-30 16:03:44 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-30 16:03:44 -0700 |
commit | 9a34fde8a51f9218d4062336dddbb42fe19b6764 (patch) | |
tree | 08f0347e89cb0d481469aa23068fd7eff9d0432d /root-topology | |
parent | 918fc8884b142452e350ff32beb90b34bbd442c1 (diff) | |
download | infinitytier-9a34fde8a51f9218d4062336dddbb42fe19b6764.tar.gz infinitytier-9a34fde8a51f9218d4062336dddbb42fe19b6764.zip |
Make sure identity.public exists and stays in sync, cleanup extra new in Node, and test script for local testnets.
Diffstat (limited to 'root-topology')
-rw-r--r-- | root-topology/test/README.md | 6 | ||||
-rwxr-xr-x | root-topology/test/create-test-root-topology.sh | 31 |
2 files changed, 37 insertions, 0 deletions
diff --git a/root-topology/test/README.md b/root-topology/test/README.md new file mode 100644 index 00000000..332f8297 --- /dev/null +++ b/root-topology/test/README.md @@ -0,0 +1,6 @@ +Test Root Topology Script +====== + +This builds a test-root-topology from any number of running test-supernode-# Docker containers. This can then be used with the (undocumented) -T (override root topology) option to run test networks under Docker. + +Once you have a local Docker test network running you can use iptables rules to simulate a variety of network pathologies, or you can just use it to test any new changes to the protocol or node behavior at some limited scale. diff --git a/root-topology/test/create-test-root-topology.sh b/root-topology/test/create-test-root-topology.sh new file mode 100755 index 00000000..032d9c2e --- /dev/null +++ b/root-topology/test/create-test-root-topology.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ ! -e ../mktopology ]; then + echo 'Build ../mktopology first!' + exit 1 +fi + +echo 'Populating supernodes/* with all Docker test-supernode-* container IPs and identities...' + +rm -rf supernodes +mkdir supernodes + +for cid in `docker ps -f 'name=test-supernode-*' -q`; do + id=`docker exec $cid cat /var/lib/zerotier-one/identity.public` + ztaddr=`echo $id | cut -d : -f 1` + ip=`docker exec $cid ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'` + echo $cid $ztaddr $id $ip + echo "id=$id" >supernodes/$ztaddr + echo "udp=$ip/9993" >>supernodes/$ztaddr +done + +echo 'Creating test-root-topology...' + +rm -f test-root-topology +../mktopology >test-root-topology + +echo 'Done!' +echo +cat test-root-topology + +exit 0 |