aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-23 14:22:34 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-23 14:22:34 +0000
commit5742938289524f4c5fba7883742e4dd69cccf11d (patch)
treee16fea8b9d778f9825f897237b0c1880305776a0 /src/testing
parentf3edb5a8d6ba6f43f5df18f2e98bc1dae90c9d7a (diff)
downloadgnunet-5742938289524f4c5fba7883742e4dd69cccf11d.tar.gz
gnunet-5742938289524f4c5fba7883742e4dd69cccf11d.zip
refactoring ARM api to use new MQ
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.c67
1 files changed, 4 insertions, 63 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 32cd09b84..13ebabd1d 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -1355,65 +1355,6 @@ GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer)
1355 1355
1356 1356
1357/** 1357/**
1358 * Start a service at a peer using its ARM service
1359 *
1360 * @param peer the peer whose service has to be started
1361 * @param service_name name of the service to start
1362 * @param timeout how long should the ARM API try to send the request to start
1363 * the service
1364 * @param cont the callback to call with result and status from ARM API
1365 * @param cont_cls the closure for the above callback
1366 * @return #GNUNET_OK upon successfully queuing the service start request;
1367 * #GNUNET_SYSERR upon error
1368 */
1369int
1370GNUNET_TESTING_peer_service_start (struct GNUNET_TESTING_Peer *peer,
1371 const char *service_name,
1372 struct GNUNET_TIME_Relative timeout,
1373 GNUNET_ARM_ResultCallback cont,
1374 void *cont_cls)
1375{
1376 if (NULL == peer->ah)
1377 return GNUNET_SYSERR;
1378 GNUNET_ARM_request_service_start (peer->ah,
1379 service_name,
1380 GNUNET_OS_INHERIT_STD_ALL,
1381 timeout,
1382 cont, cont_cls);
1383 return GNUNET_OK;
1384}
1385
1386
1387/**
1388 * Stop a service at a peer using its ARM service
1389 *
1390 * @param peer the peer whose service has to be stopped
1391 * @param service_name name of the service to stop
1392 * @param timeout how long should the ARM API try to send the request to stop
1393 * the service
1394 * @param cont the callback to call with result and status from ARM API
1395 * @param cont_cls the closure for the above callback
1396 * @return #GNUNET_OK upon successfully queuing the service stop request;
1397 * #GNUNET_SYSERR upon error
1398 */
1399int
1400GNUNET_TESTING_peer_service_stop (struct GNUNET_TESTING_Peer *peer,
1401 const char *service_name,
1402 struct GNUNET_TIME_Relative timeout,
1403 GNUNET_ARM_ResultCallback cont,
1404 void *cont_cls)
1405{
1406 if (NULL == peer->ah)
1407 return GNUNET_SYSERR;
1408 GNUNET_ARM_request_service_stop (peer->ah,
1409 service_name,
1410 timeout,
1411 cont, cont_cls);
1412 return GNUNET_OK;
1413}
1414
1415
1416/**
1417 * Sends SIGTERM to the peer's main process 1358 * Sends SIGTERM to the peer's main process
1418 * 1359 *
1419 * @param peer the handle to the peer 1360 * @param peer the handle to the peer
@@ -1510,7 +1451,7 @@ disconn_status (void *cls,
1510 return; 1451 return;
1511 } 1452 }
1512 GNUNET_break (GNUNET_OK == GNUNET_TESTING_peer_wait (peer)); 1453 GNUNET_break (GNUNET_OK == GNUNET_TESTING_peer_wait (peer));
1513 GNUNET_ARM_disconnect_and_free (peer->ah); 1454 GNUNET_ARM_disconnect (peer->ah);
1514 peer->ah = NULL; 1455 peer->ah = NULL;
1515 peer->cb (peer->cb_cls, peer, GNUNET_YES); 1456 peer->cb (peer->cb_cls, peer, GNUNET_YES);
1516} 1457}
@@ -1556,7 +1497,7 @@ void
1556GNUNET_TESTING_peer_stop_async_cancel (struct GNUNET_TESTING_Peer *peer) 1497GNUNET_TESTING_peer_stop_async_cancel (struct GNUNET_TESTING_Peer *peer)
1557{ 1498{
1558 GNUNET_assert (NULL != peer->ah); 1499 GNUNET_assert (NULL != peer->ah);
1559 GNUNET_ARM_disconnect_and_free (peer->ah); 1500 GNUNET_ARM_disconnect (peer->ah);
1560 peer->ah = NULL; 1501 peer->ah = NULL;
1561} 1502}
1562 1503
@@ -1576,9 +1517,9 @@ GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer)
1576 if (NULL != peer->main_process) 1517 if (NULL != peer->main_process)
1577 GNUNET_TESTING_peer_stop (peer); 1518 GNUNET_TESTING_peer_stop (peer);
1578 if (NULL != peer->ah) 1519 if (NULL != peer->ah)
1579 GNUNET_ARM_disconnect_and_free (peer->ah); 1520 GNUNET_ARM_disconnect (peer->ah);
1580 if (NULL != peer->mh) 1521 if (NULL != peer->mh)
1581 GNUNET_ARM_monitor_disconnect_and_free (peer->mh); 1522 GNUNET_ARM_monitor_stop (peer->mh);
1582 GNUNET_free (peer->cfgfile); 1523 GNUNET_free (peer->cfgfile);
1583 if (NULL != peer->cfg) 1524 if (NULL != peer->cfg)
1584 GNUNET_CONFIGURATION_destroy (peer->cfg); 1525 GNUNET_CONFIGURATION_destroy (peer->cfg);