diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 1 | ||||
-rw-r--r-- | src/or/dirserv.c | 15 | ||||
-rw-r--r-- | src/or/or.h | 4 | ||||
-rwxr-xr-x | src/test/test-network.sh | 12 |
4 files changed, 25 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c index 921d032529..3b37a123af 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -439,6 +439,7 @@ static config_var_t option_vars_[] = { V(TestingDescriptorMaxDownloadTries, UINT, "8"), V(TestingMicrodescMaxDownloadTries, UINT, "8"), V(TestingCertMaxDownloadTries, UINT, "8"), + V(TestingDirAuthVoteExit, ROUTERSET, NULL), V(TestingDirAuthVoteGuard, ROUTERSET, NULL), VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "0"), diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 374cfa6f40..c8f47e648e 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2169,12 +2169,19 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs, rs->ipv6_orport = ri->ipv6_orport; } - /* Iff we are in a testing network, use TestingDirAuthVoteGuard to + /* Iff we are in a testing network, use TestingDirAuthVoteExit to + give out Exit flags, and TestingDirAuthVoteGuard to give out Guard flags. */ - if (options->TestingTorNetwork && - routerset_contains_routerstatus(options->TestingDirAuthVoteGuard, + if (options->TestingTorNetwork) { + if (routerset_contains_routerstatus(options->TestingDirAuthVoteExit, + rs, 0)) { + rs->is_exit = 1; + } + + if (routerset_contains_routerstatus(options->TestingDirAuthVoteGuard, rs, 0)) { - rs->is_possible_guard = 1; + rs->is_possible_guard = 1; + } } } diff --git a/src/or/or.h b/src/or/or.h index 54cee46ee3..4130ea6351 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -4056,6 +4056,10 @@ typedef struct { /** Minimum value for the Fast flag threshold on testing networks. */ uint64_t TestingMinFastFlagThreshold; + /** Relays in a testing network which should be voted Exit + * regardless of exit policy. */ + routerset_t *TestingDirAuthVoteExit; + /** Relays in a testing network which should be voted Guard * regardless of uptime and bandwidth. */ routerset_t *TestingDirAuthVoteGuard; diff --git a/src/test/test-network.sh b/src/test/test-network.sh index fb33842f32..d28fbde80f 100755 --- a/src/test/test-network.sh +++ b/src/test/test-network.sh @@ -1,5 +1,7 @@ #! /bin/sh +ECHO_N="/bin/echo -n" + until [ -z $1 ] do case $1 in @@ -15,6 +17,10 @@ do export NETWORK_FLAVOUR="$2" shift ;; + --delay|--sleep|--bootstrap-time|--time) + export BOOTSTRAP_TIME="$2" + shift + ;; *) echo "Sorry, I don't know what to do with '$1'." exit 2 @@ -39,10 +45,10 @@ PATH="$TOR_DIR/src/or:$TOR_DIR/src/tools:$PATH" # Sleep some, waiting for the network to bootstrap. # TODO: Add chutney command 'bootstrap-status' and use that instead. -BOOTSTRAP_TIME=18 -echo -n "$myname: sleeping for $BOOTSTRAP_TIME seconds" +BOOTSTRAP_TIME=${BOOTSTRAP_TIME:-18} +$ECHO_N "$myname: sleeping for $BOOTSTRAP_TIME seconds" n=$BOOTSTRAP_TIME; while [ $n -gt 0 ]; do - sleep 1; n=$(expr $n - 1); echo -n . + sleep 1; n=$(expr $n - 1); $ECHO_N . done; echo "" ./chutney verify $CHUTNEY_NETWORK VERIFY_EXIT_STATUS=$? |