summaryrefslogtreecommitdiff
path: root/src/ats-tests/ats-testing.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-20 22:16:25 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-20 22:16:25 +0000
commitf6f1b9fb73dc4c7f03c70b80b94cfb2a6ce81e65 (patch)
tree96dedaab7217465eb6ad952beebd3e5d92ae92e1 /src/ats-tests/ats-testing.h
parent019338425afc502fc25aeb1896f404a6c0087a2e (diff)
downloadgnunet-f6f1b9fb73dc4c7f03c70b80b94cfb2a6ce81e65.tar.gz
gnunet-f6f1b9fb73dc4c7f03c70b80b94cfb2a6ce81e65.zip
fix ATS testcase
Diffstat (limited to 'src/ats-tests/ats-testing.h')
-rw-r--r--src/ats-tests/ats-testing.h62
1 files changed, 36 insertions, 26 deletions
diff --git a/src/ats-tests/ats-testing.h b/src/ats-tests/ats-testing.h
index 74da0f78c..b2a4d13e6 100644
--- a/src/ats-tests/ats-testing.h
+++ b/src/ats-tests/ats-testing.h
@@ -377,14 +377,9 @@ struct BenchmarkState
377struct GNUNET_ATS_TEST_Topology 377struct GNUNET_ATS_TEST_Topology
378{ 378{
379 /** 379 /**
380 * Shutdown task
381 */
382 struct GNUNET_SCHEDULER_Task * shutdown_task;
383
384 /**
385 * Progress task 380 * Progress task
386 */ 381 */
387 struct GNUNET_SCHEDULER_Task * progress_task; 382 struct GNUNET_SCHEDULER_Task *progress_task;
388 383
389 /** 384 /**
390 * Test result 385 * Test result
@@ -544,8 +539,9 @@ extern struct GNUNET_CONFIGURATION_Handle *cfg;
544 */ 539 */
545void 540void
546GNUNET_ATS_TEST_experimentation_run (struct Experiment *e, 541GNUNET_ATS_TEST_experimentation_run (struct Experiment *e,
547 GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb, 542 GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb,
548 GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb); 543 GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb);
544
549 545
550/** 546/**
551 * Load an experiment from a file 547 * Load an experiment from a file
@@ -554,7 +550,7 @@ GNUNET_ATS_TEST_experimentation_run (struct Experiment *e,
554 * @return the Experiment or NULL on failure 550 * @return the Experiment or NULL on failure
555 */ 551 */
556struct Experiment * 552struct Experiment *
557GNUNET_ATS_TEST_experimentation_load (char *filename); 553GNUNET_ATS_TEST_experimentation_load (const char *filename);
558 554
559 555
560/** 556/**
@@ -606,7 +602,8 @@ GNUNET_ATS_TEST_generate_traffic_stop (struct TrafficGenerator *tg);
606 * Stop all traffic generators 602 * Stop all traffic generators
607 */ 603 */
608void 604void
609GNUNET_ATS_TEST_generate_traffic_stop_all (); 605GNUNET_ATS_TEST_generate_traffic_stop_all (void);
606
610 607
611/** 608/**
612 * Generate between the source master and the partner and set preferences with a 609 * Generate between the source master and the partner and set preferences with a
@@ -635,8 +632,9 @@ GNUNET_ATS_TEST_generate_preferences_start (struct BenchmarkPeer *src,
635void 632void
636GNUNET_ATS_TEST_generate_preferences_stop (struct PreferenceGenerator *pg); 633GNUNET_ATS_TEST_generate_preferences_stop (struct PreferenceGenerator *pg);
637 634
635
638void 636void
639GNUNET_ATS_TEST_generate_preferences_stop_all (); 637GNUNET_ATS_TEST_generate_preferences_stop_all (void);
640 638
641/* 639/*
642 * Logging related functions 640 * Logging related functions
@@ -655,8 +653,12 @@ GNUNET_ATS_TEST_generate_preferences_stop_all ();
655 */ 653 */
656struct LoggingHandle * 654struct LoggingHandle *
657GNUNET_ATS_TEST_logging_start(struct GNUNET_TIME_Relative log_frequency, 655GNUNET_ATS_TEST_logging_start(struct GNUNET_TIME_Relative log_frequency,
658 char *testname, struct BenchmarkPeer *masters, int num_masters, int num_slaves, 656 const char *testname,
659 int verbose); 657 struct BenchmarkPeer *masters,
658 int num_masters,
659 int num_slaves,
660 int verbose);
661
660 662
661/** 663/**
662 * Stop logging 664 * Stop logging
@@ -666,6 +668,7 @@ GNUNET_ATS_TEST_logging_start(struct GNUNET_TIME_Relative log_frequency,
666void 668void
667GNUNET_ATS_TEST_logging_clean_up (struct LoggingHandle *l); 669GNUNET_ATS_TEST_logging_clean_up (struct LoggingHandle *l);
668 670
671
669/** 672/**
670 * Stop logging 673 * Stop logging
671 * 674 *
@@ -674,6 +677,7 @@ GNUNET_ATS_TEST_logging_clean_up (struct LoggingHandle *l);
674void 677void
675GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l); 678GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l);
676 679
680
677/** 681/**
678 * Log all data now 682 * Log all data now
679 * 683 *
@@ -688,22 +692,25 @@ GNUNET_ATS_TEST_logging_now (struct LoggingHandle *l);
688 * 692 *
689 * @param l logging handle to use 693 * @param l logging handle to use
690 * @param test_name name of the current test 694 * @param test_name name of the current test
691 * @param plots create gnuplots: GNUNET_YES or GNUNET_NO 695 * @param plots create gnuplots: #GNUNET_YES or #GNUNET_NO
692 */ 696 */
693void 697void
694GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l, 698GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l,
695 char *test_name, int plots); 699 const char *test_name,
700 int plots);
696 701
697/* 702
703/**
698 * Topology related functions 704 * Topology related functions
699 */ 705 */
700
701struct BenchmarkPeer * 706struct BenchmarkPeer *
702GNUNET_ATS_TEST_get_peer (int src); 707GNUNET_ATS_TEST_get_peer (int src);
703 708
709
704struct BenchmarkPartner * 710struct BenchmarkPartner *
705GNUNET_ATS_TEST_get_partner (int src, int dest); 711GNUNET_ATS_TEST_get_partner (int src, int dest);
706 712
713
707/** 714/**
708 * Create a topology for ats testing 715 * Create a topology for ats testing
709 * 716 *
@@ -711,21 +718,23 @@ GNUNET_ATS_TEST_get_partner (int src, int dest);
711 * @param cfg_file configuration file to use for the peers 718 * @param cfg_file configuration file to use for the peers
712 * @param num_slaves number of slaves 719 * @param num_slaves number of slaves
713 * @param num_masters number of masters 720 * @param num_masters number of masters
714 * @param test_core connect to CORE service (GNUNET_YES) or transport (GNUNET_NO) 721 * @param test_core connect to CORE service (#GNUNET_YES) or transport (#GNUNET_NO)
715 * @param done_cb function to call when topology is setup 722 * @param done_cb function to call when topology is setup
716 * @param done_cb_cls cls for callback 723 * @param done_cb_cls cls for callback
717 * @param transport_recv_cb callback to call when data are received 724 * @param transport_recv_cb callback to call when data are received
718 * @param log_request_cb callback to call when logging is required 725 * @param log_request_cb callback to call when logging is required
719 */ 726 */
720void 727void
721GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file, 728GNUNET_ATS_TEST_create_topology (char *name,
722 unsigned int num_slaves, 729 char *cfg_file,
723 unsigned int num_masters, 730 unsigned int num_slaves,
724 int test_core, 731 unsigned int num_masters,
725 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, 732 int test_core,
726 void *done_cb_cls, 733 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb,
727 GNUNET_TRANSPORT_ReceiveCallback recv_cb, 734 void *done_cb_cls,
728 GNUNET_ATS_TEST_LogRequest ats_perf_cb); 735 GNUNET_TRANSPORT_ReceiveCallback recv_cb,
736 GNUNET_ATS_TEST_LogRequest ats_perf_cb);
737
729 738
730/** 739/**
731 * Shutdown topology 740 * Shutdown topology
@@ -733,4 +742,5 @@ GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file,
733void 742void
734GNUNET_ATS_TEST_shutdown_topology (void); 743GNUNET_ATS_TEST_shutdown_topology (void);
735 744
745
736/* end of file ats-testing.h */ 746/* end of file ats-testing.h */