aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2017-10-07 13:12:12 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2017-10-07 13:12:12 +0200
commit6fce29c2dc4360da38f326c172ee2170f1688e36 (patch)
tree13353d9d7d4dc6f73a3c9ba0256ef6ef9b33334d /src
parentb7389bb3a98c077bcf39cafe2f9b66db15bd0bda (diff)
downloadgnunet-6fce29c2dc4360da38f326c172ee2170f1688e36.tar.gz
gnunet-6fce29c2dc4360da38f326c172ee2170f1688e36.zip
-fixes, add tests
Diffstat (limited to 'src')
-rwxr-xr-xsrc/identity-provider/test_idp_attribute.sh32
-rwxr-xr-xsrc/identity-provider/test_idp_consume.sh36
-rwxr-xr-xsrc/identity-provider/test_idp_issue.sh11
-rw-r--r--src/rest/rest.conf1
4 files changed, 74 insertions, 6 deletions
diff --git a/src/identity-provider/test_idp_attribute.sh b/src/identity-provider/test_idp_attribute.sh
new file mode 100755
index 000000000..433dfa3c4
--- /dev/null
+++ b/src/identity-provider/test_idp_attribute.sh
@@ -0,0 +1,32 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27gnunet-identity -C testego -c test_idp.conf
28gnunet-identity -C rpego -c test_idp.conf
29TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}')
30gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf
31gnunet-idp -e testego -a name -V John -c test_idp.conf
32gnunet-arm -e -c test_idp.conf
diff --git a/src/identity-provider/test_idp_consume.sh b/src/identity-provider/test_idp_consume.sh
new file mode 100755
index 000000000..0d05145e0
--- /dev/null
+++ b/src/identity-provider/test_idp_consume.sh
@@ -0,0 +1,36 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_idp.conf" SIGINT
3
4LOCATION=$(which gnunet-config)
5if [ -z $LOCATION ]
6then
7 LOCATION="gnunet-config"
8fi
9$LOCATION --version 1> /dev/null
10if test $? != 0
11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77
14fi
15
16rm -rf `gnunet-config -c test_idp.conf -s PATHS -o GNUNET_HOME -f`
17
18# (1) PKEY1.user -> PKEY2.resu.user
19# (2) PKEY2.resu -> PKEY3
20# (3) PKEY3.user -> PKEY4
21
22
23which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
24
25TEST_ATTR="test"
26gnunet-arm -s -c test_idp.conf
27gnunet-identity -C testego -c test_idp.conf
28gnunet-identity -C rpego -c test_idp.conf
29SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | 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 > /dev/null 2>&1
32gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1
33TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}')
34echo "Consuming ticket $TICKET"
35gnunet-idp -e rpego -C $TICKET -c test_idp.conf
36gnunet-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 8cd1297d3..bf5783c9d 100755
--- a/src/identity-provider/test_idp_issue.sh
+++ b/src/identity-provider/test_idp_issue.sh
@@ -24,16 +24,15 @@ 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}')
31TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') 31TEST_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 > /dev/null 2>&1
33gnunet-idp -e testego -a name -V John -c test_idp.conf 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}') 35TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}')
36curl http://localhost:7776/idp/attributes/testego 36#curl http://localhost:7776/idp/attributes/testego
37#echo "Consuming $TICKET" 37echo "Ticket: $TICKET"
38gnunet-idp -e rpego -C $TICKET -c test_idp.conf
39gnunet-arm -e -c test_idp.conf 38gnunet-arm -e -c test_idp.conf
diff --git a/src/rest/rest.conf b/src/rest/rest.conf
index 6cd013345..b86e6c1a0 100644
--- a/src/rest/rest.conf
+++ b/src/rest/rest.conf
@@ -1,4 +1,5 @@
1[rest] 1[rest]
2UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-rest.sock
2BINARY=gnunet-rest-server 3BINARY=gnunet-rest-server
3REST_PORT=7776 4REST_PORT=7776
4REST_ALLOW_HEADERS=Authorization,Accept,Content-Type 5REST_ALLOW_HEADERS=Authorization,Accept,Content-Type