diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-10-10 21:15:56 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-10-10 21:15:56 +0200 |
commit | 0af3570c12b847c2f38334c1f27ad198011d718b (patch) | |
tree | 25bde6acece1939a258fd3012d85890dfe08f4e6 /src | |
parent | 1cfa320f0cb213aed0a3a04577d065a65f847d49 (diff) | |
download | gnunet-0af3570c12b847c2f38334c1f27ad198011d718b.tar.gz gnunet-0af3570c12b847c2f38334c1f27ad198011d718b.zip |
-add tests
Diffstat (limited to 'src')
-rw-r--r-- | src/identity-provider/Makefile.am | 16 | ||||
-rw-r--r-- | src/identity-provider/test_idp.conf | 7 | ||||
-rwxr-xr-x | src/identity-provider/test_idp_attribute.sh | 9 | ||||
-rwxr-xr-x | src/identity-provider/test_idp_consume.sh | 13 | ||||
-rwxr-xr-x | src/identity-provider/test_idp_issue.sh | 12 |
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 | |||
16 | SQLITE_PLUGIN = libgnunet_plugin_identity_provider_sqlite.la | 16 | SQLITE_PLUGIN = libgnunet_plugin_identity_provider_sqlite.la |
17 | endif | 17 | endif |
18 | 18 | ||
19 | EXTRA_DIST = \ | ||
20 | test_idp_defaults.conf \ | ||
21 | test_idp.conf \ | ||
22 | $(check_SCRIPTS) | ||
23 | |||
19 | pkgcfgdir= $(pkgdatadir)/config.d/ | 24 | pkgcfgdir= $(pkgdatadir)/config.d/ |
20 | 25 | ||
21 | libexecdir= $(pkglibdir)/libexec/ | 26 | libexecdir= $(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 | |||
113 | check_SCRIPTS = \ | ||
114 | test_idp_attribute.sh \ | ||
115 | test_idp_issue.sh \ | ||
116 | test_idp_consume.sh \ | ||
117 | test_idp_revoke.sh | ||
118 | |||
119 | if 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) | ||
122 | endif | ||
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] |
10 | AUTOSTART = YES | 10 | AUTOSTART = YES |
11 | PREFIX = 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] |
14 | PLUGINS = | 14 | PLUGINS = |
15 | 15 | ||
16 | [identity-provider] | 16 | [identity-provider] |
17 | AUTOSTART = YES | 17 | AUTOSTART = YES |
18 | PREFIX = 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 | |||
26 | RECORD_PUT_INTERVAL = 1 h | 26 | RECORD_PUT_INTERVAL = 1 h |
27 | ZONE_PUBLISH_TIME_WINDOW = 1 h | 27 | ZONE_PUBLISH_TIME_WINDOW = 1 h |
28 | DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 | 28 | DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 |
29 | |||
30 | [rest] | ||
31 | PREFIX = 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 | |||
29 | gnunet-identity -C rpego -c test_idp.conf | 29 | gnunet-identity -C rpego -c test_idp.conf |
30 | TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') | 30 | TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') |
31 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf | 31 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf |
32 | gnunet-idp -e testego -a name -V John -c test_idp.conf | 32 | gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1 |
33 | gnunet-idp -e testego -D -c test_idp.conf | 33 | if test $? != 0 |
34 | then | ||
35 | echo "Failed." | ||
36 | exit 1 | ||
37 | fi | ||
38 | |||
34 | #curl localhost:7776/idp/attributes/testego | 39 | #curl localhost:7776/idp/attributes/testego |
35 | gnunet-arm -e -c test_idp.conf | 40 | gnunet-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 | ||
25 | TEST_ATTR="test" | 25 | TEST_ATTR="test" |
26 | gnunet-arm -s -c test_idp.conf | 26 | gnunet-arm -s -c test_idp.conf |
27 | gnunet-arm -i rest -c test_idp.conf | 27 | #gnunet-arm -i rest -c test_idp.conf |
28 | gnunet-identity -C testego -c test_idp.conf | 28 | gnunet-identity -C testego -c test_idp.conf |
29 | gnunet-identity -C rpego -c test_idp.conf | 29 | gnunet-identity -C rpego -c test_idp.conf |
30 | SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}') | 30 | SUBJECT_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}' | |||
32 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf | 32 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf |
33 | gnunet-idp -e testego -a name -V John -c test_idp.conf | 33 | gnunet-idp -e testego -a name -V John -c test_idp.conf |
34 | TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') | 34 | TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') |
35 | echo "Consuming ticket $TICKET" | 35 | gnunet-idp -e rpego -C $TICKET -c test_idp.conf > /dev/null 2>&1 |
36 | gnunet-idp -e rpego -C $TICKET -c test_idp.conf | 36 | |
37 | curl http://localhost:7776/idp/tickets/testego | 37 | if test $? != 0 |
38 | then | ||
39 | "Failed." | ||
40 | exit 1 | ||
41 | fi | ||
42 | #curl http://localhost:7776/idp/tickets/testego | ||
38 | gnunet-arm -e -c test_idp.conf | 43 | gnunet-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 | ||
25 | TEST_ATTR="test" | 25 | TEST_ATTR="test" |
26 | gnunet-arm -s -c test_idp.conf | 26 | gnunet-arm -s -c test_idp.conf |
27 | gnunet-arm -i rest -c test_idp.conf | 27 | #gnunet-arm -i rest -c test_idp.conf |
28 | gnunet-identity -C testego -c test_idp.conf | 28 | gnunet-identity -C testego -c test_idp.conf |
29 | gnunet-identity -C rpego -c test_idp.conf | 29 | gnunet-identity -C rpego -c test_idp.conf |
30 | SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | awk '{print $3}') | 30 | SUBJECT_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}' | |||
32 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf > /dev/null 2>&1 | 32 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf > /dev/null 2>&1 |
33 | gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1 | 33 | gnunet-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 |
35 | TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') | 35 | gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf > /dev/null 2>&1 |
36 | if test $? != 0 | ||
37 | then | ||
38 | echo "Failed." | ||
39 | exit 1 | ||
40 | fi | ||
36 | #curl http://localhost:7776/idp/attributes/testego | 41 | #curl http://localhost:7776/idp/attributes/testego |
37 | echo "Ticket: $TICKET" | 42 | gnunet-arm -e -c test_idp.conf |
38 | #gnunet-arm -e -c test_idp.conf | ||