aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-05 09:56:25 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-05 09:56:25 +0000
commitd75fb1880a887a8f5339c5e8cf5e9d2b8755fdad (patch)
treef8dff53b4b88b0d87ca31a772607ee51fb0653ec /src/testing/testing.c
parentb9b0940e261a4b1713d909f0a2fd54134ed5b148 (diff)
downloadgnunet-d75fb1880a887a8f5339c5e8cf5e9d2b8755fdad.tar.gz
gnunet-d75fb1880a887a8f5339c5e8cf5e9d2b8755fdad.zip
improving ARM API
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r--src/testing/testing.c69
1 files changed, 65 insertions, 4 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index a82842777..4bdad178f 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -49,9 +49,8 @@
49#define ARM_START_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120) 49#define ARM_START_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
50 50
51/** 51/**
52 * How many times are we willing to try to 52 * How many times are we willing to try to wait for "scp" or
53 * wait for "scp" or "gnunet-service-arm" to 53 * "gnunet-service-arm" to complete (waitpid) before giving up?
54 * complete (waitpid) before giving up?
55 */ 54 */
56#define MAX_EXEC_WAIT_RUNS 50 55#define MAX_EXEC_WAIT_RUNS 50
57 56
@@ -60,12 +59,39 @@
60 */ 59 */
61enum StartPhase 60enum StartPhase
62 { 61 {
62 /**
63 * FIXME.
64 */
63 SP_COPYING, 65 SP_COPYING,
66
67 /**
68 * FIXME.
69 */
64 SP_COPIED, 70 SP_COPIED,
71
72 /**
73 * FIXME.
74 */
65 SP_START_ARMING, 75 SP_START_ARMING,
76
77 /**
78 * FIXME.
79 */
66 SP_START_CORE, 80 SP_START_CORE,
81
82 /**
83 * FIXME.
84 */
67 SP_START_DONE, 85 SP_START_DONE,
86
87 /**
88 * FIXME.
89 */
68 SP_CLEANUP, 90 SP_CLEANUP,
91
92 /**
93 * FIXME.
94 */
69 SP_CONFIG_UPDATE 95 SP_CONFIG_UPDATE
70 }; 96 };
71 97
@@ -839,21 +865,56 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
839 d); 865 d);
840} 866}
841 867
842 868/**
869 * FIXME.
870 */
843struct ConnectContext 871struct ConnectContext
844{ 872{
873 /**
874 * FIXME.
875 */
845 struct GNUNET_TESTING_Daemon *d1; 876 struct GNUNET_TESTING_Daemon *d1;
877
878 /**
879 * FIXME.
880 */
846 struct GNUNET_TESTING_Daemon *d2; 881 struct GNUNET_TESTING_Daemon *d2;
882
883 /**
884 * FIXME.
885 */
847 struct GNUNET_TRANSPORT_Handle *d1th; 886 struct GNUNET_TRANSPORT_Handle *d1th;
887
888 /**
889 * FIXME.
890 */
848 struct GNUNET_TRANSPORT_Handle *d2th; 891 struct GNUNET_TRANSPORT_Handle *d2th;
892
893 /**
894 * When should this operation be complete (or we must trigger
895 * a timeout).
896 */
849 struct GNUNET_TIME_Absolute timeout; 897 struct GNUNET_TIME_Absolute timeout;
898
899 /**
900 * Function to call once we are done (or have timed out).
901 */
850 GNUNET_TESTING_NotifyCompletion cb; 902 GNUNET_TESTING_NotifyCompletion cb;
903
904 /**
905 * Closure for "nb".
906 */
851 void *cb_cls; 907 void *cb_cls;
852}; 908};
853 909
854 910
855/** 911/**
856 * Success, connection is up. Signal client our success. 912 * Success, connection is up. Signal client our success.
913 *
914 * @param cls FIXME
915 * @param size number of bytes available in buf
916 * @param buf where to copy the message, NULL on error
917 * @return number of bytes copied to buf
857 */ 918 */
858static size_t 919static size_t
859transmit_ready (void *cls, size_t size, void *buf) 920transmit_ready (void *cls, size_t size, void *buf)