[tor-commits] [tor/master] test: Missing hs_init() in some hs_control tests

asn at torproject.org asn at torproject.org
Thu Feb 6 10:55:46 UTC 2020


commit a8456d2a11c35d7e707bb1395d56115227104b34
Author: David Goulet <dgoulet at torproject.org>
Date:   Tue Feb 4 09:56:25 2020 -0500

    test: Missing hs_init() in some hs_control tests
    
    Without the hs_init(), the caches are not initialized and the previous commit
    was causing an assert due to the missing caches.
    
    But regardless of that, those tests were not initializing but were calling
    hs_free_all().
    
    Signed-off-by: David Goulet <dgoulet at torproject.org>
---
 src/test/test_hs_control.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/test/test_hs_control.c b/src/test/test_hs_control.c
index dc0db18bd..881479016 100644
--- a/src/test/test_hs_control.c
+++ b/src/test/test_hs_control.c
@@ -218,6 +218,8 @@ test_hs_control_good_onion_client_auth_add(void *arg)
   char *cp1 = NULL;
   size_t sz;
 
+  hs_init();
+
   { /* Setup the control conn */
     memset(&conn, 0, sizeof(control_connection_t));
     TO_CONN(&conn)->outbuf = buf_new();
@@ -415,6 +417,8 @@ test_hs_control_bad_onion_client_auth_add(void *arg)
   size_t sz;
   char *args = NULL;
 
+  hs_init();
+
   { /* Setup the control conn */
     memset(&conn, 0, sizeof(control_connection_t));
     TO_CONN(&conn)->outbuf = buf_new();
@@ -493,6 +497,8 @@ test_hs_control_store_permanent_creds(void *arg)
 
   size_t sz;
 
+  hs_init();
+
   { /* Setup the control conn */
     memset(&conn, 0, sizeof(control_connection_t));
     TO_CONN(&conn)->outbuf = buf_new();



More information about the tor-commits mailing list