aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitpadding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_circuitpadding.c')
-rw-r--r--src/test/test_circuitpadding.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c
index d349a4d3c3..a2381023ca 100644
--- a/src/test/test_circuitpadding.c
+++ b/src/test/test_circuitpadding.c
@@ -46,7 +46,6 @@ void test_circuitpadding_conditions(void *arg);
void test_circuitpadding_serialize(void *arg);
void test_circuitpadding_rtt(void *arg);
void test_circuitpadding_tokens(void *arg);
-void test_circuitpadding_circuitsetup_machine(void *arg);
static void
simulate_single_hop_extend(circuit_t *client, circuit_t *mid_relay,
@@ -794,7 +793,7 @@ test_circuitpadding_closest_token_removal(void *arg)
tt_int_op(client_side->padding_info[0]->current_state, OP_EQ,
CIRCPAD_STATE_BURST);
circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[0] = 100;
- circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[1] = 100;
+ circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[1] = 101;
circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[2] = 120;
mi->padding_scheduled_at_usec = current_time - 102;
mi->histogram[0] = 0;
@@ -903,7 +902,7 @@ test_circuitpadding_closest_token_removal_usec(void *arg)
tt_int_op(client_side->padding_info[0]->current_state, OP_EQ,
CIRCPAD_STATE_BURST);
circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[0] = 100;
- circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[1] = 100;
+ circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[1] = 101;
circ_client_machine.states[CIRCPAD_STATE_BURST].histogram_edges[2] = 120;
mi->padding_scheduled_at_usec = current_time - 102;
mi->histogram[0] = 0;
@@ -1649,7 +1648,7 @@ helper_create_conditional_machine(void)
ret->states[CIRCPAD_STATE_BURST].histogram_len = 3;
ret->states[CIRCPAD_STATE_BURST].histogram_edges[0] = 0;
- ret->states[CIRCPAD_STATE_BURST].histogram_edges[1] = 0;
+ ret->states[CIRCPAD_STATE_BURST].histogram_edges[1] = 1;
ret->states[CIRCPAD_STATE_BURST].histogram_edges[2] = 1000000;
ret->states[CIRCPAD_STATE_BURST].histogram[0] = 6;
@@ -1686,8 +1685,7 @@ helper_create_conditional_machines(void)
add->conditions.state_mask = CIRCPAD_CIRC_BUILDING|
CIRCPAD_CIRC_NO_STREAMS|CIRCPAD_CIRC_HAS_RELAY_EARLY;
add->conditions.purpose_mask = CIRCPAD_PURPOSE_ALL;
-
- smartlist_add(origin_padding_machines, add);
+ register_padding_machine(add, origin_padding_machines);
add = helper_create_conditional_machine();
add->machine_num = 3;
@@ -1706,15 +1704,15 @@ helper_create_conditional_machines(void)
add->conditions.state_mask = CIRCPAD_CIRC_OPENED|
CIRCPAD_CIRC_STREAMS|CIRCPAD_CIRC_HAS_NO_RELAY_EARLY;
add->conditions.purpose_mask = CIRCPAD_PURPOSE_ALL;
- smartlist_add(origin_padding_machines, add);
+ register_padding_machine(add, origin_padding_machines);
add = helper_create_conditional_machine();
add->machine_num = 2;
- smartlist_add(relay_padding_machines, add);
+ register_padding_machine(add, relay_padding_machines);
add = helper_create_conditional_machine();
add->machine_num = 3;
- smartlist_add(relay_padding_machines, add);
+ register_padding_machine(add, relay_padding_machines);
}
void
@@ -1840,6 +1838,8 @@ test_circuitpadding_conditions(void *arg)
return;
}
+/** Disabled unstable test until #29298 is implemented (see #29122) */
+#if 0
void
test_circuitpadding_circuitsetup_machine(void *arg)
{
@@ -2085,6 +2085,7 @@ test_circuitpadding_circuitsetup_machine(void *arg)
return;
}
+#endif
/** Helper function: Initializes a padding machine where every state uses the
* uniform probability distribution. */
@@ -2373,11 +2374,11 @@ test_circuitpadding_global_rate_limiting(void *arg)
{ #name, test_##name, (flags), NULL, NULL }
struct testcase_t circuitpadding_tests[] = {
- //TEST_CIRCUITPADDING(circuitpadding_circuitsetup_machine, 0),
TEST_CIRCUITPADDING(circuitpadding_tokens, TT_FORK),
TEST_CIRCUITPADDING(circuitpadding_negotiation, TT_FORK),
TEST_CIRCUITPADDING(circuitpadding_wronghop, TT_FORK),
- TEST_CIRCUITPADDING(circuitpadding_circuitsetup_machine, TT_FORK),
+ /** Disabled unstable test until #29298 is implemented (see #29122) */
+ // TEST_CIRCUITPADDING(circuitpadding_circuitsetup_machine, TT_FORK),
TEST_CIRCUITPADDING(circuitpadding_conditions, TT_FORK),
TEST_CIRCUITPADDING(circuitpadding_rtt, TT_FORK),
TEST_CIRCUITPADDING(circuitpadding_sample_distribution, TT_FORK),