aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-03-09 12:23:55 +0000
committerChristian Grothoff <christian@grothoff.org>2012-03-09 12:23:55 +0000
commit64cb39f0d4ba7edfbbebd100cffb4a0c76d8caa5 (patch)
tree4e7acf1fa05f1fa6f17a0b5c5bff7846e8bec2b7
parent4d340e04159fa0c491fa7d4976b3621bbbbcf35f (diff)
downloadgnunet-64cb39f0d4ba7edfbbebd100cffb4a0c76d8caa5.tar.gz
gnunet-64cb39f0d4ba7edfbbebd100cffb4a0c76d8caa5.zip
-removing 'proc' and replacing it with a different proc for each of the different types of processes being started so that we can actually figure out which ones are running
-rw-r--r--src/include/gnunet_testing_lib.h29
-rw-r--r--src/testing/testing.c108
2 files changed, 85 insertions, 52 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 03b837668..b170670d1 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -304,9 +304,34 @@ struct GNUNET_TESTING_Daemon
304 void *update_cb_cls; 304 void *update_cb_cls;
305 305
306 /** 306 /**
307 * PID of the process that we started last. 307 * PID of the process we used to run gnunet-arm or SSH to start the peer.
308 */ 308 */
309 struct GNUNET_OS_Process *proc; 309 struct GNUNET_OS_Process *proc_arm_start;
310
311 /**
312 * PID of the process we used to run gnunet-arm or SSH to stop the peer.
313 */
314 struct GNUNET_OS_Process *proc_arm_stop;
315
316 /**
317 * PID of the process we used to run gnunet-arm or SSH to manage services at the peer.
318 */
319 struct GNUNET_OS_Process *proc_arm_srv_start;
320
321 /**
322 * PID of the process we used to run gnunet-arm or SSH to manage services at the peer.
323 */
324 struct GNUNET_OS_Process *proc_arm_srv_stop;
325
326 /**
327 * PID of the process we used to run copy files
328 */
329 struct GNUNET_OS_Process *proc_arm_copying;
330
331 /**
332 * PID of the process we used to run gnunet-peerinfo.
333 */
334 struct GNUNET_OS_Process *proc_arm_peerinfo;
310 335
311 /** 336 /**
312 * Handle to the server. 337 * Handle to the server.
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 16cee9037..f7fd087fa 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -192,7 +192,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
192 { 192 {
193 case SP_COPYING: 193 case SP_COPYING:
194 /* confirm copying complete */ 194 /* confirm copying complete */
195 if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code)) 195 if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_copying, &type, &code))
196 { 196 {
197 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) 197 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
198 { 198 {
@@ -218,7 +218,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
218 cb (d->cb_cls, NULL, d->cfg, d, _("`scp' did not complete cleanly.\n")); 218 cb (d->cb_cls, NULL, d->cfg, d, _("`scp' did not complete cleanly.\n"));
219 return; 219 return;
220 } 220 }
221 GNUNET_OS_process_close (d->proc); 221 GNUNET_OS_process_close (d->proc_arm_copying);
222 d->proc_arm_copying = NULL;
222 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
223 "Successfully copied configuration file.\n"); 224 "Successfully copied configuration file.\n");
224 d->phase = SP_COPIED; 225 d->phase = SP_COPIED;
@@ -227,6 +228,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
227 /* Start create hostkey process if we don't already know the peer identity! */ 228 /* Start create hostkey process if we don't already know the peer identity! */
228 if (GNUNET_NO == d->have_hostkey) 229 if (GNUNET_NO == d->have_hostkey)
229 { 230 {
231 GNUNET_assert (NULL == d->proc_arm_peerinfo);
230 d->pipe_stdout = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_YES); 232 d->pipe_stdout = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_YES);
231 if (d->pipe_stdout == NULL) 233 if (d->pipe_stdout == NULL)
232 { 234 {
@@ -246,7 +248,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
246 "Starting `%s', with command `%s %s %s %s'.\n", 248 "Starting `%s', with command `%s %s %s %s'.\n",
247 "gnunet-peerinfo", "gnunet-peerinfo", "-c", d->cfgfile, 249 "gnunet-peerinfo", "gnunet-peerinfo", "-c", d->cfgfile,
248 "-sq"); 250 "-sq");
249 d->proc = 251 d->proc_arm_peerinfo =
250 GNUNET_OS_start_process (GNUNET_YES, NULL, d->pipe_stdout, "gnunet-peerinfo", 252 GNUNET_OS_start_process (GNUNET_YES, NULL, d->pipe_stdout, "gnunet-peerinfo",
251 "gnunet-peerinfo", "-c", d->cfgfile, "-sq", 253 "gnunet-peerinfo", "-c", d->cfgfile, "-sq",
252 NULL); 254 NULL);
@@ -265,7 +267,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
265 d->cfgfile, "-sq"); 267 d->cfgfile, "-sq");
266 if (d->ssh_port_str == NULL) 268 if (d->ssh_port_str == NULL)
267 { 269 {
268 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh", 270 d->proc_arm_peerinfo = GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh",
269#if !DEBUG_TESTING 271#if !DEBUG_TESTING
270 "-q", 272 "-q",
271#endif 273#endif
@@ -274,7 +276,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
274 } 276 }
275 else 277 else
276 { 278 {
277 d->proc = 279 d->proc_arm_peerinfo =
278 GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh", "-p", 280 GNUNET_OS_start_process (GNUNET_NO, NULL, d->pipe_stdout, "ssh", "ssh", "-p",
279 d->ssh_port_str, 281 d->ssh_port_str,
280#if !DEBUG_TESTING 282#if !DEBUG_TESTING
@@ -286,7 +288,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
286 GNUNET_DISK_pipe_close_end (d->pipe_stdout, GNUNET_DISK_PIPE_END_WRITE); 288 GNUNET_DISK_pipe_close_end (d->pipe_stdout, GNUNET_DISK_PIPE_END_WRITE);
287 GNUNET_free (dst); 289 GNUNET_free (dst);
288 } 290 }
289 if (NULL == d->proc) 291 if (NULL == d->proc_arm_peerinfo)
290 { 292 {
291 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 293 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
292 _("Could not start `%s' process to create hostkey.\n"), 294 _("Could not start `%s' process to create hostkey.\n"),
@@ -366,10 +368,10 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
366 d->cb = NULL; 368 d->cb = NULL;
367 GNUNET_DISK_pipe_close (d->pipe_stdout); 369 GNUNET_DISK_pipe_close (d->pipe_stdout);
368 d->pipe_stdout = NULL; 370 d->pipe_stdout = NULL;
369 (void) GNUNET_OS_process_kill (d->proc, SIGKILL); 371 (void) GNUNET_OS_process_kill (d->proc_arm_peerinfo, SIGKILL);
370 GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc)); 372 GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc_arm_peerinfo));
371 GNUNET_OS_process_close (d->proc); 373 GNUNET_OS_process_close (d->proc_arm_peerinfo);
372 d->proc = NULL; 374 d->proc_arm_peerinfo = NULL;
373 if (NULL != cb) 375 if (NULL != cb)
374 cb (d->cb_cls, NULL, d->cfg, d, _("Failed to get hostkey!\n")); 376 cb (d->cb_cls, NULL, d->cfg, d, _("Failed to get hostkey!\n"));
375 return; 377 return;
@@ -377,10 +379,10 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
377 d->shortname = GNUNET_strdup (GNUNET_i2s (&d->id)); 379 d->shortname = GNUNET_strdup (GNUNET_i2s (&d->id));
378 GNUNET_DISK_pipe_close (d->pipe_stdout); 380 GNUNET_DISK_pipe_close (d->pipe_stdout);
379 d->pipe_stdout = NULL; 381 d->pipe_stdout = NULL;
380 (void) GNUNET_OS_process_kill (d->proc, SIGKILL); 382 (void) GNUNET_OS_process_kill (d->proc_arm_peerinfo, SIGKILL);
381 GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc)); 383 GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (d->proc_arm_peerinfo));
382 GNUNET_OS_process_close (d->proc); 384 GNUNET_OS_process_close (d->proc_arm_peerinfo);
383 d->proc = NULL; 385 d->proc_arm_peerinfo = NULL;
384 d->have_hostkey = GNUNET_YES; 386 d->have_hostkey = GNUNET_YES;
385 if (d->hostkey_callback != NULL) 387 if (d->hostkey_callback != NULL)
386 { 388 {
@@ -413,13 +415,14 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
413 break; 415 break;
414 case SP_TOPOLOGY_SETUP: /* Indicates topology setup has completed! */ 416 case SP_TOPOLOGY_SETUP: /* Indicates topology setup has completed! */
415 /* start GNUnet on remote host */ 417 /* start GNUnet on remote host */
418 fprintf (stderr, "Starting\n");
416 if (NULL == d->hostname) 419 if (NULL == d->hostname)
417 { 420 {
418 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 421 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
419 "Starting `%s', with command `%s %s %s %s %s %s'.\n", 422 "Starting `%s', with command `%s %s %s %s %s %s'.\n",
420 "gnunet-arm", "gnunet-arm", "-c", d->cfgfile, "-L", "DEBUG", 423 "gnunet-arm", "gnunet-arm", "-c", d->cfgfile, "-L", "DEBUG",
421 "-s"); 424 "-s");
422 d->proc = 425 d->proc_arm_start =
423 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", "-c", 426 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", "-c",
424 d->cfgfile, 427 d->cfgfile,
425 "-L", "DEBUG", 428 "-L", "DEBUG",
@@ -441,7 +444,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
441 "-L", "DEBUG", "-s", "-q"); 444 "-L", "DEBUG", "-s", "-q");
442 if (d->ssh_port_str == NULL) 445 if (d->ssh_port_str == NULL)
443 { 446 {
444 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", 447 d->proc_arm_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
445#if !DEBUG_TESTING 448#if !DEBUG_TESTING
446 "-q", 449 "-q",
447#endif 450#endif
@@ -457,7 +460,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
457 else 460 else
458 { 461 {
459 462
460 d->proc = 463 d->proc_arm_start =
461 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", "-p", 464 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", "-p",
462 d->ssh_port_str, 465 d->ssh_port_str,
463#if !DEBUG_TESTING 466#if !DEBUG_TESTING
@@ -474,7 +477,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
474 } 477 }
475 GNUNET_free (dst); 478 GNUNET_free (dst);
476 } 479 }
477 if (NULL == d->proc) 480 if (NULL == d->proc_arm_start)
478 { 481 {
479 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 482 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
480 _("Could not start `%s' process to start GNUnet.\n"), 483 _("Could not start `%s' process to start GNUnet.\n"),
@@ -497,7 +500,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
497 d); 500 d);
498 break; 501 break;
499 case SP_START_ARMING: 502 case SP_START_ARMING:
500 if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code)) 503 if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_start, &type, &code))
501 { 504 {
502 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) 505 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
503 { 506 {
@@ -520,10 +523,11 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
520 } 523 }
521 GNUNET_free_non_null (d->hostname); 524 GNUNET_free_non_null (d->hostname);
522 GNUNET_free_non_null (d->username); 525 GNUNET_free_non_null (d->username);
523 GNUNET_free (d->proc); 526 GNUNET_free (d->proc_arm_start);
524// GNUNET_free (d); // FIXME (could this leak) 527 d->proc_arm_start = NULL;
525 d->hostname = NULL; // Quick hack to avoid crashing (testing need to be 528 d->hostname = NULL; // Quick hack to avoid crashing (testing need to be
526 d->cfg = NULL; // overhauled anyway, and the error managing is 529 d->cfg = NULL; // overhauled anyway, and the error managing is
530 // GNUNET_free (d); // FIXME (could this leak)
527 // pretty broken anyway. 531 // pretty broken anyway.
528 return; 532 return;
529 } 533 }
@@ -535,7 +539,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
535 } 539 }
536 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully started `%s'.\n", 540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully started `%s'.\n",
537 "gnunet-arm"); 541 "gnunet-arm");
538 GNUNET_free (d->proc); 542 GNUNET_free (d->proc_arm_start);
543 d->proc_arm_start = NULL;
539 d->phase = SP_START_CORE; 544 d->phase = SP_START_CORE;
540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling CORE_connect\n"); 545 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling CORE_connect\n");
541 /* Fall through */ 546 /* Fall through */
@@ -600,7 +605,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
600 break; 605 break;
601 case SP_SERVICE_START: 606 case SP_SERVICE_START:
602 /* confirm gnunet-arm exited */ 607 /* confirm gnunet-arm exited */
603 if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code)) 608 if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_srv_start, &type, &code))
604 { 609 {
605 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) 610 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
606 { 611 {
@@ -643,7 +648,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
643 break; 648 break;
644 case SP_SERVICE_SHUTDOWN_START: 649 case SP_SERVICE_SHUTDOWN_START:
645 /* confirm copying complete */ 650 /* confirm copying complete */
646 if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code)) 651 if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_srv_stop, &type, &code))
647 { 652 {
648 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) 653 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
649 { 654 {
@@ -674,8 +679,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
674 d->dead_cb (d->dead_cb_cls, NULL); 679 d->dead_cb (d->dead_cb_cls, NULL);
675 break; 680 break;
676 case SP_SHUTDOWN_START: 681 case SP_SHUTDOWN_START:
677 /* confirm copying complete */ 682 /* confirm copying complete !??? */
678 if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code)) 683 if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_stop, &type, &code))
679 { 684 {
680 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) 685 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0)
681 { 686 {
@@ -704,8 +709,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
704 GNUNET_free_non_null (d->hostname); 709 GNUNET_free_non_null (d->hostname);
705 GNUNET_free_non_null (d->username); 710 GNUNET_free_non_null (d->username);
706 GNUNET_free_non_null (d->shortname); 711 GNUNET_free_non_null (d->shortname);
707 GNUNET_free_non_null (d->proc); 712 // GNUNET_free_non_null (d->proc); // !? FIXME
708 d->proc = NULL; 713 // d->proc_arm_stop = NULL;
709 GNUNET_free (d); 714 GNUNET_free (d);
710 return; 715 return;
711 } 716 }
@@ -740,8 +745,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
740 GNUNET_free_non_null (d->hostname); 745 GNUNET_free_non_null (d->hostname);
741 GNUNET_free_non_null (d->username); 746 GNUNET_free_non_null (d->username);
742 GNUNET_free_non_null (d->shortname); 747 GNUNET_free_non_null (d->shortname);
743 GNUNET_free_non_null (d->proc); 748 // GNUNET_free_non_null (d->proc); // !? FIXME!
744 d->proc = NULL; 749 // d->proc = NULL; // !? FIXME!
745 GNUNET_free (d); 750 GNUNET_free (d);
746 return; 751 return;
747 } 752 }
@@ -776,8 +781,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
776 GNUNET_free_non_null (d->hello); 781 GNUNET_free_non_null (d->hello);
777 d->hello = NULL; 782 d->hello = NULL;
778 GNUNET_free_non_null (d->shortname); 783 GNUNET_free_non_null (d->shortname);
779 GNUNET_free_non_null (d->proc); 784 // GNUNET_free_non_null (d->proc); // !? FIXME
780 d->proc = NULL; 785 // d->proc = NULL; // !? FIXME!
781 d->shortname = NULL; 786 d->shortname = NULL;
782 if (d->churn == GNUNET_NO) 787 if (d->churn == GNUNET_NO)
783 GNUNET_free (d); 788 GNUNET_free (d);
@@ -785,7 +790,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
785 break; 790 break;
786 case SP_CONFIG_UPDATE: 791 case SP_CONFIG_UPDATE:
787 /* confirm copying complete */ 792 /* confirm copying complete */
788 if (GNUNET_OK != GNUNET_OS_process_status (d->proc, &type, &code)) 793 if (GNUNET_OK != GNUNET_OS_process_status (d->proc_arm_copying, &type, &code))
789 { 794 {
790 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) /* FIXME: config update should take timeout parameter! */ 795 if (GNUNET_TIME_absolute_get_remaining (d->max_timeout).rel_value == 0) /* FIXME: config update should take timeout parameter! */
791 { 796 {
@@ -902,7 +907,7 @@ GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d,
902 else 907 else
903 arg = GNUNET_strdup (d->hostname); 908 arg = GNUNET_strdup (d->hostname);
904 909
905 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", 910 d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
906#if !DEBUG_TESTING 911#if !DEBUG_TESTING
907 "-q", 912 "-q",
908#endif 913#endif
@@ -923,7 +928,7 @@ GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d,
923 { 928 {
924 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 929 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
925 "Starting gnunet-arm with config `%s' locally.\n", d->cfgfile); 930 "Starting gnunet-arm with config `%s' locally.\n", d->cfgfile);
926 d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", 931 d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
927#if DEBUG_TESTING 932#if DEBUG_TESTING
928 "-L", "DEBUG", 933 "-L", "DEBUG",
929#endif 934#endif
@@ -978,7 +983,7 @@ GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d,
978 else 983 else
979 arg = GNUNET_strdup (d->hostname); 984 arg = GNUNET_strdup (d->hostname);
980 985
981 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", 986 d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
982#if !DEBUG_TESTING 987#if !DEBUG_TESTING
983 "-q", 988 "-q",
984#endif 989#endif
@@ -1000,7 +1005,7 @@ GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d,
1000 { 1005 {
1001 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1006 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1002 "Starting gnunet-arm with config `%s' locally.\n", d->cfgfile); 1007 "Starting gnunet-arm with config `%s' locally.\n", d->cfgfile);
1003 d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", 1008 d->proc_arm_srv_start = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
1004#if DEBUG_TESTING 1009#if DEBUG_TESTING
1005 "-L", "DEBUG", 1010 "-L", "DEBUG",
1006#endif 1011#endif
@@ -1210,7 +1215,7 @@ GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1210 GNUNET_free (baseservicehome); 1215 GNUNET_free (baseservicehome);
1211 if (ret->ssh_port_str == NULL) 1216 if (ret->ssh_port_str == NULL)
1212 { 1217 {
1213 ret->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r", 1218 ret->proc_arm_copying = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r",
1214#if !DEBUG_TESTING 1219#if !DEBUG_TESTING
1215 "-q", 1220 "-q",
1216#endif 1221#endif
@@ -1221,7 +1226,7 @@ GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1221 } 1226 }
1222 else 1227 else
1223 { 1228 {
1224 ret->proc = 1229 ret->proc_arm_copying =
1225 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r", "-P", 1230 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", "-r", "-P",
1226 ret->ssh_port_str, 1231 ret->ssh_port_str,
1227#if !DEBUG_TESTING 1232#if !DEBUG_TESTING
@@ -1230,7 +1235,7 @@ GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1230 servicehome, arg, NULL); 1235 servicehome, arg, NULL);
1231 } 1236 }
1232 GNUNET_free (arg); 1237 GNUNET_free (arg);
1233 if (NULL == ret->proc) 1238 if (NULL == ret->proc_arm_copying)
1234 { 1239 {
1235 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1240 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1236 _ 1241 _
@@ -1324,6 +1329,7 @@ GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d,
1324 d->phase = SP_START_ARMING; 1329 d->phase = SP_START_ARMING;
1325 1330
1326 /* Check if this is a local or remote process */ 1331 /* Check if this is a local or remote process */
1332 fprintf (stderr, "Stopping\n");
1327 if (NULL != d->hostname) 1333 if (NULL != d->hostname)
1328 { 1334 {
1329 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1334,7 +1340,7 @@ GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d,
1334 else 1340 else
1335 arg = GNUNET_strdup (d->hostname); 1341 arg = GNUNET_strdup (d->hostname);
1336 1342
1337 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", 1343 d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
1338#if !DEBUG_TESTING 1344#if !DEBUG_TESTING
1339 "-q", 1345 "-q",
1340#endif 1346#endif
@@ -1351,7 +1357,7 @@ GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d,
1351 { 1357 {
1352 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1358 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1353 "Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile); 1359 "Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
1354 d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", 1360 d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
1355#if DEBUG_TESTING 1361#if DEBUG_TESTING
1356 "-L", "DEBUG", 1362 "-L", "DEBUG",
1357#endif 1363#endif
@@ -1414,8 +1420,9 @@ GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
1414 GNUNET_asprintf (&arg, "%s@%s", d->username, d->hostname); 1420 GNUNET_asprintf (&arg, "%s@%s", d->username, d->hostname);
1415 else 1421 else
1416 arg = GNUNET_strdup (d->hostname); 1422 arg = GNUNET_strdup (d->hostname);
1417 1423
1418 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", 1424 fprintf (stderr, "Stopping\n");
1425 d->proc_arm_srv_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
1419#if !DEBUG_TESTING 1426#if !DEBUG_TESTING
1420 "-q", 1427 "-q",
1421#endif 1428#endif
@@ -1436,7 +1443,7 @@ GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
1436 { 1443 {
1437 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1444 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1438 "Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile); 1445 "Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
1439 d->proc = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", 1446 d->proc_arm_srv_stop = GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm",
1440#if DEBUG_TESTING 1447#if DEBUG_TESTING
1441 "-L", "DEBUG", 1448 "-L", "DEBUG",
1442#endif 1449#endif
@@ -1537,6 +1544,7 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
1537 d->th = NULL; 1544 d->th = NULL;
1538 } 1545 }
1539 /* Check if this is a local or remote process */ 1546 /* Check if this is a local or remote process */
1547 fprintf (stderr, "Stopping\n");
1540 if (NULL != d->hostname) 1548 if (NULL != d->hostname)
1541 { 1549 {
1542 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1550 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1547,7 +1555,7 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
1547 else 1555 else
1548 arg = GNUNET_strdup (d->hostname); 1556 arg = GNUNET_strdup (d->hostname);
1549 1557
1550 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", 1558 d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh",
1551#if !DEBUG_TESTING 1559#if !DEBUG_TESTING
1552 "-q", 1560 "-q",
1553#endif 1561#endif
@@ -1568,14 +1576,14 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
1568 { 1576 {
1569 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1577 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1570 "Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile); 1578 "Stopping gnunet-arm with config `%s' locally.\n", d->cfgfile);
1571 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "gnunet-arm", "gnunet-arm", 1579 d->proc_arm_stop = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "gnunet-arm", "gnunet-arm",
1572#if DEBUG_TESTING 1580#if DEBUG_TESTING
1573 "-L", "DEBUG", 1581 "-L", "DEBUG",
1574#endif 1582#endif
1575 "-c", d->cfgfile, "-e", "-q", "-T", 1583 "-c", d->cfgfile, "-e", "-q", "-T",
1576 GNUNET_TIME_relative_to_string (timeout), 1584 GNUNET_TIME_relative_to_string (timeout),
1577 del_arg, NULL); 1585 del_arg, NULL);
1578 GNUNET_assert (NULL != d->proc); 1586 GNUNET_assert (NULL != d->proc_arm_stop);
1579 } 1587 }
1580 1588
1581 GNUNET_free_non_null (del_arg); 1589 GNUNET_free_non_null (del_arg);
@@ -1635,13 +1643,13 @@ GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
1635 GNUNET_asprintf (&arg, "%s@%s:%s", d->username, d->hostname, d->cfgfile); 1643 GNUNET_asprintf (&arg, "%s@%s:%s", d->username, d->hostname, d->cfgfile);
1636 else 1644 else
1637 GNUNET_asprintf (&arg, "%s:%s", d->hostname, d->cfgfile); 1645 GNUNET_asprintf (&arg, "%s:%s", d->hostname, d->cfgfile);
1638 d->proc = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", 1646 d->proc_arm_copying = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp",
1639#if !DEBUG_TESTING 1647#if !DEBUG_TESTING
1640 "-q", 1648 "-q",
1641#endif 1649#endif
1642 d->cfgfile, arg, NULL); 1650 d->cfgfile, arg, NULL);
1643 GNUNET_free (arg); 1651 GNUNET_free (arg);
1644 if (NULL == d->proc) 1652 if (NULL == d->proc_arm_copying)
1645 { 1653 {
1646 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1654 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1647 _("Could not start `%s' process to copy configuration file.\n"), 1655 _("Could not start `%s' process to copy configuration file.\n"),