diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-09-17 15:56:15 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-09-17 15:56:15 +0000 |
commit | aef68bb1827f5a25832f1ea4b1477295d5a33c2c (patch) | |
tree | d75ecb2e8a3696eb072ca091ce63ebba45f12279 /src | |
parent | 0e13b1098620c73c9e611eb18ec1cebb7e2aedbf (diff) | |
download | gnunet-aef68bb1827f5a25832f1ea4b1477295d5a33c2c.tar.gz gnunet-aef68bb1827f5a25832f1ea4b1477295d5a33c2c.zip |
testing api addition
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 11 | ||||
-rw-r--r-- | src/testing/testing.c | 19 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 10b1d5a87..488d1a94b 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -448,6 +448,17 @@ void | |||
448 | GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *daemon); | 448 | GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *daemon); |
449 | 449 | ||
450 | /** | 450 | /** |
451 | * Check whether the given daemon is running. | ||
452 | * | ||
453 | * @param daemon the daemon to check | ||
454 | * | ||
455 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the | ||
456 | * daemon is down, GNUNET_SYSERR on error. | ||
457 | */ | ||
458 | int | ||
459 | GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | ||
460 | |||
461 | /** | ||
451 | * Restart (stop and start) a GNUnet daemon. | 462 | * Restart (stop and start) a GNUnet daemon. |
452 | * | 463 | * |
453 | * @param d the daemon that should be restarted | 464 | * @param d the daemon that should be restarted |
diff --git a/src/testing/testing.c b/src/testing/testing.c index e493f5f6c..f2150697f 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -696,6 +696,25 @@ GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *daemon) | |||
696 | daemon->phase = SP_TOPOLOGY_SETUP; | 696 | daemon->phase = SP_TOPOLOGY_SETUP; |
697 | } | 697 | } |
698 | 698 | ||
699 | /** | ||
700 | * Check whether the given daemon is running. | ||
701 | * | ||
702 | * @param daemon the daemon to check | ||
703 | * | ||
704 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the | ||
705 | * daemon is down, GNUNET_SYSERR on error. | ||
706 | */ | ||
707 | int | ||
708 | GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon) | ||
709 | { | ||
710 | if (daemon == NULL) | ||
711 | return GNUNET_SYSERR; | ||
712 | |||
713 | if (daemon->running == GNUNET_YES) | ||
714 | return GNUNET_YES; | ||
715 | return GNUNET_NO; | ||
716 | } | ||
717 | |||
699 | 718 | ||
700 | /** | 719 | /** |
701 | * Start a peer that has previously been stopped using the daemon_stop | 720 | * Start a peer that has previously been stopped using the daemon_stop |