]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Revert "test: Add test_hs_circ.c for HS circuit testing"
authorMike Perry <mikeperry-git@torproject.org>
Wed, 5 Jun 2019 18:37:32 +0000 (11:37 -0700)
committerMike Perry <mikeperry-git@torproject.org>
Wed, 5 Jun 2019 18:37:32 +0000 (11:37 -0700)
This reverts commit 41b94722e5c93ec06911f9c63296a65ce295c1ea.

src/test/include.am
src/test/test.c
src/test/test.h
src/test/test_hs_circ.c [deleted file]

index fdfe96c5592418b30741989f75367e985b705572..85f9c9f88039f705615b2c46fdf7d52bbfac665a 100644 (file)
@@ -145,7 +145,6 @@ src_test_test_SOURCES += \
        src/test/test_hs_common.c \
        src/test/test_hs_config.c \
        src/test/test_hs_cell.c \
-       src/test/test_hs_circ.c \
        src/test/test_hs_ntor.c \
        src/test/test_hs_service.c \
        src/test/test_hs_client.c  \
index d7682b6619eb49cb9792f10bb2add1d7bd4e30ff..cac98dd839cd37b8aef84a9b599910b992794c69 100644 (file)
@@ -871,7 +871,6 @@ struct testgroup_t testgroups[] = {
   { "guardfraction/", guardfraction_tests },
   { "hs_cache/", hs_cache },
   { "hs_cell/", hs_cell_tests },
-  { "hs_circ/", hs_circ_tests },
   { "hs_client/", hs_client_tests },
   { "hs_common/", hs_common_tests },
   { "hs_config/", hs_config_tests },
index b108d795eac8638189d42c482c114ca4dc183639..167fd090ac4b303efaf3ba58b907143cfc8e5429 100644 (file)
@@ -221,7 +221,6 @@ extern struct testcase_t guardfraction_tests[];
 extern struct testcase_t handle_tests[];
 extern struct testcase_t hs_cache[];
 extern struct testcase_t hs_cell_tests[];
-extern struct testcase_t hs_circ_tests[];
 extern struct testcase_t hs_client_tests[];
 extern struct testcase_t hs_common_tests[];
 extern struct testcase_t hs_config_tests[];
diff --git a/src/test/test_hs_circ.c b/src/test/test_hs_circ.c
deleted file mode 100644 (file)
index af28af2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (c) 2017-2019, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-/**
- * \file test_hs_circ.c
- * \brief Test hidden service circuit functionality.
- */
-
-#define CIRCUITLIST_PRIVATE
-
-#include "test/test.h"
-#include "test/test_helpers.h"
-#include "test/log_test_helpers.h"
-
-#include "core/or/circuitbuild.h"
-#include "core/or/circuitlist.h"
-#include "core/or/circuituse.h"
-#include "core/or/origin_circuit_st.h"
-
-#include "feature/hs/hs_circuit.h"
-#include "feature/hs/hs_circuitmap.h"
-
-static void
-test_circuit_repurpose(void *arg)
-{
-  origin_circuit_t *intro_circ = NULL;
-  const origin_circuit_t *search;
-  ed25519_keypair_t kp;
-
-  (void) arg;
-
-  hs_init();
-
-  intro_circ = origin_circuit_init(CIRCUIT_PURPOSE_S_ESTABLISH_INTRO, 0);
-  tt_assert(intro_circ);
-  ed25519_keypair_generate(&kp, 0);
-
-  /* Register circuit in global map and make sure it is actually there. */
-  hs_circuitmap_register_intro_circ_v3_service_side(intro_circ,
-                                                    &kp.pubkey);
-  tt_assert(TO_CIRCUIT(intro_circ)->hs_token);
-  search = hs_circuitmap_get_intro_circ_v3_service_side(&kp.pubkey);
-  tt_mem_op(search, OP_EQ, intro_circ, sizeof(origin_circuit_t));
-
-  /* Setup circuit HS ident. We don't care about the service pubkey. */
-  intro_circ->hs_ident = hs_ident_circuit_new(&kp.pubkey,
-                                              HS_IDENT_CIRCUIT_INTRO);
-  tt_assert(intro_circ->hs_ident);
-
-  /* Trigger a repurpose. State should be cleaned up. */
-  hs_circ_repurpose(TO_CIRCUIT(intro_circ));
-
-  /* Removed from map. */
-  search = hs_circuitmap_get_intro_circ_v3_service_side(&kp.pubkey);
-  tt_assert(!search);
-  /* HS identifier has been removed. */
-  tt_assert(!intro_circ->hs_ident);
-
- done:
-  circuit_free_(TO_CIRCUIT(intro_circ));
-  hs_free_all();
-}
-
-struct testcase_t hs_circ_tests[] = {
-  { "repurpose", test_circuit_repurpose, TT_FORK,
-    NULL, NULL },
-
-  END_OF_TESTCASES
-};
-