aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-09-03 13:56:59 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-09-03 13:56:59 +0000
commit4131b927fffb82e9196f39c774506a63b538324f (patch)
treeaf3f6242662cdc765dab7f5403ac584fdd5b7450 /src/testbed
parentd03b4469e0d1ccc0d670ebee14a354511fa56bda (diff)
downloadgnunet-4131b927fffb82e9196f39c774506a63b538324f.tar.gz
gnunet-4131b927fffb82e9196f39c774506a63b538324f.zip
- build system changes for testing barriers API
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/Makefile.am36
-rw-r--r--src/testbed/buildvars.py.in24
-rw-r--r--src/testbed/gnunet-service-test-barriers.c32
-rw-r--r--src/testbed/test_testbed_api_barriers.c31
-rwxr-xr-xsrc/testbed/test_testbed_api_barriers.py43
5 files changed, 163 insertions, 3 deletions
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am
index f07639b8a..4c204c4a8 100644
--- a/src/testbed/Makefile.am
+++ b/src/testbed/Makefile.am
@@ -30,6 +30,15 @@ bin_PROGRAMS = \
30 $(ll_binaries) \ 30 $(ll_binaries) \
31 gnunet-testbed-profiler 31 gnunet-testbed-profiler
32 32
33noinst_SCRIPTS = \
34 buildvars.py
35
36CLEANFILES = $(noinst_SCRIPTS) \
37 buildvars.pyc
38
39noinst_PROGRAMS = \
40 gnunet-service-test-barriers
41
33gnunet_service_testbed_SOURCES = \ 42gnunet_service_testbed_SOURCES = \
34 gnunet-service-testbed.h \ 43 gnunet-service-testbed.h \
35 gnunet-service-testbed.c \ 44 gnunet-service-testbed.c \
@@ -150,7 +159,8 @@ check_PROGRAMS = \
150 test_testbed_api_testbed_run_topologyfromfile \ 159 test_testbed_api_testbed_run_topologyfromfile \
151 test_testbed_api_testbed_run_topologyscalefree \ 160 test_testbed_api_testbed_run_topologyscalefree \
152 test_testbed_api_testbed_run_waitforever \ 161 test_testbed_api_testbed_run_waitforever \
153 test_testbed_api_statistics 162 test_testbed_api_statistics \
163 test_testbed_api_barriers
154 164
155if ENABLE_TEST_RUN 165if ENABLE_TEST_RUN
156 TESTS = \ 166 TESTS = \
@@ -179,7 +189,8 @@ if ENABLE_TEST_RUN
179 test_testbed_api_testbed_run_topologysmallworld \ 189 test_testbed_api_testbed_run_topologysmallworld \
180 test_testbed_api_testbed_run_topologysmallworldring \ 190 test_testbed_api_testbed_run_topologysmallworldring \
181 test_testbed_api_testbed_run_topologyfromfile \ 191 test_testbed_api_testbed_run_topologyfromfile \
182 test_testbed_api_testbed_run_topologyscalefree 192 test_testbed_api_testbed_run_topologyscalefree \
193 test_testbed_api_barriers.py
183endif 194endif
184 195
185test_testbed_api_hosts_SOURCES = \ 196test_testbed_api_hosts_SOURCES = \
@@ -350,6 +361,23 @@ test_testbed_api_peer_reconfiguration_LDADD = \
350 $(top_builddir)/src/util/libgnunetutil.la \ 361 $(top_builddir)/src/util/libgnunetutil.la \
351 libgnunettestbed.la 362 libgnunettestbed.la
352 363
364test_testbed_api_barriers_SOURCES = \
365 test_testbed_api_barriers.c
366test_testbed_api_barriers_LDADD = \
367 $(top_builddir)/src/util/libgnunetutil.la \
368 libgnunettestbed.la
369
370do_subst = sed -e 's,[@]libexecdir[@],$(libexecdir),g'
371
372buildvars.py: buildvars.py.in Makefile
373 $(do_subst) < $(srcdir)/buildvars.py.in > $@
374
375gnunet_service_test_barriers_SOURCES = \
376 gnunet-service-test-barriers.c
377gnunet_service_test_barriers_LDADD = \
378 $(top_builddir)/src/util/libgnunetutil.la \
379 libgnunettestbed.la
380
353EXTRA_DIST = \ 381EXTRA_DIST = \
354 test_testbed_api.conf \ 382 test_testbed_api.conf \
355 test_testbed_api_test_timeout.conf \ 383 test_testbed_api_test_timeout.conf \
@@ -364,4 +392,6 @@ EXTRA_DIST = \
364 test_testbed_api_testbed_run_topologyscalefree.conf \ 392 test_testbed_api_testbed_run_topologyscalefree.conf \
365 overlay_topology.txt \ 393 overlay_topology.txt \
366 sample_hosts.txt \ 394 sample_hosts.txt \
367 sample.job 395 sample.job \
396 buildvars.py.in \
397 test_testbed_api_barriers.py
diff --git a/src/testbed/buildvars.py.in b/src/testbed/buildvars.py.in
new file mode 100644
index 000000000..e1b7d7666
--- /dev/null
+++ b/src/testbed/buildvars.py.in
@@ -0,0 +1,24 @@
1# This file is part of GNUnet.
2# (C) 2008--2013 Christian Grothoff (and other contributing authors)
3#
4# GNUnet is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published
6# by the Free Software Foundation; either version 2, or (at your
7# option) any later version.
8#
9# GNUnet is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with GNUnet; see the file COPYING. If not, write to the
16# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17# Boston, MA 02111-1307, USA.
18
19
20# file: testbed/buildvars.py
21# brief: file for importing variables from build syste into python
22# author: Sree Harsha Totakura
23
24libexecdir = '@libexecdir@'
diff --git a/src/testbed/gnunet-service-test-barriers.c b/src/testbed/gnunet-service-test-barriers.c
new file mode 100644
index 000000000..6c43ad4b3
--- /dev/null
+++ b/src/testbed/gnunet-service-test-barriers.c
@@ -0,0 +1,32 @@
1/*
2 This file is part of GNUnet
3 (C) 2008--2013 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20
21/**
22 * @file testbed/gnunet-service-test-barriers.c
23 * @brief Service for testing testbed barriers. This service is started as a
24 * peer service and waits for a barrier to be crossed.
25 * @author Sree Harsha Totakura <sreeharsha@totakura.in>
26 */
27
28
29int main ()
30{
31 return 0;
32}
diff --git a/src/testbed/test_testbed_api_barriers.c b/src/testbed/test_testbed_api_barriers.c
new file mode 100644
index 000000000..1e6a8012d
--- /dev/null
+++ b/src/testbed/test_testbed_api_barriers.c
@@ -0,0 +1,31 @@
1/*
2 This file is part of GNUnet
3 (C) 2008--2013 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20
21/**
22 * @file testbed/test_testbed_api_barriers.c
23 * @brief testcase binary for testing testbed barriers API
24 * @author Sree Harsha Totakura <sreeharsha@totakura.in>
25 */
26
27
28int main ()
29{
30 return 0;
31}
diff --git a/src/testbed/test_testbed_api_barriers.py b/src/testbed/test_testbed_api_barriers.py
new file mode 100755
index 000000000..97993a9dc
--- /dev/null
+++ b/src/testbed/test_testbed_api_barriers.py
@@ -0,0 +1,43 @@
1#!/usr/bin/env python
2# This file is part of GNUnet.
3# (C) 2008--2013 Christian Grothoff (and other contributing authors)
4#
5# GNUnet is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published
7# by the Free Software Foundation; either version 2, or (at your
8# option) any later version.
9#
10# GNUnet is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with GNUnet; see the file COPYING. If not, write to the
17# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18# Boston, MA 02111-1307, USA.
19
20
21# file: testbed/test_testbed_api_barriers.py
22# brief: execution script for testing testbed barriers API.
23# author: Sree Harsha Totakura
24
25
26import subprocess as sp
27import shutil
28import os
29from buildvars import libexecdir
30
31
32service = 'gnunet-service-test-barriers'
33
34# copy gnunet-service-test-barriers service to gnunet's libexec dir
35shutil.copy (service, libexecdir)
36
37# start the testcase binary
38ret = subprocess.call ('test_testbed_api_barriers', shell=False)
39
40# remove the installed gnunet-service-test-barriers copy
41os.unlink (os.path.join (libexecdir, service))
42
43sys.exit (ret)