aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-28 10:53:34 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-28 11:18:13 -0400
commit315e6b59ddb91c19c5102625c6cf0f22b2d6f894 (patch)
tree6b8b4a72d3ebd1292307de21b9acf8c4c3810d35 /src/test
parentec4eee63561c3f6a8bb0c466f17b92e99f832c5d (diff)
downloadtor-315e6b59ddb91c19c5102625c6cf0f22b2d6f894.tar.gz
tor-315e6b59ddb91c19c5102625c6cf0f22b2d6f894.zip
Extract process-management functionality into a new lib/process
Note that procmon does *not* go here, since procmon needs to integrate with the event loop.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_logging.c1
-rw-r--r--src/test/test_pt.c3
-rw-r--r--src/test/test_switch_id.c2
-rw-r--r--src/test/test_util.c6
-rw-r--r--src/test/test_util_process.c2
-rw-r--r--src/test/test_util_slow.c5
6 files changed, 13 insertions, 6 deletions
diff --git a/src/test/test_logging.c b/src/test/test_logging.c
index 06744ebf2c..d979411469 100644
--- a/src/test/test_logging.c
+++ b/src/test/test_logging.c
@@ -9,6 +9,7 @@
#include "lib/err/torerr.h"
#include "lib/log/torlog.h"
#include "test/test.h"
+#include "lib/process/subprocess.h"
static void
dummy_cb_fn(int severity, uint32_t domain, const char *msg)
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index d6ab00bb6b..c2c4e19897 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -8,6 +8,7 @@
#define UTIL_PRIVATE
#define STATEFILE_PRIVATE
#define CONTROL_PRIVATE
+#define SUBPROCESS_PRIVATE
#include "or/or.h"
#include "or/config.h"
#include "or/confparse.h"
@@ -17,6 +18,7 @@
#include "common/util.h"
#include "or/statefile.h"
#include "test/test.h"
+#include "lib/process/subprocess.h"
static void
reset_mp(managed_proxy_t *mp)
@@ -544,4 +546,3 @@ struct testcase_t pt_tests[] = {
NULL, NULL },
END_OF_TESTCASES
};
-
diff --git a/src/test/test_switch_id.c b/src/test/test_switch_id.c
index 149dda8f72..11fe53b7c5 100644
--- a/src/test/test_switch_id.c
+++ b/src/test/test_switch_id.c
@@ -2,6 +2,7 @@
/* See LICENSE for licensing information */
#include "or/or.h"
+#include "lib/process/setuid.h"
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
@@ -189,4 +190,3 @@ main(int argc, char **argv)
return (okay ? 0 : 1);
#endif /* defined(_WIN32) */
}
-
diff --git a/src/test/test_util.c b/src/test/test_util.c
index f1c2812f14..0c7e794b4a 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -10,6 +10,7 @@
#define UTIL_PRIVATE
#define UTIL_MALLOC_PRIVATE
#define SOCKET_PRIVATE
+#define SUBPROCESS_PRIVATE
#include "or/or.h"
#include "common/buffers.h"
#include "or/config.h"
@@ -17,10 +18,13 @@
#include "lib/crypt_ops/crypto_rand.h"
#include "test/test.h"
#include "lib/memarea/memarea.h"
-#include "common/util_process.h"
+#include "lib/process/waitpid.h"
#include "test/log_test_helpers.h"
#include "lib/compress/compress_zstd.h"
#include "lib/fdio/fdio.h"
+#include "lib/process/env.h"
+#include "lib/process/pidfile.h"
+#include "lib/process/subprocess.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/src/test/test_util_process.c b/src/test/test_util_process.c
index a09d12ac61..9dce520d04 100644
--- a/src/test/test_util_process.c
+++ b/src/test/test_util_process.c
@@ -7,7 +7,7 @@
#include "test/test.h"
-#include "common/util_process.h"
+#include "lib/process/waitpid.h"
#include "test/log_test_helpers.h"
diff --git a/src/test/test_util_slow.c b/src/test/test_util_slow.c
index 9fbcd9d2b3..aeb0d422c1 100644
--- a/src/test/test_util_slow.c
+++ b/src/test/test_util_slow.c
@@ -5,10 +5,12 @@
#include "orconfig.h"
#define UTIL_PRIVATE
+#define SUBPROCESS_PRIVATE
#include "common/util.h"
-#include "common/util_process.h"
+#include "lib/process/waitpid.h"
#include "lib/crypt_ops/crypto.h"
#include "lib/log/torlog.h"
+#include "lib/process/subprocess.h"
#include "test/test.h"
#ifndef BUILDDIR
@@ -388,4 +390,3 @@ struct testcase_t slow_util_tests[] = {
UTIL_TEST(spawn_background_waitpid_notify, 0),
END_OF_TESTCASES
};
-