[tor-commits] [tor/master] Don't expect unix sockets to be accepted on Windows
nickm at torproject.org
nickm at torproject.org
Mon Feb 1 14:58:22 UTC 2016
commit 49442b5e67710b7ed3c365c342aec3c18beb41d5
Author: Nick Mathewson <nickm at torproject.org>
Date: Mon Feb 1 09:57:54 2016 -0500
Don't expect unix sockets to be accepted on Windows
Fixes failures in test_config.c; bug not in any released tor.
---
src/test/test_config.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/test/test_config.c b/src/test/test_config.c
index 58487d7..c00e8e1 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -3958,12 +3958,16 @@ test_config_parse_port_config__ports__ports_given(void *data)
smartlist_clear(slout);
ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
CONN_TYPE_AP_LISTENER, NULL, 0, 0);
+#ifdef _WIN32
+ tt_int_op(ret, OP_EQ, -1);
+#else
tt_int_op(ret, OP_EQ, 0);
tt_int_op(smartlist_len(slout), OP_EQ, 1);
port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
tt_int_op(port_cfg->port, OP_EQ, 0);
tt_int_op(port_cfg->is_unix_addr, OP_EQ, 1);
tt_str_op(port_cfg->unix_addr, OP_EQ, "/tmp/foo/bar");
+#endif
// Test failure if we have no ipv4 and no ipv6 (for unix domain sockets,
// this makes no sense - it should be fixed)
@@ -3984,11 +3988,15 @@ test_config_parse_port_config__ports__ports_given(void *data)
ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
CONN_TYPE_AP_LISTENER, NULL, 0,
CL_PORT_TAKES_HOSTNAMES);
+#ifdef _WIN32
+ tt_int_op(ret, OP_EQ, -1);
+#else
tt_int_op(ret, OP_EQ, 0);
tt_int_op(smartlist_len(slout), OP_EQ, 1);
port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 0);
tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 1);
+#endif
// Test success with both ipv4 and ipv6 (for unix domain sockets,
// this makes no sense - it should be fixed)
@@ -3999,11 +4007,15 @@ test_config_parse_port_config__ports__ports_given(void *data)
ret = parse_port_config(slout, config_port_valid, NULL, "DNS",
CONN_TYPE_AP_LISTENER, NULL, 0,
CL_PORT_TAKES_HOSTNAMES);
+#ifdef _WIN32
+ tt_int_op(ret, OP_EQ, -1);
+#else
tt_int_op(ret, OP_EQ, 0);
tt_int_op(smartlist_len(slout), OP_EQ, 1);
port_cfg = (port_cfg_t *)smartlist_get(slout, 0);
tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 1);
tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 1);
+#endif
// Test failure if we specify world writable for an IP Port
tor_free(config_port_invalid);
More information about the tor-commits
mailing list