diff options
Diffstat (limited to 'src/test/test_hs_service.c')
-rw-r--r-- | src/test/test_hs_service.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index 2b8d6e597a..955bcc8aff 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -2025,10 +2025,10 @@ test_export_client_circuit_id(void *arg) /* Create service */ hs_service_t *service = helper_create_service(); /* Check that export circuit ID detection works */ - service->config.export_circuit_id = false; + service->config.circuit_id_protocol = HS_CIRCUIT_ID_PROTOCOL_NONE; tt_int_op(0, OP_EQ, hs_service_exports_circuit_id(&service->keys.identity_pk)); - service->config.export_circuit_id = true; + service->config.circuit_id_protocol = HS_CIRCUIT_ID_PROTOCOL_HAPROXY; tt_int_op(1, OP_EQ, hs_service_exports_circuit_id(&service->keys.identity_pk)); @@ -2047,7 +2047,8 @@ test_export_client_circuit_id(void *arg) or_circ->global_identifier = 666; /* Export circuit ID */ - export_hs_client_circuit_id_haproxy(edge_conn, conn); + export_hs_client_circuit_id(edge_conn, conn, + service->config.circuit_id_protocol); /* Check contents */ cp1 = buf_get_contents(conn->outbuf, &sz); @@ -2058,7 +2059,8 @@ test_export_client_circuit_id(void *arg) or_circ->global_identifier = 22; /* check changes */ - export_hs_client_circuit_id_haproxy(edge_conn, conn); + export_hs_client_circuit_id(edge_conn, conn, + service->config.circuit_id_protocol); cp2 = buf_get_contents(conn->outbuf, &sz); tt_str_op(cp1, OP_NE, cp2); tor_free(cp1); @@ -2066,7 +2068,8 @@ test_export_client_circuit_id(void *arg) /* Check that GID with UINT32_MAX works. */ or_circ->global_identifier = UINT32_MAX; - export_hs_client_circuit_id_haproxy(edge_conn, conn); + export_hs_client_circuit_id(edge_conn, conn, + service->config.circuit_id_protocol); cp1 = buf_get_contents(conn->outbuf, &sz); tt_str_op(cp1, OP_EQ, "PROXY TCP6 fc00:dead:beef:4dad::ffff:ffff ::1 65535 42\r\n"); @@ -2075,7 +2078,8 @@ test_export_client_circuit_id(void *arg) /* Check that GID with UINT16_MAX works. */ or_circ->global_identifier = UINT16_MAX; - export_hs_client_circuit_id_haproxy(edge_conn, conn); + export_hs_client_circuit_id(edge_conn, conn, + service->config.circuit_id_protocol); cp1 = buf_get_contents(conn->outbuf, &sz); tt_str_op(cp1, OP_EQ, "PROXY TCP6 fc00:dead:beef:4dad::0:ffff ::1 65535 42\r\n"); @@ -2084,7 +2088,8 @@ test_export_client_circuit_id(void *arg) /* Check that GID with UINT16_MAX + 7 works. */ or_circ->global_identifier = UINT16_MAX + 7; - export_hs_client_circuit_id_haproxy(edge_conn, conn); + export_hs_client_circuit_id(edge_conn, conn, + service->config.circuit_id_protocol); cp1 = buf_get_contents(conn->outbuf, &sz); tt_str_op(cp1, OP_EQ, "PROXY TCP6 fc00:dead:beef:4dad::1:6 ::1 6 42\r\n"); |