aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2017-10-10 21:15:56 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2017-10-10 21:15:56 +0200
commit0af3570c12b847c2f38334c1f27ad198011d718b (patch)
tree25bde6acece1939a258fd3012d85890dfe08f4e6 /src
parent1cfa320f0cb213aed0a3a04577d065a65f847d49 (diff)
downloadgnunet-0af3570c12b847c2f38334c1f27ad198011d718b.tar.gz
gnunet-0af3570c12b847c2f38334c1f27ad198011d718b.zip
-add tests
Diffstat (limited to 'src')
-rw-r--r--src/identity-provider/Makefile.am16
-rw-r--r--src/identity-provider/test_idp.conf7
-rwxr-xr-xsrc/identity-provider/test_idp_attribute.sh9
-rwxr-xr-xsrc/identity-provider/test_idp_consume.sh13
-rwxr-xr-xsrc/identity-provider/test_idp_issue.sh12
5 files changed, 42 insertions, 15 deletions
diff --git a/src/identity-provider/Makefile.am b/src/identity-provider/Makefile.am
index 098313f9a..a4b3f565d 100644
--- a/src/identity-provider/Makefile.am
+++ b/src/identity-provider/Makefile.am
@@ -16,6 +16,11 @@ if HAVE_SQLITE
16SQLITE_PLUGIN = libgnunet_plugin_identity_provider_sqlite.la 16SQLITE_PLUGIN = libgnunet_plugin_identity_provider_sqlite.la
17endif 17endif
18 18
19EXTRA_DIST = \
20 test_idp_defaults.conf \
21 test_idp.conf \
22 $(check_SCRIPTS)
23
19pkgcfgdir= $(pkgdatadir)/config.d/ 24pkgcfgdir= $(pkgdatadir)/config.d/
20 25
21libexecdir= $(pkglibdir)/libexec/ 26libexecdir= $(pkglibdir)/libexec/
@@ -104,3 +109,14 @@ gnunet_idp_LDADD = \
104 $(top_builddir)/src/identity-provider/libgnunetidentityprovider.la \ 109 $(top_builddir)/src/identity-provider/libgnunetidentityprovider.la \
105 $(top_builddir)/src/identity/libgnunetidentity.la \ 110 $(top_builddir)/src/identity/libgnunetidentity.la \
106 $(GN_LIBINTL) 111 $(GN_LIBINTL)
112
113check_SCRIPTS = \
114 test_idp_attribute.sh \
115 test_idp_issue.sh \
116 test_idp_consume.sh \
117 test_idp_revoke.sh
118
119if ENABLE_TEST_RUN
120 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
121 TESTS = $(check_SCRIPTS)
122endif
diff --git a/src/identity-provider/test_idp.conf b/src/identity-provider/test_idp.conf
index e5d1c7186..2b76c7bf2 100644
--- a/src/identity-provider/test_idp.conf
+++ b/src/identity-provider/test_idp.conf
@@ -8,14 +8,14 @@ AUTOSTART = YES
8 8
9[rest] 9[rest]
10AUTOSTART = YES 10AUTOSTART = YES
11PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/restlog 11#PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/restlog
12 12
13[transport] 13[transport]
14PLUGINS = 14PLUGINS =
15 15
16[identity-provider] 16[identity-provider]
17AUTOSTART = YES 17AUTOSTART = YES
18PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=/tmp/idplog 18#PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=/tmp/idplog
19 19
20[gns] 20[gns]
21#PREFIX = valgrind --leak-check=full --track-origins=yes 21#PREFIX = valgrind --leak-check=full --track-origins=yes
@@ -26,6 +26,3 @@ DEFAULT_LOOKUP_TIMEOUT = 15 s
26RECORD_PUT_INTERVAL = 1 h 26RECORD_PUT_INTERVAL = 1 h
27ZONE_PUBLISH_TIME_WINDOW = 1 h 27ZONE_PUBLISH_TIME_WINDOW = 1 h
28DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 28DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0
29
30[rest]
31PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/rest
diff --git a/src/identity-provider/test_idp_attribute.sh b/src/identity-provider/test_idp_attribute.sh
index 7e86ae532..7f0f06dac 100755
--- a/src/identity-provider/test_idp_attribute.sh
+++ b/src/identity-provider/test_idp_attribute.sh
@@ -29,7 +29,12 @@ gnunet-identity -C testego -c test_idp.conf
29gnunet-identity -C rpego -c test_idp.conf 29gnunet-identity -C rpego -c test_idp.conf
30TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') 30TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}')
31gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf 31gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf
32gnunet-idp -e testego -a name -V John -c test_idp.conf 32gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1
33gnunet-idp -e testego -D -c test_idp.conf 33if test $? != 0
34then
35 echo "Failed."
36 exit 1
37fi
38
34#curl localhost:7776/idp/attributes/testego 39#curl localhost:7776/idp/attributes/testego
35gnunet-arm -e -c test_idp.conf 40gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_consume.sh b/src/identity-provider/test_idp_consume.sh
index e47c13da6..11f6865a4 100755
--- a/src/identity-provider/test_idp_consume.sh
+++ b/src/identity-provider/test_idp_consume.sh
@@ -24,7 +24,7 @@ which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24 24
25TEST_ATTR="test" 25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf 26gnunet-arm -s -c test_idp.conf
27gnunet-arm -i rest -c test_idp.conf 27#gnunet-arm -i rest -c test_idp.conf
28gnunet-identity -C testego -c test_idp.conf 28gnunet-identity -C testego -c test_idp.conf
29gnunet-identity -C rpego -c test_idp.conf 29gnunet-identity -C rpego -c test_idp.conf
30SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}') 30SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}')
@@ -32,7 +32,12 @@ TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}'
32gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf 32gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf
33gnunet-idp -e testego -a name -V John -c test_idp.conf 33gnunet-idp -e testego -a name -V John -c test_idp.conf
34TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') 34TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}')
35echo "Consuming ticket $TICKET" 35gnunet-idp -e rpego -C $TICKET -c test_idp.conf > /dev/null 2>&1
36gnunet-idp -e rpego -C $TICKET -c test_idp.conf 36
37curl http://localhost:7776/idp/tickets/testego 37if test $? != 0
38then
39 "Failed."
40 exit 1
41fi
42#curl http://localhost:7776/idp/tickets/testego
38gnunet-arm -e -c test_idp.conf 43gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_issue.sh b/src/identity-provider/test_idp_issue.sh
index 26c490c76..90487ee73 100755
--- a/src/identity-provider/test_idp_issue.sh
+++ b/src/identity-provider/test_idp_issue.sh
@@ -24,7 +24,7 @@ which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24 24
25TEST_ATTR="test" 25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf 26gnunet-arm -s -c test_idp.conf
27gnunet-arm -i rest -c test_idp.conf 27#gnunet-arm -i rest -c test_idp.conf
28gnunet-identity -C testego -c test_idp.conf 28gnunet-identity -C testego -c test_idp.conf
29gnunet-identity -C rpego -c test_idp.conf 29gnunet-identity -C rpego -c test_idp.conf
30SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}') 30SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}')
@@ -32,7 +32,11 @@ TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}'
32gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf > /dev/null 2>&1 32gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf > /dev/null 2>&1
33gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1 33gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1
34#gnunet-idp -e testego -D -c test_idp.conf 34#gnunet-idp -e testego -D -c test_idp.conf
35TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') 35gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf > /dev/null 2>&1
36if test $? != 0
37then
38 echo "Failed."
39 exit 1
40fi
36#curl http://localhost:7776/idp/attributes/testego 41#curl http://localhost:7776/idp/attributes/testego
37echo "Ticket: $TICKET" 42gnunet-arm -e -c test_idp.conf
38#gnunet-arm -e -c test_idp.conf