aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-20 09:35:05 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-20 09:35:05 -0400
commit0dab29ce1069c2ebec22a75669aa8242fdc15882 (patch)
treec4db0ff4bef4870ac94c1d38135e4c0bf94d47d9 /src/test
parent257b28077676f6d8a3c0d2beef37a9414c747de9 (diff)
downloadtor-0dab29ce1069c2ebec22a75669aa8242fdc15882.tar.gz
tor-0dab29ce1069c2ebec22a75669aa8242fdc15882.zip
Run rectify_include_paths.py
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench.c22
-rw-r--r--src/test/fuzz/fuzz_consensus.c8
-rw-r--r--src/test/fuzz/fuzz_descriptor.c10
-rw-r--r--src/test/fuzz/fuzz_diff.c6
-rw-r--r--src/test/fuzz/fuzz_diff_apply.c6
-rw-r--r--src/test/fuzz/fuzz_extrainfo.c10
-rw-r--r--src/test/fuzz/fuzz_hsdescv2.c8
-rw-r--r--src/test/fuzz/fuzz_hsdescv3.c14
-rw-r--r--src/test/fuzz/fuzz_http.c18
-rw-r--r--src/test/fuzz/fuzz_http_connect.c26
-rw-r--r--src/test/fuzz/fuzz_iptsv2.c10
-rw-r--r--src/test/fuzz/fuzz_microdesc.c8
-rw-r--r--src/test/fuzz/fuzz_vrs.c16
-rw-r--r--src/test/fuzz/fuzzing_common.c12
-rw-r--r--src/test/hs_test_helpers.c12
-rw-r--r--src/test/hs_test_helpers.h4
-rw-r--r--src/test/log_test_helpers.c4
-rw-r--r--src/test/log_test_helpers.h2
-rw-r--r--src/test/rend_test_helpers.c16
-rw-r--r--src/test/rend_test_helpers.h2
-rw-r--r--src/test/test-memwipe.c6
-rw-r--r--src/test/test-timers.c10
-rw-r--r--src/test/test.c58
-rw-r--r--src/test/test.h2
-rw-r--r--src/test/test_accounting.c10
-rw-r--r--src/test/test_addr.c10
-rw-r--r--src/test/test_address.c8
-rw-r--r--src/test/test_address_set.c30
-rw-r--r--src/test/test_bridges.c16
-rw-r--r--src/test/test_bt_cl.c8
-rw-r--r--src/test/test_buffers.c14
-rw-r--r--src/test/test_bwmgt.c6
-rw-r--r--src/test/test_cell_formats.c34
-rw-r--r--src/test/test_cell_queue.c18
-rw-r--r--src/test/test_channel.c36
-rw-r--r--src/test/test_channelpadding.c38
-rw-r--r--src/test/test_channeltls.c24
-rw-r--r--src/test/test_checkdir.c8
-rw-r--r--src/test/test_circuitbuild.c16
-rw-r--r--src/test/test_circuitlist.c22
-rw-r--r--src/test/test_circuitmux.c18
-rw-r--r--src/test/test_circuitstats.c30
-rw-r--r--src/test/test_circuituse.c22
-rw-r--r--src/test/test_compat_libevent.c8
-rw-r--r--src/test/test_config.c78
-rw-r--r--src/test/test_connection.c46
-rw-r--r--src/test/test_conscache.c8
-rw-r--r--src/test/test_consdiff.c10
-rw-r--r--src/test/test_consdiffmgr.c30
-rw-r--r--src/test/test_containers.c8
-rw-r--r--src/test/test_controller.c32
-rw-r--r--src/test/test_controller_events.c18
-rw-r--r--src/test/test_crypto.c14
-rw-r--r--src/test/test_crypto_openssl.c12
-rw-r--r--src/test/test_crypto_slow.c10
-rw-r--r--src/test/test_data.c2
-rw-r--r--src/test/test_dir.c80
-rw-r--r--src/test/test_dir_common.c28
-rw-r--r--src/test/test_dir_common.h6
-rw-r--r--src/test/test_dir_handle_get.c62
-rw-r--r--src/test/test_dns.c14
-rw-r--r--src/test/test_dos.c34
-rw-r--r--src/test/test_entryconn.c24
-rw-r--r--src/test/test_entrynodes.c64
-rw-r--r--src/test/test_extorport.c26
-rw-r--r--src/test/test_geoip.c8
-rw-r--r--src/test/test_guardfraction.c32
-rw-r--r--src/test/test_handles.c6
-rw-r--r--src/test/test_helpers.c44
-rw-r--r--src/test/test_helpers.h2
-rw-r--r--src/test/test_hs.c32
-rw-r--r--src/test/test_hs_cache.c28
-rw-r--r--src/test/test_hs_cell.c18
-rw-r--r--src/test/test_hs_client.c62
-rw-r--r--src/test/test_hs_common.c54
-rw-r--r--src/test/test_hs_config.c18
-rw-r--r--src/test/test_hs_control.c24
-rw-r--r--src/test/test_hs_descriptor.c24
-rw-r--r--src/test/test_hs_intropoint.c34
-rw-r--r--src/test/test_hs_ntor.c8
-rw-r--r--src/test/test_hs_ntor_cl.c14
-rw-r--r--src/test/test_hs_service.c76
-rw-r--r--src/test/test_introduce.c8
-rw-r--r--src/test/test_keypin.c8
-rw-r--r--src/test/test_link_handshake.c40
-rw-r--r--src/test/test_logging.c6
-rw-r--r--src/test/test_mainloop.c8
-rw-r--r--src/test/test_microdesc.c30
-rw-r--r--src/test/test_nodelist.c26
-rw-r--r--src/test/test_ntor_cl.c12
-rw-r--r--src/test/test_oom.c30
-rw-r--r--src/test/test_oos.c18
-rw-r--r--src/test/test_options.c26
-rw-r--r--src/test/test_periodic_event.c18
-rw-r--r--src/test/test_policy.c20
-rw-r--r--src/test/test_procmon.c8
-rw-r--r--src/test/test_proto_http.c10
-rw-r--r--src/test/test_proto_misc.c18
-rw-r--r--src/test/test_protover.c8
-rw-r--r--src/test/test_pt.c18
-rw-r--r--src/test/test_pubsub.c6
-rw-r--r--src/test/test_relay.c16
-rw-r--r--src/test/test_relaycell.c32
-rw-r--r--src/test/test_relaycrypt.c20
-rw-r--r--src/test/test_rendcache.c32
-rw-r--r--src/test/test_replay.c6
-rw-r--r--src/test/test_router.c16
-rw-r--r--src/test/test_routerkeys.c16
-rw-r--r--src/test/test_routerlist.c60
-rw-r--r--src/test/test_routerset.c26
-rw-r--r--src/test/test_scheduler.c20
-rw-r--r--src/test/test_shared_random.c36
-rw-r--r--src/test/test_slow.c4
-rw-r--r--src/test/test_socks.c14
-rw-r--r--src/test/test_status.c34
-rw-r--r--src/test/test_storagedir.c8
-rw-r--r--src/test/test_switch_id.c2
-rw-r--r--src/test/test_threads.c6
-rw-r--r--src/test/test_tortls.c14
-rw-r--r--src/test/test_util.c20
-rw-r--r--src/test/test_util_format.c8
-rw-r--r--src/test/test_util_process.c8
-rw-r--r--src/test/test_util_slow.c10
-rw-r--r--src/test/test_voting_schedule.c6
-rw-r--r--src/test/test_workqueue.c14
-rw-r--r--src/test/testing_common.c20
-rw-r--r--src/test/testing_rsakeys.c6
127 files changed, 1264 insertions, 1264 deletions
diff --git a/src/test/bench.c b/src/test/bench.c
index f1f19411d3..f54d8f5c60 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -10,24 +10,24 @@
#include "orconfig.h"
-#include "or.h"
-#include "onion_tap.h"
-#include "relay_crypto.h"
+#include "or/or.h"
+#include "or/onion_tap.h"
+#include "or/relay_crypto.h"
#include <openssl/opensslv.h>
#include <openssl/evp.h>
#include <openssl/ec.h>
#include <openssl/ecdh.h>
#include <openssl/obj_mac.h>
-#include "config.h"
-#include "crypto_curve25519.h"
-#include "onion_ntor.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
-#include "consdiff.h"
+#include "or/config.h"
+#include "common/crypto_curve25519.h"
+#include "or/onion_ntor.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
+#include "or/consdiff.h"
-#include "cell_st.h"
-#include "or_circuit_st.h"
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
static uint64_t nanostart;
diff --git a/src/test/fuzz/fuzz_consensus.c b/src/test/fuzz/fuzz_consensus.c
index 9761c27ad2..de54da61b8 100644
--- a/src/test/fuzz/fuzz_consensus.c
+++ b/src/test/fuzz/fuzz_consensus.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "networkstatus.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/networkstatus.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_descriptor.c b/src/test/fuzz/fuzz_descriptor.c
index 3b5af883f5..d28793fdf3 100644
--- a/src/test/fuzz/fuzz_descriptor.c
+++ b/src/test/fuzz/fuzz_descriptor.c
@@ -1,11 +1,11 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "routerlist.h"
-#include "routerkeys.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/routerlist.h"
+#include "or/routerkeys.h"
+#include "test/fuzz/fuzzing.h"
static int
mock_check_tap_onion_key_crosscert__nocheck(const uint8_t *crosscert,
diff --git a/src/test/fuzz/fuzz_diff.c b/src/test/fuzz/fuzz_diff.c
index 91ecfe3099..eb5fc27e08 100644
--- a/src/test/fuzz/fuzz_diff.c
+++ b/src/test/fuzz/fuzz_diff.c
@@ -4,10 +4,10 @@
#define CONSDIFF_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "consdiff.h"
+#include "or/or.h"
+#include "or/consdiff.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static int
mock_consensus_compute_digest_(const char *c, consensus_digest_t *d)
diff --git a/src/test/fuzz/fuzz_diff_apply.c b/src/test/fuzz/fuzz_diff_apply.c
index 589406e076..76789fabcd 100644
--- a/src/test/fuzz/fuzz_diff_apply.c
+++ b/src/test/fuzz/fuzz_diff_apply.c
@@ -4,10 +4,10 @@
#define CONSDIFF_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "consdiff.h"
+#include "or/or.h"
+#include "or/consdiff.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static int
mock_consensus_compute_digest_(const char *c, consensus_digest_t *d)
diff --git a/src/test/fuzz/fuzz_extrainfo.c b/src/test/fuzz/fuzz_extrainfo.c
index a3f10f6a36..274ecc7866 100644
--- a/src/test/fuzz/fuzz_extrainfo.c
+++ b/src/test/fuzz/fuzz_extrainfo.c
@@ -1,11 +1,11 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "routerlist.h"
-#include "routerkeys.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/routerlist.h"
+#include "or/routerkeys.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_hsdescv2.c b/src/test/fuzz/fuzz_hsdescv2.c
index 1dd41c857b..5cf2cffb88 100644
--- a/src/test/fuzz/fuzz_hsdescv2.c
+++ b/src/test/fuzz/fuzz_hsdescv2.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "rendcommon.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/rendcommon.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c
index e6c553ba67..d1ef34b6b3 100644
--- a/src/test/fuzz/fuzz_hsdescv3.c
+++ b/src/test/fuzz/fuzz_hsdescv3.c
@@ -4,14 +4,14 @@
#define ROUTERPARSE_PRIVATE
#define HS_DESCRIPTOR_PRIVATE
-#include "or.h"
-#include "ed25519_cert.h" /* Trunnel interface. */
-#include "crypto_ed25519.h"
-#include "hs_descriptor.h"
-#include "routerparse.h"
-#include "util.h"
+#include "or/or.h"
+#include "trunnel/ed25519_cert.h" /* Trunnel interface. */
+#include "common/crypto_ed25519.h"
+#include "or/hs_descriptor.h"
+#include "or/routerparse.h"
+#include "common/util.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_http.c b/src/test/fuzz/fuzz_http.c
index 99e3102c5e..a5be26df4f 100644
--- a/src/test/fuzz/fuzz_http.c
+++ b/src/test/fuzz/fuzz_http.c
@@ -6,17 +6,17 @@
#define BUFFERS_PRIVATE
#define DIRECTORY_PRIVATE
-#include "or.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "config.h"
-#include "connection.h"
-#include "directory.h"
-#include "torlog.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/directory.h"
+#include "common/torlog.h"
-#include "dir_connection_st.h"
+#include "or/dir_connection_st.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_connection_write_to_buf_impl_(const char *string, size_t len,
diff --git a/src/test/fuzz/fuzz_http_connect.c b/src/test/fuzz/fuzz_http_connect.c
index d1db654dfe..6640075023 100644
--- a/src/test/fuzz/fuzz_http_connect.c
+++ b/src/test/fuzz/fuzz_http_connect.c
@@ -6,19 +6,19 @@
#define BUFFERS_PRIVATE
#define CONNECTION_EDGE_PRIVATE
-#include "or.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "proto_socks.h"
-#include "torlog.h"
-
-#include "entry_connection_st.h"
-#include "socks_request_st.h"
-
-#include "fuzzing.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/proto_socks.h"
+#include "common/torlog.h"
+
+#include "or/entry_connection_st.h"
+#include "or/socks_request_st.h"
+
+#include "test/fuzz/fuzzing.h"
static void
mock_connection_write_to_buf_impl_(const char *string, size_t len,
diff --git a/src/test/fuzz/fuzz_iptsv2.c b/src/test/fuzz/fuzz_iptsv2.c
index 5a44ca5a9e..7bf4d1282e 100644
--- a/src/test/fuzz/fuzz_iptsv2.c
+++ b/src/test/fuzz/fuzz_iptsv2.c
@@ -1,13 +1,13 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "rendcommon.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/rendcommon.h"
-#include "rend_service_descriptor_st.h"
+#include "or/rend_service_descriptor_st.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_microdesc.c b/src/test/fuzz/fuzz_microdesc.c
index 02fde6c379..74e0ef4f46 100644
--- a/src/test/fuzz/fuzz_microdesc.c
+++ b/src/test/fuzz/fuzz_microdesc.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "microdesc.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/microdesc.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_vrs.c b/src/test/fuzz/fuzz_vrs.c
index 3e47c46d40..8126f8e48f 100644
--- a/src/test/fuzz/fuzz_vrs.c
+++ b/src/test/fuzz/fuzz_vrs.c
@@ -2,16 +2,16 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#define NETWORKSTATUS_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "memarea.h"
-#include "microdesc.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "common/memarea.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
-#include "networkstatus_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/networkstatus_st.h"
+#include "or/vote_routerstatus_st.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzzing_common.c b/src/test/fuzz/fuzzing_common.c
index 4111be598f..b2fc85a497 100644
--- a/src/test/fuzz/fuzzing_common.c
+++ b/src/test/fuzz/fuzzing_common.c
@@ -2,12 +2,12 @@
/* See LICENSE for licensing information */
#define CRYPTO_ED25519_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "backtrace.h"
-#include "config.h"
-#include "fuzzing.h"
-#include "crypto.h"
-#include "crypto_ed25519.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "or/config.h"
+#include "test/fuzz/fuzzing.h"
+#include "common/crypto.h"
+#include "common/crypto_ed25519.h"
static or_options_t *mock_options = NULL;
static const or_options_t *
diff --git a/src/test/hs_test_helpers.c b/src/test/hs_test_helpers.c
index 0b79004e26..ea12970b92 100644
--- a/src/test/hs_test_helpers.c
+++ b/src/test/hs_test_helpers.c
@@ -1,13 +1,13 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_ed25519.h"
-#include "test.h"
-#include "torcert.h"
+#include "or/or.h"
+#include "common/crypto_ed25519.h"
+#include "test/test.h"
+#include "or/torcert.h"
-#include "hs_common.h"
-#include "hs_test_helpers.h"
+#include "or/hs_common.h"
+#include "test/hs_test_helpers.h"
hs_desc_intro_point_t *
hs_helper_build_intro_point(const ed25519_keypair_t *signing_kp, time_t now,
diff --git a/src/test/hs_test_helpers.h b/src/test/hs_test_helpers.h
index d1bb30c167..5c0262207a 100644
--- a/src/test/hs_test_helpers.h
+++ b/src/test/hs_test_helpers.h
@@ -4,8 +4,8 @@
#ifndef TOR_HS_TEST_HELPERS_H
#define TOR_HS_TEST_HELPERS_H
-#include "ed25519_cert.h"
-#include "hs_descriptor.h"
+#include "trunnel/ed25519_cert.h"
+#include "or/hs_descriptor.h"
/* Set of functions to help build and test descriptors. */
hs_desc_intro_point_t *hs_helper_build_intro_point(
diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index 7a4412c2b2..03429b72cb 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -1,8 +1,8 @@
/* Copyright (c) 2015-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define LOG_PRIVATE
-#include "torlog.h"
-#include "log_test_helpers.h"
+#include "common/torlog.h"
+#include "test/log_test_helpers.h"
/**
* \file log_test_helpers.c
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index 8125b1c6cc..7c38504527 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -1,7 +1,7 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#ifndef TOR_LOG_TEST_HELPERS_H
#define TOR_LOG_TEST_HELPERS_H
diff --git a/src/test/rend_test_helpers.c b/src/test/rend_test_helpers.c
index 2844629610..6f0c1c121b 100644
--- a/src/test/rend_test_helpers.c
+++ b/src/test/rend_test_helpers.c
@@ -1,15 +1,15 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_rand.h"
-#include "test.h"
-#include "rendcommon.h"
-#include "rend_test_helpers.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "test/test.h"
+#include "or/rendcommon.h"
+#include "test/rend_test_helpers.h"
-#include "extend_info_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
+#include "or/extend_info_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
void
generate_desc(int time_diff, rend_encoded_v2_service_descriptor_t **desc,
diff --git a/src/test/rend_test_helpers.h b/src/test/rend_test_helpers.h
index 13846acd44..aca675b2a4 100644
--- a/src/test/rend_test_helpers.h
+++ b/src/test/rend_test_helpers.h
@@ -1,7 +1,7 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#ifndef TOR_REND_TEST_HELPERS_H
#define TOR_REND_TEST_HELPERS_H
diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c
index 452a440140..a8326aa671 100644
--- a/src/test/test-memwipe.c
+++ b/src/test/test-memwipe.c
@@ -7,9 +7,9 @@
#include <sys/types.h>
#include <stdlib.h>
-#include "crypto_util.h"
-#include "compat.h"
-#include "util.h"
+#include "common/crypto_util.h"
+#include "common/compat.h"
+#include "common/util.h"
static unsigned fill_a_buffer_memset(void) __attribute__((noinline));
static unsigned fill_a_buffer_memwipe(void) __attribute__((noinline));
diff --git a/src/test/test-timers.c b/src/test/test-timers.c
index 6636869aff..1953ea5e31 100644
--- a/src/test/test-timers.c
+++ b/src/test/test-timers.c
@@ -7,11 +7,11 @@
#include <stdio.h>
#include <string.h>
-#include "compat.h"
-#include "compat_libevent.h"
-#include "crypto_rand.h"
-#include "timers.h"
-#include "util.h"
+#include "common/compat.h"
+#include "common/compat_libevent.h"
+#include "common/crypto_rand.h"
+#include "common/timers.h"
+#include "common/util.h"
#define N_TIMERS 1000
#define MAX_DURATION 30
diff --git a/src/test/test.c b/src/test/test.c
index 8ae172538b..98f554b319 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -9,7 +9,7 @@
**/
#include "orconfig.h"
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#include <stdio.h>
#ifdef HAVE_FCNTL_H
@@ -39,34 +39,34 @@
long int lround(double x);
double fabs(double x);
-#include "or.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "compress.h"
-#include "config.h"
-#include "connection_edge.h"
-#include "rendcommon.h"
-#include "rendcache.h"
-#include "test.h"
-#include "main.h"
-#include "memarea.h"
-#include "onion.h"
-#include "onion_ntor.h"
-#include "onion_fast.h"
-#include "onion_tap.h"
-#include "policies.h"
-#include "rephist.h"
-#include "routerparse.h"
-#include "statefile.h"
-#include "crypto_curve25519.h"
-
-#include "extend_info_st.h"
-#include "or_circuit_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "common/compress.h"
+#include "or/config.h"
+#include "or/connection_edge.h"
+#include "or/rendcommon.h"
+#include "or/rendcache.h"
+#include "test/test.h"
+#include "or/main.h"
+#include "common/memarea.h"
+#include "or/onion.h"
+#include "or/onion_ntor.h"
+#include "or/onion_fast.h"
+#include "or/onion_tap.h"
+#include "or/policies.h"
+#include "or/rephist.h"
+#include "or/routerparse.h"
+#include "or/statefile.h"
+#include "common/crypto_curve25519.h"
+
+#include "or/extend_info_st.h"
+#include "or/or_circuit_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
/** Run unit tests for the onion handshake code. */
static void
diff --git a/src/test/test.h b/src/test/test.h
index 7cbebcb6a1..29e6544697 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -13,7 +13,7 @@
#define DEBUG_SMARTLIST 1
-#include "compat.h"
+#include "common/compat.h"
#include "tinytest.h"
#define TT_EXIT_TEST_FUNCTION STMT_BEGIN goto done; STMT_END
#include "tinytest_macros.h"
diff --git a/src/test/test_accounting.c b/src/test/test_accounting.c
index 9e16c09edf..ce8e08f7c9 100644
--- a/src/test/test_accounting.c
+++ b/src/test/test_accounting.c
@@ -1,13 +1,13 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
#define HIBERNATE_PRIVATE
-#include "hibernate.h"
-#include "config.h"
+#include "or/hibernate.h"
+#include "or/config.h"
#define STATEFILE_PRIVATE
-#include "statefile.h"
+#include "or/statefile.h"
#define NS_MODULE accounting
diff --git a/src/test/test_addr.c b/src/test/test_addr.c
index b61a9478c3..6778fde974 100644
--- a/src/test/test_addr.c
+++ b/src/test/test_addr.c
@@ -5,11 +5,11 @@
#define ADDRESSMAP_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "crypto_rand.h"
-#include "test.h"
-#include "addressmap.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "test/test.h"
+#include "or/addressmap.h"
+#include "test/log_test_helpers.h"
/** Mocking replacement: only handles localhost. */
static int
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 1a0f163535..38a5310ede 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -23,10 +23,10 @@
#include <net/if.h>
#endif /* defined(HAVE_IFCONF_TO_SMARTLIST) */
-#include "or.h"
-#include "address.h"
-#include "test.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
/** Return 1 iff <b>sockaddr1</b> and <b>sockaddr2</b> represent
* the same IP address and port combination. Otherwise, return 0.
diff --git a/src/test/test_address_set.c b/src/test/test_address_set.c
index 0ed9987a26..1df7b34422 100644
--- a/src/test/test_address_set.c
+++ b/src/test/test_address_set.c
@@ -1,21 +1,21 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_rand.h"
-#include "address_set.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "routerlist.h"
-#include "torcert.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "common/address_set.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+#include "or/torcert.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
static networkstatus_t *dummy_ns = NULL;
static networkstatus_t *
diff --git a/src/test/test_bridges.c b/src/test/test_bridges.c
index c44f791e0d..c1de731b2d 100644
--- a/src/test/test_bridges.c
+++ b/src/test/test_bridges.c
@@ -11,16 +11,16 @@
#include <stdbool.h>
-#include "or.h"
-#include "address.h"
-#include "bridges.h"
-#include "config.h"
-#include "container.h"
-#include "transports.h"
-#include "util.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "or/bridges.h"
+#include "or/config.h"
+#include "common/container.h"
+#include "or/transports.h"
+#include "common/util.h"
/* Test suite stuff */
-#include "test.h"
+#include "test/test.h"
/**
* A mocked transport_t, constructed via mock_transport_get_by_name().
diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c
index 9f16f8f50c..d2d167ac33 100644
--- a/src/test/test_bt_cl.c
+++ b/src/test/test_bt_cl.c
@@ -7,10 +7,10 @@
/* To prevent 'assert' from going away. */
#undef TOR_COVERAGE
-#include "or.h"
-#include "util.h"
-#include "backtrace.h"
-#include "torlog.h"
+#include "or/or.h"
+#include "common/util.h"
+#include "common/backtrace.h"
+#include "common/torlog.h"
/* -1: no crash.
* 0: crash with a segmentation fault.
diff --git a/src/test/test_buffers.c b/src/test/test_buffers.c
index 0828e720fc..cd4c9d0aef 100644
--- a/src/test/test_buffers.c
+++ b/src/test/test_buffers.c
@@ -5,13 +5,13 @@
#define BUFFERS_PRIVATE
#define PROTO_HTTP_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "buffers_tls.h"
-#include "crypto_rand.h"
-#include "proto_http.h"
-#include "proto_socks.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "common/buffers_tls.h"
+#include "common/crypto_rand.h"
+#include "or/proto_http.h"
+#include "or/proto_socks.h"
+#include "test/test.h"
/** Run unit tests for buffers.c */
static void
diff --git a/src/test/test_bwmgt.c b/src/test/test_bwmgt.c
index 268917005e..90c1b457d7 100644
--- a/src/test/test_bwmgt.c
+++ b/src/test/test_bwmgt.c
@@ -8,10 +8,10 @@
#define TOKEN_BUCKET_PRIVATE
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "token_bucket.h"
+#include "common/token_bucket.h"
// an imaginary time, in timestamp units. Chosen so it will roll over.
static const uint32_t START_TS = UINT32_MAX-10;
diff --git a/src/test/test_cell_formats.c b/src/test/test_cell_formats.c
index 4b73aa9b50..685b6efc36 100644
--- a/src/test/test_cell_formats.c
+++ b/src/test/test_cell_formats.c
@@ -7,23 +7,23 @@
#define CONNECTION_EDGE_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "onion.h"
-#include "onion_tap.h"
-#include "onion_fast.h"
-#include "onion_ntor.h"
-#include "relay.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "var_cell_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/onion.h"
+#include "or/onion_tap.h"
+#include "or/onion_fast.h"
+#include "or/onion_ntor.h"
+#include "or/relay.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/var_cell_st.h"
+
+#include "test/test.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/test/test_cell_queue.c b/src/test/test_cell_queue.c
index 7662cad105..3369511afc 100644
--- a/src/test/test_cell_queue.c
+++ b/src/test/test_cell_queue.c
@@ -3,15 +3,15 @@
#define CIRCUITLIST_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "circuitlist.h"
-#include "relay.h"
-#include "test.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/relay.h"
+#include "test/test.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
static void
test_cq_manip(void *arg)
diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index b7f7653dbf..5b30c71123 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -3,33 +3,33 @@
#define TOR_CHANNEL_INTERNAL_
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "channel.h"
+#include "or/or.h"
+#include "or/channel.h"
/* For channel_note_destroy_not_pending */
#define CIRCUITLIST_PRIVATE
-#include "circuitlist.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
+#include "or/circuitlist.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
/* For var_cell_free */
-#include "connection_or.h"
-#include "crypto_rand.h"
+#include "or/connection_or.h"
+#include "common/crypto_rand.h"
/* For packed_cell stuff */
#define RELAY_PRIVATE
-#include "relay.h"
+#include "or/relay.h"
/* For init/free stuff */
-#include "scheduler.h"
-#include "networkstatus.h"
+#include "or/scheduler.h"
+#include "or/networkstatus.h"
-#include "cell_st.h"
-#include "networkstatus_st.h"
-#include "origin_circuit_st.h"
-#include "routerstatus_st.h"
-#include "var_cell_st.h"
+#include "or/cell_st.h"
+#include "or/networkstatus_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerstatus_st.h"
+#include "or/var_cell_st.h"
/* Test suite stuff */
-#include "log_test_helpers.h"
-#include "test.h"
-#include "fakechans.h"
+#include "test/log_test_helpers.h"
+#include "test/test.h"
+#include "test/fakechans.h"
static int test_chan_accept_cells = 0;
static int test_chan_fixed_cells_recved = 0;
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index 630d4ba60d..b48bf0f162 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -5,25 +5,25 @@
#define MAIN_PRIVATE
#define NETWORKSTATUS_PRIVATE
#define TOR_TIMERS_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "testsupport.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "channelpadding.h"
-#include "compat_libevent.h"
-#include "config.h"
-#include "compat_time.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "log_test_helpers.h"
-
-#include "cell_st.h"
-#include "networkstatus_st.h"
-#include "or_connection_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/testsupport.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/channelpadding.h"
+#include "common/compat_libevent.h"
+#include "or/config.h"
+#include "common/compat_time.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "test/log_test_helpers.h"
+
+#include "or/cell_st.h"
+#include "or/networkstatus_st.h"
+#include "or/or_connection_st.h"
+#include "or/routerstatus_st.h"
int channelpadding_get_netflow_inactive_timeout_ms(channel_t *chan);
int64_t channelpadding_compute_time_until_pad_for_netflow(channel_t *chan);
diff --git a/src/test/test_channeltls.c b/src/test/test_channeltls.c
index b6d2746aa1..08fec2de24 100644
--- a/src/test/test_channeltls.c
+++ b/src/test/test_channeltls.c
@@ -6,22 +6,22 @@
#include <math.h>
#define TOR_CHANNEL_INTERNAL_
-#include "or.h"
-#include "address.h"
-#include "buffers.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "connection_or.h"
-#include "config.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "common/buffers.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/connection_or.h"
+#include "or/config.h"
/* For init/free stuff */
-#include "scheduler.h"
-#include "tortls.h"
+#include "or/scheduler.h"
+#include "common/tortls.h"
-#include "or_connection_st.h"
+#include "or/or_connection_st.h"
/* Test suite stuff */
-#include "test.h"
-#include "fakechans.h"
+#include "test/test.h"
+#include "test/fakechans.h"
/* The channeltls unit tests */
static void test_channeltls_create(void *arg);
diff --git a/src/test/test_checkdir.c b/src/test/test_checkdir.c
index c2a44d1270..d0c899a07e 100644
--- a/src/test/test_checkdir.c
+++ b/src/test/test_checkdir.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
#ifdef _WIN32
#include <direct.h>
@@ -10,9 +10,9 @@
#include <dirent.h>
#endif
-#include "config.h"
-#include "test.h"
-#include "util.h"
+#include "or/config.h"
+#include "test/test.h"
+#include "common/util.h"
#ifdef _WIN32
#define mkdir(a,b) mkdir(a)
diff --git a/src/test/test_circuitbuild.c b/src/test/test_circuitbuild.c
index 1dde24ab96..d17a04614c 100644
--- a/src/test/test_circuitbuild.c
+++ b/src/test/test_circuitbuild.c
@@ -5,14 +5,14 @@
#define CIRCUITBUILD_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "config.h"
-#include "circuitbuild.h"
-
-#include "extend_info_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "or/config.h"
+#include "or/circuitbuild.h"
+
+#include "or/extend_info_st.h"
/* Dummy nodes smartlist for testing */
static smartlist_t dummy_nodes;
diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index 6f8f23ef1d..96de2eed04 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -5,17 +5,17 @@
#define CIRCUITBUILD_PRIVATE
#define CIRCUITLIST_PRIVATE
#define HS_CIRCUITMAP_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitmux_ewma.h"
-#include "hs_circuitmap.h"
-#include "test.h"
-#include "log_test_helpers.h"
-
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitmux_ewma.h"
+#include "or/hs_circuitmap.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
static channel_t *
new_fake_channel(void)
diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 4ed92f20f3..8a89927df9 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -5,15 +5,15 @@
#define CIRCUITMUX_PRIVATE
#define CIRCUITMUX_EWMA_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
-#include "relay.h"
-#include "scheduler.h"
-#include "test.h"
-
-#include "destroy_cell_queue_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
+#include "or/relay.h"
+#include "or/scheduler.h"
+#include "test/test.h"
+
+#include "or/destroy_cell_queue_st.h"
/* XXXX duplicated function from test_circuitlist.c */
static channel_t *
diff --git a/src/test/test_circuitstats.c b/src/test/test_circuitstats.c
index 79cf126fb4..94ba6ed448 100644
--- a/src/test/test_circuitstats.c
+++ b/src/test/test_circuitstats.c
@@ -6,21 +6,21 @@
#define CIRCUITLIST_PRIVATE
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "config.h"
-#include "circuitlist.h"
-#include "circuitbuild.h"
-#include "circuitstats.h"
-#include "circuituse.h"
-#include "channel.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "extend_info_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "or/config.h"
+#include "or/circuitlist.h"
+#include "or/circuitbuild.h"
+#include "or/circuitstats.h"
+#include "or/circuituse.h"
+#include "or/channel.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/extend_info_st.h"
+#include "or/origin_circuit_st.h"
void test_circuitstats_timeout(void *arg);
void test_circuitstats_hoplen(void *arg);
diff --git a/src/test/test_circuituse.c b/src/test/test_circuituse.c
index 3417d2e9ef..2524e43c68 100644
--- a/src/test/test_circuituse.c
+++ b/src/test/test_circuituse.c
@@ -5,17 +5,17 @@
#define CIRCUITLIST_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "test_helpers.h"
-#include "config.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "circuitbuild.h"
-#include "nodelist.h"
-
-#include "cpath_build_state_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "or/config.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/circuitbuild.h"
+#include "or/nodelist.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/origin_circuit_st.h"
static void
test_circuit_is_available_for_use_ret_false_when_marked_for_close(void *arg)
diff --git a/src/test/test_compat_libevent.c b/src/test/test_compat_libevent.c
index 292148d426..8e59137856 100644
--- a/src/test/test_compat_libevent.c
+++ b/src/test/test_compat_libevent.c
@@ -3,15 +3,15 @@
#define COMPAT_LIBEVENT_PRIVATE
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
-#include "compat_libevent.h"
+#include "common/compat_libevent.h"
#include <event2/event.h>
-#include "log_test_helpers.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE compat_libevent
diff --git a/src/test/test_config.c b/src/test/test_config.c
index a0a015a49b..177368c655 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -8,45 +8,45 @@
#define CONFIG_PRIVATE
#define PT_PRIVATE
#define ROUTERSET_PRIVATE
-#include "or.h"
-#include "address.h"
-#include "addressmap.h"
-#include "bridges.h"
-#include "circuitmux_ewma.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "test.h"
-#include "util.h"
-#include "connection_or.h"
-#include "control.h"
-#include "cpuworker.h"
-#include "dirserv.h"
-#include "dirauth/dirvote.h"
-#include "dns.h"
-#include "entrynodes.h"
-#include "transports.h"
-#include "ext_orport.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "rendclient.h"
-#include "rendservice.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "statefile.h"
-
-#include "test_helpers.h"
-
-#include "dir_server_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "or/addressmap.h"
+#include "or/bridges.h"
+#include "or/circuitmux_ewma.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "test/test.h"
+#include "common/util.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "or/cpuworker.h"
+#include "or/dirserv.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dns.h"
+#include "or/entrynodes.h"
+#include "or/transports.h"
+#include "or/ext_orport.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/rendclient.h"
+#include "or/rendservice.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/statefile.h"
+
+#include "test/test_helpers.h"
+
+#include "or/dir_server_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
static void
test_config_addressmap(void *arg)
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index db273e3ec3..674e2284e6 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -7,29 +7,29 @@
#define MAIN_PRIVATE
#define CONNECTION_OR_PRIVATE
-#include "or.h"
-#include "test.h"
-
-#include "connection.h"
-#include "connection_edge.h"
-#include "hs_common.h"
-#include "main.h"
-#include "microdesc.h"
-#include "nodelist.h"
-#include "networkstatus.h"
-#include "rendcache.h"
-#include "directory.h"
-#include "connection_or.h"
-
-#include "test_connection.h"
-#include "test_helpers.h"
-
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "node_st.h"
-#include "or_connection_st.h"
-#include "routerinfo_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "test/test.h"
+
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/hs_common.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/nodelist.h"
+#include "or/networkstatus.h"
+#include "or/rendcache.h"
+#include "or/directory.h"
+#include "or/connection_or.h"
+
+#include "test/test_connection.h"
+#include "test/test_helpers.h"
+
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/node_st.h"
+#include "or/or_connection_st.h"
+#include "or/routerinfo_st.h"
+#include "or/socks_request_st.h"
static void * test_conn_get_basic_setup(const struct testcase_t *tc);
static int test_conn_get_basic_teardown(const struct testcase_t *tc,
diff --git a/src/test/test_conscache.c b/src/test/test_conscache.c
index fb5e4c842c..e3a617fe3e 100644
--- a/src/test/test_conscache.c
+++ b/src/test/test_conscache.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "config.h"
-#include "conscache.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/conscache.h"
+#include "test/test.h"
#ifdef HAVE_UTIME_H
#include <utime.h>
diff --git a/src/test/test_consdiff.c b/src/test/test_consdiff.c
index cb02036795..e293866f3d 100644
--- a/src/test/test_consdiff.c
+++ b/src/test/test_consdiff.c
@@ -4,12 +4,12 @@
#define CONSDIFF_PRIVATE
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "consdiff.h"
-#include "memarea.h"
-#include "log_test_helpers.h"
+#include "or/consdiff.h"
+#include "common/memarea.h"
+#include "test/log_test_helpers.h"
#define tt_str_eq_line(a,b) \
tt_assert(line_str_eq((b),(a)))
diff --git a/src/test/test_consdiffmgr.c b/src/test/test_consdiffmgr.c
index a8f862fdb0..c4b89ddf03 100644
--- a/src/test/test_consdiffmgr.c
+++ b/src/test/test_consdiffmgr.c
@@ -3,21 +3,21 @@
#define CONSDIFFMGR_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "conscache.h"
-#include "consdiff.h"
-#include "consdiffmgr.h"
-#include "cpuworker.h"
-#include "crypto_rand.h"
-#include "networkstatus.h"
-#include "routerparse.h"
-#include "workqueue.h"
-
-#include "networkstatus_st.h"
-
-#include "test.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/conscache.h"
+#include "or/consdiff.h"
+#include "or/consdiffmgr.h"
+#include "or/cpuworker.h"
+#include "common/crypto_rand.h"
+#include "or/networkstatus.h"
+#include "or/routerparse.h"
+#include "common/workqueue.h"
+
+#include "or/networkstatus_st.h"
+
+#include "test/test.h"
+#include "test/log_test_helpers.h"
// ============================== Setup/teardown the consdiffmgr
// These functions get run before/after each test in this module
diff --git a/src/test/test_containers.c b/src/test/test_containers.c
index 72a02863f1..1d5ee4fc97 100644
--- a/src/test/test_containers.c
+++ b/src/test/test_containers.c
@@ -4,10 +4,10 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
-#include "crypto_rand.h"
-#include "fp_pair.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "or/fp_pair.h"
+#include "test/test.h"
/** Helper: return a tristate based on comparing the strings in *<b>a</b> and
* *<b>b</b>. */
diff --git a/src/test/test_controller.c b/src/test/test_controller.c
index 4044a841e3..de8e4630cd 100644
--- a/src/test/test_controller.c
+++ b/src/test/test_controller.c
@@ -2,22 +2,22 @@
/* See LICENSE for licensing information */
#define CONTROL_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "control.h"
-#include "entrynodes.h"
-#include "hs_common.h"
-#include "networkstatus.h"
-#include "rendservice.h"
-#include "routerlist.h"
-#include "nodelist.h"
-#include "test.h"
-#include "test_helpers.h"
-
-#include "control_connection_st.h"
-#include "download_status_st.h"
-#include "microdesc_st.h"
-#include "node_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/control.h"
+#include "or/entrynodes.h"
+#include "or/hs_common.h"
+#include "or/networkstatus.h"
+#include "or/rendservice.h"
+#include "or/routerlist.h"
+#include "or/nodelist.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+
+#include "or/control_connection_st.h"
+#include "or/download_status_st.h"
+#include "or/microdesc_st.h"
+#include "or/node_st.h"
static void
test_add_onion_helper_keyarg_v3(void *arg)
diff --git a/src/test/test_controller_events.c b/src/test/test_controller_events.c
index 5f0de3d385..b642a37d22 100644
--- a/src/test/test_controller_events.c
+++ b/src/test/test_controller_events.c
@@ -4,15 +4,15 @@
#define CONNECTION_PRIVATE
#define TOR_CHANNEL_INTERNAL_
#define CONTROL_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "connection.h"
-#include "control.h"
-#include "test.h"
-
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/connection.h"
+#include "or/control.h"
+#include "test/test.h"
+
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
static void
add_testing_cell_stats_entry(circuit_t *circ, uint8_t command,
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index ffe4983cdc..ed4c0b05f2 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -6,14 +6,14 @@
#include "orconfig.h"
#define CRYPTO_CURVE25519_PRIVATE
#define CRYPTO_RAND_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "aes.h"
-#include "util.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/aes.h"
+#include "common/util.h"
#include "siphash.h"
-#include "crypto_curve25519.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
#include "ed25519_vectors.inc"
/** Run unit tests for Diffie-Hellman functionality. */
diff --git a/src/test/test_crypto_openssl.c b/src/test/test_crypto_openssl.c
index 910d5cbe84..f33ed58d40 100644
--- a/src/test/test_crypto_openssl.c
+++ b/src/test/test_crypto_openssl.c
@@ -7,15 +7,15 @@
#define CRYPTO_RAND_PRIVATE
-#include "crypto_rand.h"
-#include "util.h"
-#include "util_format.h"
-#include "compat.h"
-#include "test.h"
+#include "common/crypto_rand.h"
+#include "common/util.h"
+#include "common/util_format.h"
+#include "common/compat.h"
+#include "test/test.h"
#include <openssl/evp.h>
#include <openssl/rand.h>
-#include "compat_openssl.h"
+#include "common/compat_openssl.h"
/* Test for rectifying openssl RAND engine. */
static void
diff --git a/src/test/test_crypto_slow.c b/src/test/test_crypto_slow.c
index 137953d453..c15d8deb9e 100644
--- a/src/test/test_crypto_slow.c
+++ b/src/test/test_crypto_slow.c
@@ -5,11 +5,11 @@
#include "orconfig.h"
#define CRYPTO_S2K_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "crypto_s2k.h"
-#include "crypto_pwbox.h"
-#include "crypto_rand.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/crypto_s2k.h"
+#include "common/crypto_pwbox.h"
+#include "common/crypto_rand.h"
#if defined(HAVE_LIBSCRYPT_H) && defined(HAVE_LIBSCRYPT_SCRYPT)
#define HAVE_LIBSCRYPT
diff --git a/src/test/test_data.c b/src/test/test_data.c
index 6a6979fc6a..be8153258b 100644
--- a/src/test/test_data.c
+++ b/src/test/test_data.c
@@ -3,7 +3,7 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "test.h"
+#include "test/test.h"
/* Our unit test expect that the AUTHORITY_CERT_* public keys will sort
* in this order. */
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index d6939ede3a..56293b5787 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -17,46 +17,46 @@
#define NETWORKSTATUS_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "confparse.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dirauth/dirvote.h"
-#include "entrynodes.h"
-#include "fp_pair.h"
-#include "hibernate.h"
-#include "memarea.h"
-#include "networkstatus.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "dirauth/shared_random_state.h"
-#include "test.h"
-#include "test_dir_common.h"
-#include "torcert.h"
-#include "relay.h"
-#include "log_test_helpers.h"
-#include "voting_schedule.h"
-
-#include "authority_cert_st.h"
-#include "document_signature_st.h"
-#include "extrainfo_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "ns_detached_signatures_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "tor_version_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/confparse.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dirauth/dirvote.h"
+#include "or/entrynodes.h"
+#include "or/fp_pair.h"
+#include "or/hibernate.h"
+#include "common/memarea.h"
+#include "or/networkstatus.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/dirauth/shared_random_state.h"
+#include "test/test.h"
+#include "test/test_dir_common.h"
+#include "or/torcert.h"
+#include "or/relay.h"
+#include "test/log_test_helpers.h"
+#include "or/voting_schedule.h"
+
+#include "or/authority_cert_st.h"
+#include "or/document_signature_st.h"
+#include "or/extrainfo_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/ns_detached_signatures_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/tor_version_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
#define NS_MODULE dir
diff --git a/src/test/test_dir_common.c b/src/test/test_dir_common.c
index 7712c1a650..6933800eb8 100644
--- a/src/test/test_dir_common.c
+++ b/src/test/test_dir_common.c
@@ -5,21 +5,21 @@
#include "orconfig.h"
#define DIRVOTE_PRIVATE
-#include "test.h"
-#include "container.h"
-#include "or.h"
-#include "dirauth/dirvote.h"
-#include "nodelist.h"
-#include "routerlist.h"
-#include "test_dir_common.h"
-#include "voting_schedule.h"
+#include "test/test.h"
+#include "common/container.h"
+#include "or/or.h"
+#include "or/dirauth/dirvote.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+#include "test/test_dir_common.h"
+#include "or/voting_schedule.h"
-#include "authority_cert_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "routerinfo_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/authority_cert_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/routerinfo_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
void dir_common_setup_vote(networkstatus_t **vote, time_t now);
networkstatus_t * dir_common_add_rs_and_parse(networkstatus_t *vote,
diff --git a/src/test/test_dir_common.h b/src/test/test_dir_common.h
index d3441205ba..7d5f55afe6 100644
--- a/src/test/test_dir_common.h
+++ b/src/test/test_dir_common.h
@@ -3,9 +3,9 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "networkstatus.h"
-#include "routerparse.h"
+#include "or/or.h"
+#include "or/networkstatus.h"
+#include "or/routerparse.h"
#define TEST_DIR_ROUTER_ID_1 3
#define TEST_DIR_ROUTER_ID_2 5
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index 9c2e6b8494..fbc14e3d30 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -9,37 +9,37 @@
#define CONFIG_PRIVATE
#define RENDCACHE_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "consdiffmgr.h"
-#include "directory.h"
-#include "test.h"
-#include "compress.h"
-#include "rendcommon.h"
-#include "rendcache.h"
-#include "router.h"
-#include "routerlist.h"
-#include "rend_test_helpers.h"
-#include "microdesc.h"
-#include "test_helpers.h"
-#include "nodelist.h"
-#include "entrynodes.h"
-#include "routerparse.h"
-#include "networkstatus.h"
-#include "proto_http.h"
-#include "geoip.h"
-#include "dirserv.h"
-#include "dirauth/dirvote.h"
-#include "log_test_helpers.h"
-#include "voting_schedule.h"
-
-#include "dir_connection_st.h"
-#include "dir_server_st.h"
-#include "networkstatus_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/consdiffmgr.h"
+#include "or/directory.h"
+#include "test/test.h"
+#include "common/compress.h"
+#include "or/rendcommon.h"
+#include "or/rendcache.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "test/rend_test_helpers.h"
+#include "or/microdesc.h"
+#include "test/test_helpers.h"
+#include "or/nodelist.h"
+#include "or/entrynodes.h"
+#include "or/routerparse.h"
+#include "or/networkstatus.h"
+#include "or/proto_http.h"
+#include "or/geoip.h"
+#include "or/dirserv.h"
+#include "or/dirauth/dirvote.h"
+#include "test/log_test_helpers.h"
+#include "or/voting_schedule.h"
+
+#include "or/dir_connection_st.h"
+#include "or/dir_server_st.h"
+#include "or/networkstatus_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
#ifdef _WIN32
/* For mkdir() */
diff --git a/src/test/test_dns.c b/src/test/test_dns.c
index b843aef6b9..3bcef0aa7c 100644
--- a/src/test/test_dns.c
+++ b/src/test/test_dns.c
@@ -1,17 +1,17 @@
/* Copyright (c) 2015-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
#define DNS_PRIVATE
-#include "dns.h"
-#include "connection.h"
-#include "router.h"
+#include "or/dns.h"
+#include "or/connection.h"
+#include "or/router.h"
-#include "edge_connection_st.h"
-#include "or_circuit_st.h"
+#include "or/edge_connection_st.h"
+#include "or/or_circuit_st.h"
#define NS_MODULE dns
diff --git a/src/test/test_dos.c b/src/test/test_dos.c
index bc77bd8cd6..7a2a87d32d 100644
--- a/src/test/test_dos.c
+++ b/src/test/test_dos.c
@@ -5,23 +5,23 @@
#define TOR_CHANNEL_INTERNAL_
#define CIRCUITLIST_PRIVATE
-#include "or.h"
-#include "dos.h"
-#include "circuitlist.h"
-#include "crypto_rand.h"
-#include "geoip.h"
-#include "channel.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "routerlist.h"
-
-#include "networkstatus_st.h"
-#include "or_connection_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/dos.h"
+#include "or/circuitlist.h"
+#include "common/crypto_rand.h"
+#include "or/geoip.h"
+#include "or/channel.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+
+#include "or/networkstatus_st.h"
+#include "or/or_connection_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
+#include "test/log_test_helpers.h"
static networkstatus_t *dummy_ns = NULL;
static networkstatus_t *
diff --git a/src/test/test_entryconn.c b/src/test/test_entryconn.c
index 503f311f36..d6ac5e1d38 100644
--- a/src/test/test_entryconn.c
+++ b/src/test/test_entryconn.c
@@ -6,21 +6,21 @@
#define CONNECTION_PRIVATE
#define CONNECTION_EDGE_PRIVATE
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "addressmap.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "nodelist.h"
+#include "or/addressmap.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/nodelist.h"
-#include "hs_cache.h"
-#include "rendcache.h"
+#include "or/hs_cache.h"
+#include "or/rendcache.h"
-#include "entry_connection_st.h"
-#include "socks_request_st.h"
+#include "or/entry_connection_st.h"
+#include "or/socks_request_st.h"
static void *
entryconn_rewrite_setup(const struct testcase_t *tc)
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index e36705927d..2af9c4a378 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -10,38 +10,38 @@
#define ROUTERLIST_PRIVATE
#define DIRECTORY_PRIVATE
-#include "or.h"
-#include "test.h"
-
-#include "bridges.h"
-#include "circuitlist.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "confparse.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "nodelist.h"
-#include "networkstatus.h"
-#include "policies.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "statefile.h"
-#include "util.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "dir_connection_st.h"
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+
+#include "or/bridges.h"
+#include "or/circuitlist.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/nodelist.h"
+#include "or/networkstatus.h"
+#include "or/policies.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/statefile.h"
+#include "common/util.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/dir_connection_st.h"
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
/* TODO:
* choose_random_entry() test with state set.
diff --git a/src/test/test_extorport.c b/src/test/test_extorport.c
index 5e782c785b..64ecd422f5 100644
--- a/src/test/test_extorport.c
+++ b/src/test/test_extorport.c
@@ -4,19 +4,19 @@
#define CONNECTION_PRIVATE
#define EXT_ORPORT_PRIVATE
#define MAIN_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "ext_orport.h"
-#include "main.h"
-
-#include "or_connection_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/ext_orport.h"
+#include "or/main.h"
+
+#include "or/or_connection_st.h"
+
+#include "test/test.h"
/* Test connection_or_remove_from_ext_or_id_map and
* connection_or_set_ext_or_identifier */
diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c
index 0711a113eb..6951ab185c 100644
--- a/src/test/test_geoip.c
+++ b/src/test/test_geoip.c
@@ -8,10 +8,10 @@
/* These macros pull in declarations for some functions and structures that
* are typically file-private. */
#define GEOIP_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "geoip.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/geoip.h"
+#include "test/test.h"
/* Record odd numbered fake-IPs using ipv6, even numbered fake-IPs
* using ipv4. Since our fake geoip database is the same between
diff --git a/src/test/test_guardfraction.c b/src/test/test_guardfraction.c
index 169d3e87ea..fc451b1629 100644
--- a/src/test/test_guardfraction.c
+++ b/src/test/test_guardfraction.c
@@ -6,22 +6,22 @@
#define NETWORKSTATUS_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "config.h"
-#include "dirserv.h"
-#include "container.h"
-#include "entrynodes.h"
-#include "util.h"
-#include "routerparse.h"
-#include "networkstatus.h"
-
-#include "networkstatus_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
-
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/dirserv.h"
+#include "common/container.h"
+#include "or/entrynodes.h"
+#include "common/util.h"
+#include "or/routerparse.h"
+#include "or/networkstatus.h"
+
+#include "or/networkstatus_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
+
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
/** Generate a vote_routerstatus_t for a router with identity digest
* <b>digest_in_hex</b>. */
diff --git a/src/test/test_handles.c b/src/test/test_handles.c
index 44c52fd577..153ac5787b 100644
--- a/src/test/test_handles.c
+++ b/src/test/test_handles.c
@@ -2,10 +2,10 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "test.h"
+#include "test/test.h"
-#include "util.h"
-#include "handles.h"
+#include "common/util.h"
+#include "common/handles.h"
typedef struct demo_t {
HANDLE_ENTRY(demo, demo_t);
diff --git a/src/test/test_helpers.c b/src/test/test_helpers.c
index 4d1514db2a..f346c15caa 100644
--- a/src/test/test_helpers.c
+++ b/src/test/test_helpers.c
@@ -12,27 +12,27 @@
#define MAIN_PRIVATE
#include "orconfig.h"
-#include "or.h"
-
-#include "buffers.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "crypto_rand.h"
-#include "main.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "routerlist.h"
-
-#include "cell_st.h"
-#include "connection_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerlist_st.h"
-
-#include "test.h"
-#include "test_helpers.h"
-#include "test_connection.h"
+#include "or/or.h"
+
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "common/crypto_rand.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/routerlist.h"
+
+#include "or/cell_st.h"
+#include "or/connection_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerlist_st.h"
+
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/test_connection.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
DISABLE_GCC_WARNING(overlength-strings)
@@ -40,7 +40,7 @@ DISABLE_GCC_WARNING(overlength-strings)
* at large. */
#endif
#include "test_descriptors.inc"
-#include "circuitlist.h"
+#include "or/circuitlist.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
ENABLE_GCC_WARNING(overlength-strings)
#endif
diff --git a/src/test/test_helpers.h b/src/test/test_helpers.h
index 7f15be708f..c6339d97fa 100644
--- a/src/test/test_helpers.h
+++ b/src/test/test_helpers.h
@@ -4,7 +4,7 @@
#ifndef TOR_TEST_HELPERS_H
#define TOR_TEST_HELPERS_H
-#include "or.h"
+#include "or/or.h"
const char *get_yesterday_date_str(void);
diff --git a/src/test/test_hs.c b/src/test/test_hs.c
index 7e14d73c24..166faa8928 100644
--- a/src/test/test_hs.c
+++ b/src/test/test_hs.c
@@ -12,22 +12,22 @@
#define RENDSERVICE_PRIVATE
#define HS_SERVICE_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "control.h"
-#include "config.h"
-#include "hs_common.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "routerset.h"
-#include "circuitbuild.h"
-
-#include "node_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "routerinfo_st.h"
-
-#include "test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "or/hs_common.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/routerset.h"
+#include "or/circuitbuild.h"
+
+#include "or/node_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/routerinfo_st.h"
+
+#include "test/test_helpers.h"
/* mock ID digest and longname for node that's in nodelist */
#define HSDIR_EXIST_ID "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA" \
diff --git a/src/test/test_hs_cache.c b/src/test/test_hs_cache.c
index a0d2c56d2c..ccad3062b7 100644
--- a/src/test/test_hs_cache.c
+++ b/src/test/test_hs_cache.c
@@ -10,20 +10,20 @@
#define DIRECTORY_PRIVATE
#define HS_CACHE_PRIVATE
-#include "ed25519_cert.h"
-#include "hs_cache.h"
-#include "rendcache.h"
-#include "directory.h"
-#include "networkstatus.h"
-#include "connection.h"
-#include "proto_http.h"
-
-#include "dir_connection_st.h"
-#include "networkstatus_st.h"
-
-#include "hs_test_helpers.h"
-#include "test_helpers.h"
-#include "test.h"
+#include "trunnel/ed25519_cert.h"
+#include "or/hs_cache.h"
+#include "or/rendcache.h"
+#include "or/directory.h"
+#include "or/networkstatus.h"
+#include "or/connection.h"
+#include "or/proto_http.h"
+
+#include "or/dir_connection_st.h"
+#include "or/networkstatus_st.h"
+
+#include "test/hs_test_helpers.h"
+#include "test/test_helpers.h"
+#include "test/test.h"
/* Static variable used to encoded the HSDir query. */
static char query_b64[256];
diff --git a/src/test/test_hs_cell.c b/src/test/test_hs_cell.c
index 90c32c0769..f9d25ca099 100644
--- a/src/test/test_hs_cell.c
+++ b/src/test/test_hs_cell.c
@@ -9,18 +9,18 @@
#define HS_INTROPOINT_PRIVATE
#define HS_SERVICE_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
-#include "hs_cell.h"
-#include "hs_intropoint.h"
-#include "hs_service.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
+#include "or/hs_cell.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_service.h"
/* Trunnel. */
-#include "hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_establish_intro.h"
/** We simulate the creation of an outgoing ESTABLISH_INTRO cell, and then we
* parse it from the receiver side. */
diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c
index 196d7479bf..ebe75d5aa0 100644
--- a/src/test/test_hs_client.c
+++ b/src/test/test_hs_client.c
@@ -14,37 +14,37 @@
#define CIRCUITLIST_PRIVATE
#define CONNECTION_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "rend_test_helpers.h"
-#include "hs_test_helpers.h"
-
-#include "config.h"
-#include "crypto.h"
-#include "channeltls.h"
-#include "main.h"
-#include "nodelist.h"
-#include "routerset.h"
-
-#include "hs_circuit.h"
-#include "hs_client.h"
-#include "hs_ident.h"
-#include "hs_cache.h"
-#include "circuitlist.h"
-#include "circuitbuild.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "networkstatus.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "networkstatus_st.h"
-#include "origin_circuit_st.h"
-#include "socks_request_st.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "test/rend_test_helpers.h"
+#include "test/hs_test_helpers.h"
+
+#include "or/config.h"
+#include "common/crypto.h"
+#include "or/channeltls.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/routerset.h"
+
+#include "or/hs_circuit.h"
+#include "or/hs_client.h"
+#include "or/hs_ident.h"
+#include "or/hs_cache.h"
+#include "or/circuitlist.h"
+#include "or/circuitbuild.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/networkstatus.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/networkstatus_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/socks_request_st.h"
static int
mock_connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index cb1069aa22..1822d6c21c 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -11,33 +11,33 @@
#define HS_SERVICE_PRIVATE
#define NODELIST_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "hs_test_helpers.h"
-
-#include "connection_edge.h"
-#include "crypto_rand.h"
-#include "hs_common.h"
-#include "hs_client.h"
-#include "hs_service.h"
-#include "config.h"
-#include "networkstatus.h"
-#include "directory.h"
-#include "dirauth/dirvote.h"
-#include "nodelist.h"
-#include "routerlist.h"
-#include "statefile.h"
-#include "circuitlist.h"
-#include "dirauth/shared_random.h"
-#include "util.h"
-#include "voting_schedule.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "test/hs_test_helpers.h"
+
+#include "or/connection_edge.h"
+#include "common/crypto_rand.h"
+#include "or/hs_common.h"
+#include "or/hs_client.h"
+#include "or/hs_service.h"
+#include "or/config.h"
+#include "or/networkstatus.h"
+#include "or/directory.h"
+#include "or/dirauth/dirvote.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+#include "or/statefile.h"
+#include "or/circuitlist.h"
+#include "or/dirauth/shared_random.h"
+#include "common/util.h"
+#include "or/voting_schedule.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/** Test the validation of HS v3 addresses */
static void
diff --git a/src/test/test_hs_config.c b/src/test/test_hs_config.c
index c3674435f8..33ad09313c 100644
--- a/src/test/test_hs_config.c
+++ b/src/test/test_hs_config.c
@@ -9,15 +9,15 @@
#define CONFIG_PRIVATE
#define HS_SERVICE_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-
-#include "config.h"
-#include "hs_common.h"
-#include "hs_config.h"
-#include "hs_service.h"
-#include "rendservice.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+
+#include "or/config.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/hs_service.h"
+#include "or/rendservice.h"
static int
helper_config_service(const char *conf, int validate_only)
diff --git a/src/test/test_hs_control.c b/src/test/test_hs_control.c
index 424bc9f28e..f5beced45f 100644
--- a/src/test/test_hs_control.c
+++ b/src/test/test_hs_control.c
@@ -8,18 +8,18 @@
#define CONTROL_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "control.h"
-#include "config.h"
-#include "hs_common.h"
-#include "hs_control.h"
-#include "nodelist.h"
-
-#include "node_st.h"
-#include "routerstatus_st.h"
-
-#include "test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "or/hs_common.h"
+#include "or/hs_control.h"
+#include "or/nodelist.h"
+
+#include "or/node_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test_helpers.h"
/* mock ID digest and longname for node that's in nodelist */
#define HSDIR_EXIST_ID \
diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c
index a7eac59b10..00b25f142f 100644
--- a/src/test/test_hs_descriptor.c
+++ b/src/test/test_hs_descriptor.c
@@ -8,18 +8,18 @@
#define HS_DESCRIPTOR_PRIVATE
-#include "crypto_ed25519.h"
-#include "crypto_digest.h"
-#include "crypto_rand.h"
-#include "ed25519_cert.h"
-#include "or.h"
-#include "hs_descriptor.h"
-#include "test.h"
-#include "torcert.h"
-
-#include "hs_test_helpers.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_rand.h"
+#include "trunnel/ed25519_cert.h"
+#include "or/or.h"
+#include "or/hs_descriptor.h"
+#include "test/test.h"
+#include "or/torcert.h"
+
+#include "test/hs_test_helpers.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
DISABLE_GCC_WARNING(overlength-strings)
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c
index e7f49faa64..34e51cba61 100644
--- a/src/test/test_hs_intropoint.c
+++ b/src/test/test_hs_intropoint.c
@@ -11,29 +11,29 @@
#define RENDSERVICE_PRIVATE
#define CIRCUITLIST_PRIVATE
-#include "test.h"
-#include "log_test_helpers.h"
-#include "crypto_rand.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+#include "common/crypto_rand.h"
-#include "or.h"
-#include "circuitlist.h"
-#include "circuituse.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
#include "ht.h"
-#include "relay.h"
-#include "rendservice.h"
+#include "or/relay.h"
+#include "or/rendservice.h"
-#include "hs_cell.h"
-#include "hs_circuitmap.h"
-#include "hs_common.h"
-#include "hs_intropoint.h"
-#include "hs_service.h"
+#include "or/hs_cell.h"
+#include "or/hs_circuitmap.h"
+#include "or/hs_common.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_service.h"
-#include "or_circuit_st.h"
+#include "or/or_circuit_st.h"
/* Trunnel. */
-#include "hs/cell_establish_intro.h"
-#include "hs/cell_introduce1.h"
-#include "hs/cell_common.h"
+#include "trunnel/hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_introduce1.h"
+#include "trunnel/hs/cell_common.h"
static size_t
new_establish_intro_cell(const char *circ_nonce,
diff --git a/src/test/test_hs_ntor.c b/src/test/test_hs_ntor.c
index 8bd5f7fdba..51373af645 100644
--- a/src/test/test_hs_ntor.c
+++ b/src/test/test_hs_ntor.c
@@ -6,11 +6,11 @@
* \brief Test hidden service ntor functionality.
*/
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
-#include "hs_ntor.h"
+#include "or/hs_ntor.h"
/* Test the HS ntor handshake. Simulate the sending of an encrypted INTRODUCE1
* cell, and verify the proper derivation of decryption keys on the other end.
diff --git a/src/test/test_hs_ntor_cl.c b/src/test/test_hs_ntor_cl.c
index 943d787f06..8c19877729 100644
--- a/src/test/test_hs_ntor_cl.c
+++ b/src/test/test_hs_ntor_cl.c
@@ -13,13 +13,13 @@
#include <stdlib.h>
#define ONION_NTOR_PRIVATE
-#include "or.h"
-#include "util.h"
-#include "compat.h"
-#include "crypto.h"
-#include "crypto_curve25519.h"
-#include "hs_ntor.h"
-#include "onion_ntor.h"
+#include "or/or.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "common/crypto.h"
+#include "common/crypto_curve25519.h"
+#include "or/hs_ntor.h"
+#include "or/onion_ntor.h"
#define N_ARGS(n) STMT_BEGIN { \
if (argc < (n)) { \
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 036745beca..bcf72b4546 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -22,46 +22,46 @@
#define HS_CLIENT_PRIVATE
#define ROUTERPARSE_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "rend_test_helpers.h"
-#include "hs_test_helpers.h"
-
-#include "or.h"
-#include "config.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "crypto_rand.h"
-#include "dirauth/dirvote.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "routerparse.h"
-#include "hs_common.h"
-#include "hs_config.h"
-#include "hs_ident.h"
-#include "hs_intropoint.h"
-#include "hs_ntor.h"
-#include "hs_circuit.h"
-#include "hs_service.h"
-#include "hs_client.h"
-#include "main.h"
-#include "rendservice.h"
-#include "statefile.h"
-#include "dirauth/shared_random_state.h"
-#include "voting_schedule.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "test/rend_test_helpers.h"
+#include "test/hs_test_helpers.h"
+
+#include "or/or.h"
+#include "or/config.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "common/crypto_rand.h"
+#include "or/dirauth/dirvote.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/routerparse.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/hs_ident.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_ntor.h"
+#include "or/hs_circuit.h"
+#include "or/hs_service.h"
+#include "or/hs_client.h"
+#include "or/main.h"
+#include "or/rendservice.h"
+#include "or/statefile.h"
+#include "or/dirauth/shared_random_state.h"
+#include "or/voting_schedule.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
/* Trunnel */
-#include "hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_establish_intro.h"
static networkstatus_t mock_ns;
diff --git a/src/test/test_introduce.c b/src/test/test_introduce.c
index 3c53f81075..6ffb22fcac 100644
--- a/src/test/test_introduce.c
+++ b/src/test/test_introduce.c
@@ -2,12 +2,12 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "crypto.h"
-#include "or.h"
-#include "test.h"
+#include "common/crypto.h"
+#include "or/or.h"
+#include "test/test.h"
#define RENDSERVICE_PRIVATE
-#include "rendservice.h"
+#include "or/rendservice.h"
static uint8_t v0_test_plaintext[] =
/* 20 bytes of rendezvous point nickname */
diff --git a/src/test/test_keypin.c b/src/test/test_keypin.c
index c1e74259cd..e7e7e62963 100644
--- a/src/test/test_keypin.c
+++ b/src/test/test_keypin.c
@@ -3,11 +3,11 @@
#include "orconfig.h"
#define KEYPIN_PRIVATE
-#include "or.h"
-#include "keypin.h"
-#include "util.h"
+#include "or/or.h"
+#include "or/keypin.h"
+#include "common/util.h"
-#include "test.h"
+#include "test/test.h"
static void
test_keypin_parse_line(void *arg)
diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c
index e84c37e94a..2650caf950 100644
--- a/src/test/test_link_handshake.c
+++ b/src/test/test_link_handshake.c
@@ -8,26 +8,26 @@
#define TOR_CHANNEL_INTERNAL_
#define TORTLS_PRIVATE
-#include "compat.h"
-
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "channeltls.h"
-#include "link_handshake.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "scheduler.h"
-#include "torcert.h"
-
-#include "or_connection_st.h"
-#include "or_handshake_certs_st.h"
-#include "or_handshake_state_st.h"
-#include "var_cell_st.h"
-
-#include "test.h"
-#include "log_test_helpers.h"
+#include "common/compat.h"
+
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/channeltls.h"
+#include "trunnel/link_handshake.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/scheduler.h"
+#include "or/torcert.h"
+
+#include "or/or_connection_st.h"
+#include "or/or_handshake_certs_st.h"
+#include "or/or_handshake_state_st.h"
+#include "or/var_cell_st.h"
+
+#include "test/test.h"
+#include "test/log_test_helpers.h"
static var_cell_t *mock_got_var_cell = NULL;
diff --git a/src/test/test_logging.c b/src/test/test_logging.c
index 898f9dab5d..aebfd36068 100644
--- a/src/test/test_logging.c
+++ b/src/test/test_logging.c
@@ -2,9 +2,9 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
-#include "torlog.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/torlog.h"
+#include "test/test.h"
static void
dummy_cb_fn(int severity, uint32_t domain, const char *msg)
diff --git a/src/test/test_mainloop.c b/src/test/test_mainloop.c
index 9da8a039dd..559bbe587a 100644
--- a/src/test/test_mainloop.c
+++ b/src/test/test_mainloop.c
@@ -6,11 +6,11 @@
* \brief Tests for functions closely related to the Tor main loop
*/
-#include "test.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
-#include "or.h"
-#include "main.h"
+#include "or/or.h"
+#include "or/main.h"
static const uint64_t BILLION = 1000000000;
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index 68c7432b54..1b680c02c5 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -2,23 +2,23 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "config.h"
+#include "or/config.h"
#define DIRVOTE_PRIVATE
-#include "dirauth/dirvote.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "torcert.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/dirauth/dirvote.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/torcert.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
#ifdef _WIN32
/* For mkdir() */
diff --git a/src/test/test_nodelist.c b/src/test/test_nodelist.c
index 7810883715..0e5ad7bba7 100644
--- a/src/test/test_nodelist.c
+++ b/src/test/test_nodelist.c
@@ -6,19 +6,19 @@
* \brief Unit tests for nodelist related functions.
**/
-#include "or.h"
-#include "crypto_rand.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "torcert.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/torcert.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
/** Test the case when node_get_by_id() returns NULL,
* node_get_verbose_nickname_by_id should return the base 16 encoding
diff --git a/src/test/test_ntor_cl.c b/src/test/test_ntor_cl.c
index 2e1a8f62a0..dbc607db3d 100644
--- a/src/test/test_ntor_cl.c
+++ b/src/test/test_ntor_cl.c
@@ -6,12 +6,12 @@
#include <stdlib.h>
#define ONION_NTOR_PRIVATE
-#include "or.h"
-#include "util.h"
-#include "compat.h"
-#include "crypto.h"
-#include "crypto_curve25519.h"
-#include "onion_ntor.h"
+#include "or/or.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "common/crypto.h"
+#include "common/crypto_curve25519.h"
+#include "or/onion_ntor.h"
#define N_ARGS(n) STMT_BEGIN { \
if (argc < (n)) { \
diff --git a/src/test/test_oom.c b/src/test/test_oom.c
index 48578f9055..0edc22c502 100644
--- a/src/test/test_oom.c
+++ b/src/test/test_oom.c
@@ -7,21 +7,21 @@
#define BUFFERS_PRIVATE
#define CIRCUITLIST_PRIVATE
#define CONNECTION_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "circuitlist.h"
-#include "compat_libevent.h"
-#include "connection.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "relay.h"
-#include "test.h"
-#include "test_helpers.h"
-
-#include "cell_st.h"
-#include "entry_connection_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/circuitlist.h"
+#include "common/compat_libevent.h"
+#include "or/connection.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/relay.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+
+#include "or/cell_st.h"
+#include "or/entry_connection_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
/* small replacement mock for circuit_mark_for_close_ to avoid doing all
* the other bookkeeping that comes with marking circuits. */
diff --git a/src/test/test_oos.c b/src/test/test_oos.c
index 6db9d644c6..6ecb1a0786 100644
--- a/src/test/test_oos.c
+++ b/src/test/test_oos.c
@@ -5,15 +5,15 @@
#define CONNECTION_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "main.h"
-#include "test.h"
-
-#include "dir_connection_st.h"
-#include "or_connection_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/main.h"
+#include "test/test.h"
+
+#include "or/dir_connection_st.h"
+#include "or/or_connection_st.h"
static or_options_t mock_options;
diff --git a/src/test/test_options.c b/src/test/test_options.c
index 587f0ba997..bf35e3c5be 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -4,21 +4,21 @@
/* See LICENSE for licensing information */
#define CONFIG_PRIVATE
-#include "or.h"
-#include "confparse.h"
-#include "config.h"
-#include "test.h"
-#include "geoip.h"
+#include "or/or.h"
+#include "or/confparse.h"
+#include "or/config.h"
+#include "test/test.h"
+#include "or/geoip.h"
#define ROUTERSET_PRIVATE
-#include "routerset.h"
-#include "main.h"
-#include "log_test_helpers.h"
-
-#include "sandbox.h"
-#include "memarea.h"
-#include "policies.h"
-#include "test_helpers.h"
+#include "or/routerset.h"
+#include "or/main.h"
+#include "test/log_test_helpers.h"
+
+#include "common/sandbox.h"
+#include "common/memarea.h"
+#include "or/policies.h"
+#include "test/test_helpers.h"
#define NS_MODULE test_options
diff --git a/src/test/test_periodic_event.c b/src/test/test_periodic_event.c
index 34689b64f4..b353cf87a3 100644
--- a/src/test/test_periodic_event.c
+++ b/src/test/test_periodic_event.c
@@ -11,15 +11,15 @@
#define HS_SERVICE_PRIVATE
#define MAIN_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-
-#include "or.h"
-#include "config.h"
-#include "hibernate.h"
-#include "hs_service.h"
-#include "main.h"
-#include "periodic.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+
+#include "or/or.h"
+#include "or/config.h"
+#include "or/hibernate.h"
+#include "or/hs_service.h"
+#include "or/main.h"
+#include "or/periodic.h"
/** Helper function: This is replaced in some tests for the event callbacks so
* we don't actually go into the code path of those callbacks. */
diff --git a/src/test/test_policy.c b/src/test/test_policy.c
index 48a093ce14..2c29bbb16a 100644
--- a/src/test/test_policy.c
+++ b/src/test/test_policy.c
@@ -1,19 +1,19 @@
/* Copyright (c) 2013-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#define CONFIG_PRIVATE
-#include "config.h"
-#include "router.h"
-#include "routerparse.h"
+#include "or/config.h"
+#include "or/router.h"
+#include "or/routerparse.h"
#define POLICIES_PRIVATE
-#include "policies.h"
-#include "test.h"
+#include "or/policies.h"
+#include "test/test.h"
-#include "node_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "or/node_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/* Helper: assert that short_policy parses and writes back out as itself,
or as <b>expected</b> if that's provided. */
diff --git a/src/test/test_procmon.c b/src/test/test_procmon.c
index 25f2417cb8..ae30bd00b6 100644
--- a/src/test/test_procmon.c
+++ b/src/test/test_procmon.c
@@ -3,12 +3,12 @@
#define PROCMON_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "procmon.h"
+#include "common/procmon.h"
-#include "log_test_helpers.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE procmon
diff --git a/src/test/test_proto_http.c b/src/test/test_proto_http.c
index 5880868850..b98ee83aea 100644
--- a/src/test/test_proto_http.c
+++ b/src/test/test_proto_http.c
@@ -6,11 +6,11 @@
* \brief Tests for our HTTP protocol parser code
*/
-#include "or.h"
-#include "test.h"
-#include "buffers.h"
-#include "proto_http.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/buffers.h"
+#include "or/proto_http.h"
+#include "test/log_test_helpers.h"
#define S(str) str, sizeof(str)-1
diff --git a/src/test/test_proto_misc.c b/src/test/test_proto_misc.c
index 539fd1ad58..979fc72f18 100644
--- a/src/test/test_proto_misc.c
+++ b/src/test/test_proto_misc.c
@@ -6,16 +6,16 @@
* \brief Test our smaller buffer-based protocol functions
*/
-#include "or.h"
-#include "test.h"
-#include "buffers.h"
-#include "connection_or.h"
-#include "ext_orport.h"
-#include "proto_cell.h"
-#include "proto_control0.h"
-#include "proto_ext_or.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/buffers.h"
+#include "or/connection_or.h"
+#include "or/ext_orport.h"
+#include "or/proto_cell.h"
+#include "or/proto_control0.h"
+#include "or/proto_ext_or.h"
-#include "var_cell_st.h"
+#include "or/var_cell_st.h"
static void
test_proto_var_cell(void *arg)
diff --git a/src/test/test_protover.c b/src/test/test_protover.c
index 7899c099f7..f17f68ced2 100644
--- a/src/test/test_protover.c
+++ b/src/test/test_protover.c
@@ -4,12 +4,12 @@
#define PROTOVER_PRIVATE
#include "orconfig.h"
-#include "test.h"
+#include "test/test.h"
-#include "protover.h"
+#include "or/protover.h"
-#include "or.h"
-#include "connection_or.h"
+#include "or/or.h"
+#include "or/connection_or.h"
static void
test_protover_parse(void *arg)
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 6529dd0374..d6ab00bb6b 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -8,15 +8,15 @@
#define UTIL_PRIVATE
#define STATEFILE_PRIVATE
#define CONTROL_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "confparse.h"
-#include "control.h"
-#include "transports.h"
-#include "circuitbuild.h"
-#include "util.h"
-#include "statefile.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/control.h"
+#include "or/transports.h"
+#include "or/circuitbuild.h"
+#include "common/util.h"
+#include "or/statefile.h"
+#include "test/test.h"
static void
reset_mp(managed_proxy_t *mp)
diff --git a/src/test/test_pubsub.c b/src/test/test_pubsub.c
index d281e51ee3..4f6cdc1996 100644
--- a/src/test/test_pubsub.c
+++ b/src/test/test_pubsub.c
@@ -6,9 +6,9 @@
* \brief Unit tests for publish-subscribe abstraction.
**/
-#include "or.h"
-#include "test.h"
-#include "pubsub.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/pubsub.h"
DECLARE_PUBSUB_STRUCT_TYPES(foobar)
DECLARE_PUBSUB_TOPIC(foobar)
diff --git a/src/test/test_relay.c b/src/test/test_relay.c
index 559f046fd4..777153d11b 100644
--- a/src/test/test_relay.c
+++ b/src/test/test_relay.c
@@ -1,20 +1,20 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#define CIRCUITBUILD_PRIVATE
-#include "circuitbuild.h"
+#include "or/circuitbuild.h"
#define RELAY_PRIVATE
-#include "relay.h"
+#include "or/relay.h"
/* For init/free stuff */
-#include "scheduler.h"
+#include "or/scheduler.h"
-#include "cell_st.h"
-#include "or_circuit_st.h"
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
/* Test suite stuff */
-#include "test.h"
-#include "fakechans.h"
+#include "test/test.h"
+#include "test/fakechans.h"
static or_circuit_t * new_fake_orcirc(channel_t *nchan, channel_t *pchan);
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 63b47d8962..770692440d 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,22 +5,22 @@
#define RELAY_PRIVATE
#define CIRCUITLIST_PRIVATE
-#include "or.h"
-#include "main.h"
-#include "config.h"
-#include "connection.h"
-#include "crypto.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "connection_edge.h"
-#include "relay.h"
-#include "test.h"
-
-#include "cell_st.h"
-#include "crypt_path_st.h"
-#include "entry_connection_st.h"
-#include "origin_circuit_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/main.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "common/crypto.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/connection_edge.h"
+#include "or/relay.h"
+#include "test/test.h"
+
+#include "or/cell_st.h"
+#include "or/crypt_path_st.h"
+#include "or/entry_connection_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/socks_request_st.h"
static int srm_ncalls;
static entry_connection_t *srm_conn;
diff --git a/src/test/test_relaycrypt.c b/src/test/test_relaycrypt.c
index 9f6b5bbe66..0b8541974f 100644
--- a/src/test/test_relaycrypt.c
+++ b/src/test/test_relaycrypt.c
@@ -3,19 +3,19 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "circuitbuild.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
#define CIRCUITLIST_PRIVATE
-#include "circuitlist.h"
-#include "crypto_rand.h"
-#include "relay.h"
-#include "relay_crypto.h"
+#include "or/circuitlist.h"
+#include "common/crypto_rand.h"
+#include "or/relay.h"
+#include "or/relay_crypto.h"
-#include "cell_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
-#include "test.h"
+#include "test/test.h"
static const char KEY_MATERIAL[3][CPATH_KEY_MATERIAL_LEN] = {
" 'My public key is in this signed x509 object', said Tom assertively.",
diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c
index 44b84d07ee..3d606aac0d 100644
--- a/src/test/test_rendcache.c
+++ b/src/test/test_rendcache.c
@@ -2,24 +2,24 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
#define RENDCACHE_PRIVATE
-#include "rendcache.h"
-#include "router.h"
-#include "routerlist.h"
-#include "config.h"
-#include "hs_common.h"
-
-#include "extend_info_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerinfo_st.h"
-
-#include "rend_test_helpers.h"
-#include "log_test_helpers.h"
+#include "or/rendcache.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/config.h"
+#include "or/hs_common.h"
+
+#include "or/extend_info_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
+
+#include "test/rend_test_helpers.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE rend_cache
diff --git a/src/test/test_replay.c b/src/test/test_replay.c
index 97951241ea..7f9c0b09e4 100644
--- a/src/test/test_replay.c
+++ b/src/test/test_replay.c
@@ -4,9 +4,9 @@
#define REPLAYCACHE_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "replaycache.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/replaycache.h"
+#include "test/test.h"
static const char *test_buffer =
"Lorem ipsum dolor sit amet, consectetur adipisici elit, sed do eiusmod"
diff --git a/src/test/test_router.c b/src/test/test_router.c
index 239c17a94a..f2f325785f 100644
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@ -7,17 +7,17 @@
* \brief Unittests for code in src/or/router.c
**/
-#include "or.h"
-#include "config.h"
-#include "crypto_curve25519.h"
-#include "crypto_ed25519.h"
-#include "router.h"
-#include "routerlist.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_ed25519.h"
+#include "or/router.h"
+#include "or/routerlist.h"
-#include "routerinfo_st.h"
+#include "or/routerinfo_st.h"
/* Test suite stuff */
-#include "test.h"
+#include "test/test.h"
NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
diff --git a/src/test/test_routerkeys.c b/src/test/test_routerkeys.c
index fd1117485e..8cfc9f808f 100644
--- a/src/test/test_routerkeys.c
+++ b/src/test/test_routerkeys.c
@@ -5,14 +5,14 @@
#include "orconfig.h"
#define ROUTER_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "util.h"
-#include "crypto.h"
-#include "torcert.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "common/util.h"
+#include "common/crypto.h"
+#include "or/torcert.h"
+#include "test/test.h"
#ifdef _WIN32
/* For mkdir() */
diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c
index 15f717f1af..b6032ed87c 100644
--- a/src/test/test_routerlist.c
+++ b/src/test/test_routerlist.c
@@ -13,36 +13,36 @@
#define NETWORKSTATUS_PRIVATE
#define ROUTERLIST_PRIVATE
#define TOR_UNIT_TESTING
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "container.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "dirauth/dirvote.h"
-#include "entrynodes.h"
-#include "hibernate.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "routerparse.h"
-#include "dirauth/shared_random.h"
-#include "statefile.h"
-
-#include "authority_cert_st.h"
-#include "dir_connection_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
-#include "test_dir_common.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "common/container.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/dirauth/dirvote.h"
+#include "or/entrynodes.h"
+#include "or/hibernate.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/routerparse.h"
+#include "or/dirauth/shared_random.h"
+#include "or/statefile.h"
+
+#include "or/authority_cert_st.h"
+#include "or/dir_connection_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
+#include "test/test_dir_common.h"
+#include "test/log_test_helpers.h"
void construct_consensus(char **consensus_text_md, time_t now);
diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c
index 727e153921..e64c24e89e 100644
--- a/src/test/test_routerset.c
+++ b/src/test/test_routerset.c
@@ -3,19 +3,19 @@
#define ROUTERSET_PRIVATE
-#include "or.h"
-#include "geoip.h"
-#include "routerset.h"
-#include "routerparse.h"
-#include "policies.h"
-#include "nodelist.h"
-
-#include "extend_info_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "or/geoip.h"
+#include "or/routerset.h"
+#include "or/routerparse.h"
+#include "or/policies.h"
+#include "or/nodelist.h"
+
+#include "or/extend_info_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
#define NS_MODULE routerset
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c
index eece5db934..1087befa68 100644
--- a/src/test/test_scheduler.c
+++ b/src/test/test_scheduler.c
@@ -8,19 +8,19 @@
#define SCHEDULER_KIST_PRIVATE
#define TOR_CHANNEL_INTERNAL_
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "config.h"
-#include "compat_libevent.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "connection.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/compat_libevent.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/connection.h"
+#include "or/networkstatus.h"
#define SCHEDULER_PRIVATE_
-#include "scheduler.h"
+#include "or/scheduler.h"
/* Test suite stuff */
-#include "test.h"
-#include "fakechans.h"
+#include "test/test.h"
+#include "test/fakechans.h"
/* Shamelessly stolen from compat_libevent.c */
#define V(major, minor, patch) \
diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c
index 06eb65f255..149129d0c7 100644
--- a/src/test/test_shared_random.c
+++ b/src/test/test_shared_random.c
@@ -6,24 +6,24 @@
#define CONFIG_PRIVATE
#define DIRVOTE_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "dirauth/dirvote.h"
-#include "dirauth/shared_random.h"
-#include "dirauth/shared_random_state.h"
-#include "log_test_helpers.h"
-#include "networkstatus.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "shared_random_client.h"
-#include "voting_schedule.h"
-
-#include "dir_server_st.h"
-#include "networkstatus_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/shared_random.h"
+#include "or/dirauth/shared_random_state.h"
+#include "test/log_test_helpers.h"
+#include "or/networkstatus.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/shared_random_client.h"
+#include "or/voting_schedule.h"
+
+#include "or/dir_server_st.h"
+#include "or/networkstatus_st.h"
static authority_cert_t *mock_cert;
diff --git a/src/test/test_slow.c b/src/test/test_slow.c
index 74f6bdeeb2..951851ec07 100644
--- a/src/test/test_slow.c
+++ b/src/test/test_slow.c
@@ -15,8 +15,8 @@
#include <fcntl.h>
#endif
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
struct testgroup_t testgroups[] = {
{ "slow/crypto/", slow_crypto_tests },
diff --git a/src/test/test_socks.c b/src/test/test_socks.c
index d7b9f03938..04c0280584 100644
--- a/src/test/test_socks.c
+++ b/src/test/test_socks.c
@@ -3,13 +3,13 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "buffers.h"
-#include "config.h"
-#include "proto_socks.h"
-#include "test.h"
-#include "log_test_helpers.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/proto_socks.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+#include "or/socks_request_st.h"
typedef struct socks_test_data_t {
socks_request_t *req;
diff --git a/src/test/test_status.c b/src/test/test_status.c
index 8ed6364616..2f305224cb 100644
--- a/src/test/test_status.c
+++ b/src/test/test_status.c
@@ -11,24 +11,24 @@
#include <float.h>
#include <math.h>
-#include "or.h"
-#include "torlog.h"
+#include "or/or.h"
+#include "common/torlog.h"
#include "tor_queue.h"
-#include "status.h"
-#include "circuitlist.h"
-#include "config.h"
-#include "hibernate.h"
-#include "rephist.h"
-#include "relay.h"
-#include "router.h"
-#include "main.h"
-#include "nodelist.h"
-#include "statefile.h"
-
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
-
-#include "test.h"
+#include "or/status.h"
+#include "or/circuitlist.h"
+#include "or/config.h"
+#include "or/hibernate.h"
+#include "or/rephist.h"
+#include "or/relay.h"
+#include "or/router.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/statefile.h"
+
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
+
+#include "test/test.h"
#define NS_MODULE status
diff --git a/src/test/test_storagedir.c b/src/test/test_storagedir.c
index 1214448e47..4deb881335 100644
--- a/src/test/test_storagedir.c
+++ b/src/test/test_storagedir.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_rand.h"
-#include "storagedir.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "common/storagedir.h"
+#include "test/test.h"
#ifdef HAVE_UTIME_H
#include <utime.h>
diff --git a/src/test/test_switch_id.c b/src/test/test_switch_id.c
index 63be102886..149dda8f72 100644
--- a/src/test/test_switch_id.c
+++ b/src/test/test_switch_id.c
@@ -1,7 +1,7 @@
/* Copyright (c) 2015-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
diff --git a/src/test/test_threads.c b/src/test/test_threads.c
index eecbf69e4b..11f41a0444 100644
--- a/src/test/test_threads.c
+++ b/src/test/test_threads.c
@@ -4,9 +4,9 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
-#include "compat_threads.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/compat_threads.h"
+#include "test/test.h"
/** mutex for thread test to stop the threads hitting data at the same time. */
static tor_mutex_t *thread_test_mutex_ = NULL;
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index 0bf9d80552..6c63149425 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -11,7 +11,7 @@
#endif
#include <math.h>
-#include "compat.h"
+#include "common/compat.h"
/* Some versions of OpenSSL declare SSL_get_selected_srtp_profile twice in
* srtp.h. Suppress the GCC warning so we can build with -Wredundant-decl. */
@@ -30,13 +30,13 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
-#include "or.h"
-#include "torlog.h"
-#include "config.h"
-#include "tortls.h"
+#include "or/or.h"
+#include "common/torlog.h"
+#include "or/config.h"
+#include "common/tortls.h"
-#include "test.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE tortls
#ifndef HAVE_SSL_STATE
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 9585f5872b..4d06e3e7c4 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -8,16 +8,16 @@
#define COMPAT_TIME_PRIVATE
#define CONTROL_PRIVATE
#define UTIL_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "test.h"
-#include "memarea.h"
-#include "util_process.h"
-#include "log_test_helpers.h"
-#include "compress_zstd.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "test/test.h"
+#include "common/memarea.h"
+#include "common/util_process.h"
+#include "test/log_test_helpers.h"
+#include "common/compress_zstd.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/src/test/test_util_format.c b/src/test/test_util_format.c
index 3a1db62584..d56915822f 100644
--- a/src/test/test_util_format.c
+++ b/src/test/test_util_format.c
@@ -2,13 +2,13 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#define UTIL_FORMAT_PRIVATE
-#include "util_format.h"
+#include "common/util_format.h"
#define NS_MODULE util_format
diff --git a/src/test/test_util_process.c b/src/test/test_util_process.c
index d05c04653c..a09d12ac61 100644
--- a/src/test/test_util_process.c
+++ b/src/test/test_util_process.c
@@ -3,13 +3,13 @@
#define UTIL_PROCESS_PRIVATE
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
-#include "util_process.h"
+#include "common/util_process.h"
-#include "log_test_helpers.h"
+#include "test/log_test_helpers.h"
#ifndef _WIN32
#define NS_MODULE util_process
diff --git a/src/test/test_util_slow.c b/src/test/test_util_slow.c
index e3b65bc969..3d725d5025 100644
--- a/src/test/test_util_slow.c
+++ b/src/test/test_util_slow.c
@@ -5,11 +5,11 @@
#include "orconfig.h"
#define UTIL_PRIVATE
-#include "util.h"
-#include "util_process.h"
-#include "crypto.h"
-#include "torlog.h"
-#include "test.h"
+#include "common/util.h"
+#include "common/util_process.h"
+#include "common/crypto.h"
+#include "common/torlog.h"
+#include "test/test.h"
#ifndef BUILDDIR
#define BUILDDIR "."
diff --git a/src/test/test_voting_schedule.c b/src/test/test_voting_schedule.c
index df6058b74f..b5df596436 100644
--- a/src/test/test_voting_schedule.c
+++ b/src/test/test_voting_schedule.c
@@ -3,10 +3,10 @@
#include "orconfig.h"
-#include "or.h"
-#include "voting_schedule.h"
+#include "or/or.h"
+#include "or/voting_schedule.h"
-#include "test.h"
+#include "test/test.h"
static void
test_voting_schedule_interval_start(void *arg)
diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c
index 92b0d94d3d..6935d286c8 100644
--- a/src/test/test_workqueue.c
+++ b/src/test/test_workqueue.c
@@ -3,13 +3,13 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "compat_threads.h"
-#include "onion.h"
-#include "workqueue.h"
-#include "crypto_curve25519.h"
-#include "crypto_rand.h"
-#include "compat_libevent.h"
+#include "or/or.h"
+#include "common/compat_threads.h"
+#include "or/onion.h"
+#include "common/workqueue.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_rand.h"
+#include "common/compat_libevent.h"
#include <stdio.h>
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index eb1838e166..18b5b61064 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -10,15 +10,15 @@
#define MAIN_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "control.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "rephist.h"
-#include "backtrace.h"
-#include "test.h"
-#include "channelpadding.h"
-#include "main.h"
+#include "or/or.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/rephist.h"
+#include "common/backtrace.h"
+#include "test/test.h"
+#include "or/channelpadding.h"
+#include "or/main.h"
#include <stdio.h>
#ifdef HAVE_FCNTL_H
@@ -34,7 +34,7 @@
#ifdef USE_DMALLOC
#include <dmalloc.h>
-#include "main.h"
+#include "or/main.h"
#endif
/** Temporary directory (set up by setup_directory) under which we store all
diff --git a/src/test/testing_rsakeys.c b/src/test/testing_rsakeys.c
index 9c2c52180e..f45fcb11a4 100644
--- a/src/test/testing_rsakeys.c
+++ b/src/test/testing_rsakeys.c
@@ -3,10 +3,10 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#include "orconfig.h"
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
/** Define this if unit tests spend too much time generating public keys.
* This module is meant to save time by using a bunch of pregenerated RSA