[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] test: Fix duplicate ORPort test



commit d47e937a5074c8c9799e1d8bbd6645eea74b86ab
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Thu Feb 11 16:32:17 2021 -0500

    test: Fix duplicate ORPort test
    
    The comment of that specific unit test wanted 4 ORPorts but for some reasons
    we tested for 3 which before the previous commit related to #40289, test would
    pass but it was in fact wrong.
    
    Now the code is correct and 4 was in fact correct expected number of ports.
    
    Related to #40289
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 src/test/test_config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/test/test_config.c b/src/test/test_config.c
index 4eb4ac9cf5..cd7a54b97a 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -6907,12 +6907,14 @@ test_config_duplicate_orports(void *arg)
 
   /* We have four address here, 1 IPv4 on 9050, IPv6 on 9050, IPv6 on 9051 and
    * a different IPv6 on 9051. */
-  tt_int_op(smartlist_len(ports), OP_EQ, 3);
+  tt_int_op(smartlist_len(ports), OP_EQ, 4);
   tt_str_op(describe_relay_port(smartlist_get(ports, 0)), OP_EQ,
             "ORPort 9050");
   tt_str_op(describe_relay_port(smartlist_get(ports, 1)), OP_EQ,
             "ORPort [4242::1]:9051");
   tt_str_op(describe_relay_port(smartlist_get(ports, 2)), OP_EQ,
+            "ORPort [4242::2]:9051");
+  tt_str_op(describe_relay_port(smartlist_get(ports, 3)), OP_EQ,
             "ORPort 9050");
 
   /* Reset. Test different ORPort value. */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits