aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_3peers_3controllers.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-25 15:28:08 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-25 15:28:08 +0000
commit30c5c323f28ade8a1e7c6c593778793e44accb3a (patch)
tree845955ec895d221338b44f0cadce7932932e78cc /src/testbed/test_testbed_api_3peers_3controllers.c
parent43d558efd13a3245e65efd0acdc9c4ba59cd2bee (diff)
downloadgnunet-30c5c323f28ade8a1e7c6c593778793e44accb3a.tar.gz
gnunet-30c5c323f28ade8a1e7c6c593778793e44accb3a.zip
- indent
Diffstat (limited to 'src/testbed/test_testbed_api_3peers_3controllers.c')
-rw-r--r--src/testbed/test_testbed_api_3peers_3controllers.c188
1 files changed, 91 insertions, 97 deletions
diff --git a/src/testbed/test_testbed_api_3peers_3controllers.c b/src/testbed/test_testbed_api_3peers_3controllers.c
index 2f08fb475..47ad81021 100644
--- a/src/testbed/test_testbed_api_3peers_3controllers.c
+++ b/src/testbed/test_testbed_api_3peers_3controllers.c
@@ -31,7 +31,7 @@
31 * A 31 * A
32 * / \ 32 * / \
33 * / \ 33 * / \
34 * B === C 34 * B === C
35 * A is the master controller and B, C are slave controllers. B links to C 35 * A is the master controller and B, C are slave controllers. B links to C
36 * laterally. 36 * laterally.
37 * Peers are mapped to controllers in the following relations: 37 * Peers are mapped to controllers in the following relations:
@@ -320,7 +320,7 @@ abort_test ()
320 * @param emsg error message in case the operation has failed; will be NULL if 320 * @param emsg error message in case the operation has failed; will be NULL if
321 * operation has executed successfully. 321 * operation has executed successfully.
322 */ 322 */
323static void 323static void
324op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg); 324op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
325 325
326 326
@@ -337,11 +337,12 @@ do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
337 if (NULL != common_operation) 337 if (NULL != common_operation)
338 { 338 {
339 GNUNET_break (0); 339 GNUNET_break (0);
340 abort_test(); 340 abort_test ();
341 return; 341 return;
342 } 342 }
343 common_operation = GNUNET_TESTBED_overlay_connect (NULL, &op_comp_cb, NULL, 343 common_operation =
344 peer1.peer, peer2.peer); 344 GNUNET_TESTBED_overlay_connect (NULL, &op_comp_cb, NULL, peer1.peer,
345 peer2.peer);
345} 346}
346 347
347 348
@@ -353,33 +354,32 @@ do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
353 * @param emsg error message in case the operation has failed; will be NULL if 354 * @param emsg error message in case the operation has failed; will be NULL if
354 * operation has executed successfully. 355 * operation has executed successfully.
355 */ 356 */
356static void 357static void
357op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg) 358op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
358{ 359{
359 if (common_operation != op) 360 if (common_operation != op)
360 { 361 {
361 GNUNET_break (0); 362 GNUNET_break (0);
362 abort_test(); 363 abort_test ();
363 return; 364 return;
364 } 365 }
365 366
366 switch(result) 367 switch (result)
367 { 368 {
368 case PEER3_STARTED: 369 case PEER3_STARTED:
369 case PEERS_2_3_CONNECTED: 370 case PEERS_2_3_CONNECTED:
370 case PEERS_1_2_CONNECTED: 371 case PEERS_1_2_CONNECTED:
371 break; 372 break;
372 default: 373 default:
373 GNUNET_break (0); 374 GNUNET_break (0);
374 abort_test(); 375 abort_test ();
375 return; 376 return;
376 } 377 }
377 if ((NULL != peer1.operation) || 378 if ((NULL != peer1.operation) || (NULL != peer2.operation) ||
378 (NULL != peer2.operation) ||
379 (NULL != peer3.operation)) 379 (NULL != peer3.operation))
380 { 380 {
381 GNUNET_break (0); 381 GNUNET_break (0);
382 abort_test(); 382 abort_test ();
383 return; 383 return;
384 } 384 }
385} 385}
@@ -400,12 +400,10 @@ peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
400 switch (result) 400 switch (result)
401 { 401 {
402 case CONTROLLER1_UP: 402 case CONTROLLER1_UP:
403 if ((NULL == peer1.operation) || 403 if ((NULL == peer1.operation) || (NULL == peer) || (NULL != peer1.peer))
404 (NULL == peer) ||
405 (NULL != peer1.peer))
406 { 404 {
407 GNUNET_break (0); 405 GNUNET_break (0);
408 abort_test(); 406 abort_test ();
409 return; 407 return;
410 } 408 }
411 peer1.peer = peer; 409 peer1.peer = peer;
@@ -414,12 +412,10 @@ peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
414 peer1.operation = GNUNET_TESTBED_peer_start (NULL, peer, NULL, NULL); 412 peer1.operation = GNUNET_TESTBED_peer_start (NULL, peer, NULL, NULL);
415 break; 413 break;
416 case CONTROLLER2_UP: 414 case CONTROLLER2_UP:
417 if ((NULL == peer2.operation) || 415 if ((NULL == peer2.operation) || (NULL == peer) || (NULL != peer2.peer))
418 (NULL == peer) ||
419 (NULL != peer2.peer))
420 { 416 {
421 GNUNET_break (0); 417 GNUNET_break (0);
422 abort_test(); 418 abort_test ();
423 return; 419 return;
424 } 420 }
425 peer2.peer = peer; 421 peer2.peer = peer;
@@ -428,12 +424,10 @@ peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
428 peer2.operation = GNUNET_TESTBED_peer_start (NULL, peer, NULL, NULL); 424 peer2.operation = GNUNET_TESTBED_peer_start (NULL, peer, NULL, NULL);
429 break; 425 break;
430 case CONTROLLER3_UP: 426 case CONTROLLER3_UP:
431 if ((NULL == peer3.operation) || 427 if ((NULL == peer3.operation) || (NULL == peer) || (NULL != peer3.peer))
432 (NULL == peer) ||
433 (NULL != peer3.peer))
434 { 428 {
435 GNUNET_break (0); 429 GNUNET_break (0);
436 abort_test(); 430 abort_test ();
437 return; 431 return;
438 } 432 }
439 peer3.peer = peer; 433 peer3.peer = peer;
@@ -443,9 +437,9 @@ peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
443 break; 437 break;
444 default: 438 default:
445 GNUNET_break (0); 439 GNUNET_break (0);
446 abort_test(); 440 abort_test ();
447 return; 441 return;
448 } 442 }
449} 443}
450 444
451 445
@@ -462,20 +456,20 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
462 switch (event->type) 456 switch (event->type)
463 { 457 {
464 case GNUNET_TESTBED_ET_OPERATION_FINISHED: 458 case GNUNET_TESTBED_ET_OPERATION_FINISHED:
465 if ((NULL != event->details.operation_finished.op_cls) 459 if ((NULL != event->details.operation_finished.op_cls) ||
466 || (NULL != event->details.operation_finished.emsg)) 460 (NULL != event->details.operation_finished.emsg))
467 { 461 {
468 GNUNET_break (0); 462 GNUNET_break (0);
469 abort_test(); 463 abort_test ();
470 return; 464 return;
471 } 465 }
472 switch (result) 466 switch (result)
473 { 467 {
474 case PEERS_STOPPED: 468 case PEERS_STOPPED:
475 if (NULL != event->details.operation_finished.generic) 469 if (NULL != event->details.operation_finished.generic)
476 { 470 {
477 GNUNET_break (0); 471 GNUNET_break (0);
478 abort_test(); 472 abort_test ();
479 return; 473 return;
480 } 474 }
481 if (event->details.operation_finished.operation == peer1.operation) 475 if (event->details.operation_finished.operation == peer1.operation)
@@ -499,7 +493,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
499 else 493 else
500 { 494 {
501 GNUNET_break (0); 495 GNUNET_break (0);
502 abort_test(); 496 abort_test ();
503 return; 497 return;
504 } 498 }
505 if ((NULL == peer1.peer) && (NULL == peer2.peer) && (NULL == peer3.peer)) 499 if ((NULL == peer1.peer) && (NULL == peer2.peer) && (NULL == peer3.peer))
@@ -513,7 +507,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
513 (NULL == common_operation)) 507 (NULL == common_operation))
514 { 508 {
515 GNUNET_break (0); 509 GNUNET_break (0);
516 abort_test(); 510 abort_test ();
517 return; 511 return;
518 } 512 }
519 GNUNET_TESTBED_operation_done (common_operation); 513 GNUNET_TESTBED_operation_done (common_operation);
@@ -525,7 +519,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
525 if (NULL == peer2.operation) 519 if (NULL == peer2.operation)
526 { 520 {
527 GNUNET_break (0); 521 GNUNET_break (0);
528 abort_test(); 522 abort_test ();
529 return; 523 return;
530 } 524 }
531 break; 525 break;
@@ -534,7 +528,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
534 (NULL == common_operation)) 528 (NULL == common_operation))
535 { 529 {
536 GNUNET_break (0); 530 GNUNET_break (0);
537 abort_test(); 531 abort_test ();
538 return; 532 return;
539 } 533 }
540 GNUNET_TESTBED_operation_done (common_operation); 534 GNUNET_TESTBED_operation_done (common_operation);
@@ -546,24 +540,24 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
546 if (NULL == peer3.operation) 540 if (NULL == peer3.operation)
547 { 541 {
548 GNUNET_break (0); 542 GNUNET_break (0);
549 abort_test(); 543 abort_test ();
550 return; 544 return;
551 } 545 }
552 break; 546 break;
553 default: 547 default:
554 GNUNET_break (0); 548 GNUNET_break (0);
555 abort_test(); 549 abort_test ();
556 return; 550 return;
557 } 551 }
558 break; 552 break;
559 case GNUNET_TESTBED_ET_PEER_START: 553 case GNUNET_TESTBED_ET_PEER_START:
560 switch (result) 554 switch (result)
561 { 555 {
562 case PEER1_CREATED: 556 case PEER1_CREATED:
563 if (event->details.peer_start.host != host) 557 if (event->details.peer_start.host != host)
564 { 558 {
565 GNUNET_break (0); 559 GNUNET_break (0);
566 abort_test(); 560 abort_test ();
567 return; 561 return;
568 } 562 }
569 peer1.is_running = GNUNET_YES; 563 peer1.is_running = GNUNET_YES;
@@ -571,14 +565,14 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
571 peer1.operation = NULL; 565 peer1.operation = NULL;
572 result = PEER1_STARTED; 566 result = PEER1_STARTED;
573 common_operation = 567 common_operation =
574 GNUNET_TESTBED_controller_link (NULL, controller1, neighbour1, NULL, cfg, 568 GNUNET_TESTBED_controller_link (NULL, controller1, neighbour1, NULL,
575 GNUNET_YES); 569 cfg, GNUNET_YES);
576 break; 570 break;
577 case PEER2_CREATED: 571 case PEER2_CREATED:
578 if (event->details.peer_start.host != neighbour1) 572 if (event->details.peer_start.host != neighbour1)
579 { 573 {
580 GNUNET_break (0); 574 GNUNET_break (0);
581 abort_test(); 575 abort_test ();
582 return; 576 return;
583 } 577 }
584 peer2.is_running = GNUNET_YES; 578 peer2.is_running = GNUNET_YES;
@@ -588,16 +582,16 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
588 if (NULL != common_operation) 582 if (NULL != common_operation)
589 { 583 {
590 GNUNET_break (0); 584 GNUNET_break (0);
591 abort_test(); 585 abort_test ();
592 return; 586 return;
593 } 587 }
594 common_operation = 588 common_operation =
595 GNUNET_TESTBED_controller_link (NULL, controller1, neighbour2, NULL, cfg, 589 GNUNET_TESTBED_controller_link (NULL, controller1, neighbour2, NULL,
596 GNUNET_YES); 590 cfg, GNUNET_YES);
597 if (NULL == common_operation) 591 if (NULL == common_operation)
598 { 592 {
599 GNUNET_break (0); 593 GNUNET_break (0);
600 abort_test(); 594 abort_test ();
601 return; 595 return;
602 } 596 }
603 break; 597 break;
@@ -605,7 +599,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
605 if (event->details.peer_start.host != neighbour2) 599 if (event->details.peer_start.host != neighbour2)
606 { 600 {
607 GNUNET_break (0); 601 GNUNET_break (0);
608 abort_test(); 602 abort_test ();
609 return; 603 return;
610 } 604 }
611 peer3.is_running = GNUNET_YES; 605 peer3.is_running = GNUNET_YES;
@@ -618,15 +612,15 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
618 break; 612 break;
619 default: 613 default:
620 GNUNET_break (0); 614 GNUNET_break (0);
621 abort_test(); 615 abort_test ();
622 return; 616 return;
623 } 617 }
624 break; 618 break;
625 case GNUNET_TESTBED_ET_PEER_STOP: 619 case GNUNET_TESTBED_ET_PEER_STOP:
626 if (PEERS_CONNECTED_2 != result) 620 if (PEERS_CONNECTED_2 != result)
627 { 621 {
628 GNUNET_break (0); 622 GNUNET_break (0);
629 abort_test(); 623 abort_test ();
630 return; 624 return;
631 } 625 }
632 if (event->details.peer_stop.peer == peer1.peer) 626 if (event->details.peer_stop.peer == peer1.peer)
@@ -647,11 +641,10 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
647 else 641 else
648 { 642 {
649 GNUNET_break (0); 643 GNUNET_break (0);
650 abort_test(); 644 abort_test ();
651 return; 645 return;
652 } 646 }
653 if ((GNUNET_NO == peer1.is_running) && 647 if ((GNUNET_NO == peer1.is_running) && (GNUNET_NO == peer2.is_running) &&
654 (GNUNET_NO == peer2.is_running) &&
655 (GNUNET_NO == peer3.is_running)) 648 (GNUNET_NO == peer3.is_running))
656 { 649 {
657 result = PEERS_STOPPED; 650 result = PEERS_STOPPED;
@@ -661,13 +654,11 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
661 } 654 }
662 break; 655 break;
663 case GNUNET_TESTBED_ET_CONNECT: 656 case GNUNET_TESTBED_ET_CONNECT:
664 if ((NULL != peer1.operation) || 657 if ((NULL != peer1.operation) || (NULL != peer2.operation) ||
665 (NULL != peer2.operation) || 658 (NULL != peer3.operation) || (NULL == common_operation))
666 (NULL != peer3.operation) ||
667 (NULL == common_operation))
668 { 659 {
669 GNUNET_break (0); 660 GNUNET_break (0);
670 abort_test(); 661 abort_test ();
671 return; 662 return;
672 } 663 }
673 switch (result) 664 switch (result)
@@ -677,38 +668,38 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
677 (event->details.peer_connect.peer2 != peer1.peer)) 668 (event->details.peer_connect.peer2 != peer1.peer))
678 { 669 {
679 GNUNET_break (0); 670 GNUNET_break (0);
680 abort_test(); 671 abort_test ();
681 return; 672 return;
682 } 673 }
683 GNUNET_TESTBED_operation_done (common_operation); 674 GNUNET_TESTBED_operation_done (common_operation);
684 common_operation = NULL; 675 common_operation = NULL;
685 result = PEERS_1_2_CONNECTED; 676 result = PEERS_1_2_CONNECTED;
686 LOG (GNUNET_ERROR_TYPE_DEBUG, "Peers connected\n"); 677 LOG (GNUNET_ERROR_TYPE_DEBUG, "Peers connected\n");
687 common_operation = 678 common_operation =
688 GNUNET_TESTBED_overlay_connect (NULL, &op_comp_cb, NULL, peer2.peer, 679 GNUNET_TESTBED_overlay_connect (NULL, &op_comp_cb, NULL, peer2.peer,
689 peer3.peer); 680 peer3.peer);
690 break; 681 break;
691 case PEERS_1_2_CONNECTED: 682 case PEERS_1_2_CONNECTED:
692 if ((event->details.peer_connect.peer1 != peer2.peer) || 683 if ((event->details.peer_connect.peer1 != peer2.peer) ||
693 (event->details.peer_connect.peer2 != peer3.peer)) 684 (event->details.peer_connect.peer2 != peer3.peer))
694 { 685 {
695 GNUNET_break (0); 686 GNUNET_break (0);
696 abort_test(); 687 abort_test ();
697 return; 688 return;
698 } 689 }
699 GNUNET_TESTBED_operation_done (common_operation); 690 GNUNET_TESTBED_operation_done (common_operation);
700 common_operation = NULL; 691 common_operation = NULL;
701 result = PEERS_2_3_CONNECTED; 692 result = PEERS_2_3_CONNECTED;
702 delayed_connect_task = 693 delayed_connect_task =
703 GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (3), 694 GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (3), &do_delayed_connect,
704 &do_delayed_connect, NULL); 695 NULL);
705 break; 696 break;
706 case PEERS_2_3_CONNECTED: 697 case PEERS_2_3_CONNECTED:
707 if ((event->details.peer_connect.peer1 != peer1.peer) || 698 if ((event->details.peer_connect.peer1 != peer1.peer) ||
708 (event->details.peer_connect.peer2 != peer2.peer)) 699 (event->details.peer_connect.peer2 != peer2.peer))
709 { 700 {
710 GNUNET_break (0); 701 GNUNET_break (0);
711 abort_test(); 702 abort_test ();
712 return; 703 return;
713 } 704 }
714 GNUNET_TESTBED_operation_done (common_operation); 705 GNUNET_TESTBED_operation_done (common_operation);
@@ -721,13 +712,13 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
721 break; 712 break;
722 default: 713 default:
723 GNUNET_break (0); 714 GNUNET_break (0);
724 abort_test(); 715 abort_test ();
725 return; 716 return;
726 } 717 }
727 break; 718 break;
728 default: 719 default:
729 GNUNET_break (0); 720 GNUNET_break (0);
730 abort_test(); 721 abort_test ();
731 return; 722 return;
732 } 723 }
733} 724}
@@ -749,16 +740,16 @@ registration_comp (void *cls, const char *emsg)
749 if (NULL == neighbour2) 740 if (NULL == neighbour2)
750 { 741 {
751 GNUNET_break (0); 742 GNUNET_break (0);
752 abort_test(); 743 abort_test ();
753 return; 744 return;
754 } 745 }
755 reg_handle = 746 reg_handle =
756 GNUNET_TESTBED_register_host (controller1, neighbour2, &registration_comp, 747 GNUNET_TESTBED_register_host (controller1, neighbour2,
757 neighbour2); 748 &registration_comp, neighbour2);
758 if (NULL == reg_handle) 749 if (NULL == reg_handle)
759 { 750 {
760 GNUNET_break (0); 751 GNUNET_break (0);
761 abort_test(); 752 abort_test ();
762 return; 753 return;
763 } 754 }
764 return; 755 return;
@@ -766,7 +757,7 @@ registration_comp (void *cls, const char *emsg)
766 if (cls != neighbour2) 757 if (cls != neighbour2)
767 { 758 {
768 GNUNET_break (0); 759 GNUNET_break (0);
769 abort_test(); 760 abort_test ();
770 return; 761 return;
771 } 762 }
772 peer1.operation = 763 peer1.operation =
@@ -775,7 +766,7 @@ registration_comp (void *cls, const char *emsg)
775 if (NULL == peer1.operation) 766 if (NULL == peer1.operation)
776 { 767 {
777 GNUNET_break (0); 768 GNUNET_break (0);
778 abort_test(); 769 abort_test ();
779 return; 770 return;
780 } 771 }
781} 772}
@@ -791,15 +782,16 @@ registration_comp (void *cls, const char *emsg)
791 * GNUNET_TESTBED_controller_stop() shouldn't be called in this case 782 * GNUNET_TESTBED_controller_stop() shouldn't be called in this case
792 */ 783 */
793static void 784static void
794status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int status) 785status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config,
786 int status)
795{ 787{
796 uint64_t event_mask; 788 uint64_t event_mask;
797 789
798 if (GNUNET_OK != status) 790 if (GNUNET_OK != status)
799 { 791 {
800 GNUNET_break (0); 792 GNUNET_break (0);
801 cp1 = NULL; 793 cp1 = NULL;
802 abort_test(); 794 abort_test ();
803 return; 795 return;
804 } 796 }
805 event_mask = 0; 797 event_mask = 0;
@@ -811,12 +803,12 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int stat
811 { 803 {
812 case INIT: 804 case INIT:
813 controller1 = 805 controller1 =
814 GNUNET_TESTBED_controller_connect (config, host, event_mask, &controller_cb, 806 GNUNET_TESTBED_controller_connect (config, host, event_mask,
815 NULL); 807 &controller_cb, NULL);
816 if (NULL == controller1) 808 if (NULL == controller1)
817 { 809 {
818 GNUNET_break (0); 810 GNUNET_break (0);
819 abort_test(); 811 abort_test ();
820 return; 812 return;
821 } 813 }
822 result = CONTROLLER1_UP; 814 result = CONTROLLER1_UP;
@@ -824,24 +816,24 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int stat
824 if (NULL == neighbour1) 816 if (NULL == neighbour1)
825 { 817 {
826 GNUNET_break (0); 818 GNUNET_break (0);
827 abort_test(); 819 abort_test ();
828 return; 820 return;
829 } 821 }
830 reg_handle = 822 reg_handle =
831 GNUNET_TESTBED_register_host (controller1, neighbour1, &registration_comp, 823 GNUNET_TESTBED_register_host (controller1, neighbour1,
832 neighbour1); 824 &registration_comp, neighbour1);
833 if (NULL == reg_handle) 825 if (NULL == reg_handle)
834 { 826 {
835 GNUNET_break (0); 827 GNUNET_break (0);
836 abort_test(); 828 abort_test ();
837 return; 829 return;
838 } 830 }
839 break; 831 break;
840 default: 832 default:
841 GNUNET_break (0); 833 GNUNET_break (0);
842 abort_test(); 834 abort_test ();
843 return; 835 return;
844 } 836 }
845} 837}
846 838
847 839
@@ -855,8 +847,9 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int stat
855 * given to GNUNET_TESTBED_is_host_habitable() is NULL 847 * given to GNUNET_TESTBED_is_host_habitable() is NULL
856 * @param status GNUNET_YES if it is habitable; GNUNET_NO if not 848 * @param status GNUNET_YES if it is habitable; GNUNET_NO if not
857 */ 849 */
858static void 850static void
859host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host, int status) 851host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host,
852 int status)
860{ 853{
861 hc_handle = NULL; 854 hc_handle = NULL;
862 if (GNUNET_NO == status) 855 if (GNUNET_NO == status)
@@ -871,8 +864,8 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host, int statu
871 result = SKIP; 864 result = SKIP;
872 return; 865 return;
873 } 866 }
874 cp1 = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, 867 cp1 =
875 NULL); 868 GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, NULL);
876} 869}
877 870
878 871
@@ -892,12 +885,13 @@ run (void *cls, char *const *args, const char *cfgfile,
892 if (NULL == host) 885 if (NULL == host)
893 { 886 {
894 GNUNET_break (0); 887 GNUNET_break (0);
895 abort_test(); 888 abort_test ();
896 return; 889 return;
897 } 890 }
898 if (NULL == (hc_handle = GNUNET_TESTBED_is_host_habitable (host, config, 891 if (NULL ==
899 &host_habitable_cb, 892 (hc_handle =
900 NULL))) 893 GNUNET_TESTBED_is_host_habitable (host, config, &host_habitable_cb,
894 NULL)))
901 { 895 {
902 GNUNET_TESTBED_host_destroy (host); 896 GNUNET_TESTBED_host_destroy (host);
903 host = NULL; 897 host = NULL;
@@ -923,8 +917,8 @@ int
923main (int argc, char **argv) 917main (int argc, char **argv)
924{ 918{
925 char *const argv2[] = { "test_testbed_api_3peers_3controllers", 919 char *const argv2[] = { "test_testbed_api_3peers_3controllers",
926 "-c", "test_testbed_api.conf", 920 "-c", "test_testbed_api.conf",
927 NULL 921 NULL
928 }; 922 };
929 struct GNUNET_GETOPT_CommandLineOption options[] = { 923 struct GNUNET_GETOPT_CommandLineOption options[] = {
930 GNUNET_GETOPT_OPTION_END 924 GNUNET_GETOPT_OPTION_END