From: Schanzenbach, Martin Date: Tue, 10 Oct 2017 19:15:56 +0000 (+0200) Subject: -add tests X-Git-Tag: gnunet-0.11.0rc0~24^2~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0af3570c12b847c2f38334c1f27ad198011d718b;p=oweals%2Fgnunet.git -add tests --- 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 SQLITE_PLUGIN = libgnunet_plugin_identity_provider_sqlite.la endif +EXTRA_DIST = \ + test_idp_defaults.conf \ + test_idp.conf \ + $(check_SCRIPTS) + pkgcfgdir= $(pkgdatadir)/config.d/ libexecdir= $(pkglibdir)/libexec/ @@ -104,3 +109,14 @@ gnunet_idp_LDADD = \ $(top_builddir)/src/identity-provider/libgnunetidentityprovider.la \ $(top_builddir)/src/identity/libgnunetidentity.la \ $(GN_LIBINTL) + +check_SCRIPTS = \ + test_idp_attribute.sh \ + test_idp_issue.sh \ + test_idp_consume.sh \ + test_idp_revoke.sh + +if ENABLE_TEST_RUN + AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; + TESTS = $(check_SCRIPTS) +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 [rest] AUTOSTART = YES -PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/restlog +#PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/restlog [transport] PLUGINS = [identity-provider] AUTOSTART = YES -PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=/tmp/idplog +#PREFIX = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=/tmp/idplog [gns] #PREFIX = valgrind --leak-check=full --track-origins=yes @@ -26,6 +26,3 @@ DEFAULT_LOOKUP_TIMEOUT = 15 s RECORD_PUT_INTERVAL = 1 h ZONE_PUBLISH_TIME_WINDOW = 1 h DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 - -[rest] -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 gnunet-identity -C rpego -c test_idp.conf TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf -gnunet-idp -e testego -a name -V John -c test_idp.conf -gnunet-idp -e testego -D -c test_idp.conf +gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1 +if test $? != 0 +then + echo "Failed." + exit 1 +fi + #curl localhost:7776/idp/attributes/testego 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" TEST_ATTR="test" gnunet-arm -s -c test_idp.conf -gnunet-arm -i rest -c test_idp.conf +#gnunet-arm -i rest -c test_idp.conf gnunet-identity -C testego -c test_idp.conf gnunet-identity -C rpego -c test_idp.conf 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}' gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf gnunet-idp -e testego -a name -V John -c test_idp.conf TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') -echo "Consuming ticket $TICKET" -gnunet-idp -e rpego -C $TICKET -c test_idp.conf -curl http://localhost:7776/idp/tickets/testego +gnunet-idp -e rpego -C $TICKET -c test_idp.conf > /dev/null 2>&1 + +if test $? != 0 +then + "Failed." + exit 1 +fi +#curl http://localhost:7776/idp/tickets/testego 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" TEST_ATTR="test" gnunet-arm -s -c test_idp.conf -gnunet-arm -i rest -c test_idp.conf +#gnunet-arm -i rest -c test_idp.conf gnunet-identity -C testego -c test_idp.conf gnunet-identity -C rpego -c test_idp.conf 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}' gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf > /dev/null 2>&1 gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1 #gnunet-idp -e testego -D -c test_idp.conf -TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') +gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf > /dev/null 2>&1 +if test $? != 0 +then + echo "Failed." + exit 1 +fi #curl http://localhost:7776/idp/attributes/testego -echo "Ticket: $TICKET" -#gnunet-arm -e -c test_idp.conf +gnunet-arm -e -c test_idp.conf