diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-07 13:40:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-07 13:40:38 -0400 |
commit | 075c52084dbcf09cc73efbc2bbf34c7148314329 (patch) | |
tree | 1e1b56741e186d33e11b39fe626a5e5e2756bae6 | |
parent | a49fee1c29a66455ac9cbff1a5bde58f19928f94 (diff) | |
download | tor-075c52084dbcf09cc73efbc2bbf34c7148314329.tar.gz tor-075c52084dbcf09cc73efbc2bbf34c7148314329.zip |
Fix unit test failure introduced by #20002
Updating the consensus algorithm made a non-valid node never get
listed, which messed up some other tests.
-rw-r--r-- | src/test/test_dir.c | 6 | ||||
-rw-r--r-- | src/test/test_dir_common.c | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c index bfd89a917a..09c3e053b2 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -1714,8 +1714,8 @@ test_vrs_for_v3ns(vote_routerstatus_t *vrs, int voter, time_t now) tt_int_op(rs->addr,OP_EQ, 0x99008801); tt_int_op(rs->or_port,OP_EQ, 443); tt_int_op(rs->dir_port,OP_EQ, 8000); - /* no flags except "running" (16) and "v2dir" (64) */ - tt_u64_op(vrs->flags, OP_EQ, U64_LITERAL(80)); + /* no flags except "running" (16) and "v2dir" (64) and "valid" (128) */ + tt_u64_op(vrs->flags, OP_EQ, U64_LITERAL(0xd0)); } else if (tor_memeq(rs->identity_digest, "\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5\x5" "\x5\x5\x5\x5", @@ -1812,7 +1812,7 @@ test_routerstatus_for_v3ns(routerstatus_t *rs, time_t now) tt_assert(!rs->is_stable); /* (If it wasn't running it wouldn't be here) */ tt_assert(rs->is_flagged_running); - tt_assert(!rs->is_valid); + tt_assert(rs->is_valid); tt_assert(!rs->is_named); tt_assert(rs->is_v2_dir); /* XXXX check version */ diff --git a/src/test/test_dir_common.c b/src/test/test_dir_common.c index 2448d307b2..ca43dd4c04 100644 --- a/src/test/test_dir_common.c +++ b/src/test/test_dir_common.c @@ -89,6 +89,7 @@ dir_common_gen_routerstatus_for_v3ns(int idx, time_t now) /* all flags but running and v2dir cleared */ rs->is_flagged_running = 1; rs->is_v2_dir = 1; + rs->is_valid = 1; /* xxxxx */ break; case 1: /* Generate the second routerstatus. */ |