+ case SLAVE2_REGISTERED:
+ check_operation_success (event);
+ GNUNET_TESTBED_operation_done (op);
+ op = NULL;
+ result = SLAVE1_LINK_SUCCESS;
+ FAIL_TEST (NULL != slave2);
+ FAIL_TEST (NULL != slave);
+ op = GNUNET_TESTBED_peer_create (mc, slave, cfg, peer_create_cb, NULL);
+ FAIL_TEST (NULL != op);
+ break;
+
+ case SLAVE1_PEER_START_SUCCESS:
+ check_operation_success (event);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE2_LINK_SUCCESS;
+ op = GNUNET_TESTBED_peer_create (mc, slave2, cfg, peer_create_cb, NULL);
+ FAIL_TEST (NULL != op);
+ break;
+
+ case MASTER_PEER_CREATE_SUCCESS:
+ FAIL_TEST (GNUNET_TESTBED_ET_PEER_START == event->type);
+ FAIL_TEST (event->details.peer_start.host == host);
+ FAIL_TEST (event->details.peer_start.peer == master_peer);
+ GNUNET_TESTBED_operation_done (op);
+ op = NULL;
+ result = MASTER_PEER_START_SUCCESS;
+ slave = GNUNET_TESTBED_host_create_with_id (1, "127.0.0.1", NULL, cfg, 0);
+ FAIL_TEST (NULL != slave);
+ rh = GNUNET_TESTBED_register_host (mc, slave, ®istration_cont, NULL);
+ FAIL_TEST (NULL != rh);
+ break;
+
+ case SLAVE1_PEER_CREATE_SUCCESS:
+ FAIL_TEST (GNUNET_TESTBED_ET_PEER_START == event->type);
+ FAIL_TEST (event->details.peer_start.host == slave);
+ FAIL_TEST (event->details.peer_start.peer == slave1_peer);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE1_PEER_START_SUCCESS;
+ op = GNUNET_TESTBED_controller_link (NULL, mc, slave2, slave, GNUNET_YES);
+ break;
+
+ case SLAVE2_PEER_CREATE_SUCCESS:
+ FAIL_TEST (GNUNET_TESTBED_ET_PEER_STOP == event->type);
+ FAIL_TEST (event->details.peer_stop.peer == slave1_peer);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE1_PEER_STOP_SUCCESS;
+ op = GNUNET_TESTBED_peer_start (NULL, slave2_peer, NULL, NULL);
+ FAIL_TEST (NULL != op);
+ break;
+
+ case SLAVE3_PEER_CREATE_SUCCESS:
+ FAIL_TEST (GNUNET_TESTBED_ET_PEER_START == event->type);
+ FAIL_TEST (event->details.peer_start.host == slave3);
+ FAIL_TEST (event->details.peer_start.peer == slave3_peer);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE3_PEER_START_SUCCESS;
+ sleep (1);
+ LOG_DEBUG ("**************************************\n");
+ op =
+ GNUNET_TESTBED_overlay_connect (mc, NULL, NULL, slave2_peer, slave3_peer);
+ FAIL_TEST (NULL != op);
+ break;
+
+ case SLAVE3_PEER_START_SUCCESS:
+ FAIL_TEST (NULL != event);
+ FAIL_TEST (GNUNET_TESTBED_ET_CONNECT == event->type);
+ FAIL_TEST (event->details.peer_connect.peer1 == slave2_peer);
+ FAIL_TEST (event->details.peer_connect.peer2 == slave3_peer);
+ result = SLAVE2_SLAVE3_PEERS_CONNECTED;
+ GNUNET_TESTBED_operation_done (op);
+ op = NULL;
+ delay_task_id = GNUNET_SCHEDULER_add_delayed (
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1),
+ &delay_task,
+ NULL);
+ break;
+
+ case SLAVE1_PEER_STOP_SUCCESS:
+ FAIL_TEST (GNUNET_TESTBED_ET_PEER_START == event->type);
+ FAIL_TEST (event->details.peer_start.host == slave2);
+ FAIL_TEST (event->details.peer_start.peer == slave2_peer);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE2_PEER_START_SUCCESS;
+ op =
+ GNUNET_TESTBED_overlay_connect (mc, NULL, NULL, master_peer, slave2_peer);
+ break;
+
+ case SLAVE2_PEER_START_SUCCESS:
+ FAIL_TEST (NULL != event);
+ FAIL_TEST (GNUNET_TESTBED_ET_CONNECT == event->type);
+ FAIL_TEST (event->details.peer_connect.peer1 == master_peer);
+ FAIL_TEST (event->details.peer_connect.peer2 == slave2_peer);
+ result = MASTER_SLAVE2_PEERS_CONNECTED;
+ GNUNET_TESTBED_operation_done (op);
+ op = NULL;
+ delay_task_id = GNUNET_SCHEDULER_add_delayed (
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1),
+ &delay_task,
+ NULL);
+ break;
+
+ case SLAVE2_SLAVE3_PEERS_CONNECTED:
+ FAIL_TEST (GNUNET_TESTBED_ET_PEER_STOP == event->type);
+ FAIL_TEST (event->details.peer_stop.peer == slave2_peer);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE2_PEER_STOP_SUCCESS;
+ op = GNUNET_TESTBED_peer_destroy (slave1_peer);
+ FAIL_TEST (NULL != op);
+ break;
+
+ case SLAVE2_PEER_STOP_SUCCESS:
+ check_operation_success (event);
+ GNUNET_TESTBED_operation_done (op);
+ result = SLAVE1_PEER_DESTROY_SUCCESS;
+ op = GNUNET_TESTBED_peer_destroy (slave2_peer);
+ FAIL_TEST (NULL != op);
+ break;
+
+ case SLAVE1_PEER_DESTROY_SUCCESS:
+ check_operation_success (event);