diff options
Diffstat (limited to 'src/identity-provider')
-rwxr-xr-x | src/identity-provider/test_idp_attribute.sh | 32 | ||||
-rwxr-xr-x | src/identity-provider/test_idp_consume.sh | 36 | ||||
-rwxr-xr-x | src/identity-provider/test_idp_issue.sh | 11 |
3 files changed, 73 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 | ||
2 | trap "gnunet-arm -e -c test_idp.conf" SIGINT | ||
3 | |||
4 | LOCATION=$(which gnunet-config) | ||
5 | if [ -z $LOCATION ] | ||
6 | then | ||
7 | LOCATION="gnunet-config" | ||
8 | fi | ||
9 | $LOCATION --version 1> /dev/null | ||
10 | if test $? != 0 | ||
11 | then | ||
12 | echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" | ||
13 | exit 77 | ||
14 | fi | ||
15 | |||
16 | rm -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 | |||
23 | which timeout &> /dev/null && DO_TIMEOUT="timeout 30" | ||
24 | |||
25 | TEST_ATTR="test" | ||
26 | gnunet-arm -s -c test_idp.conf | ||
27 | gnunet-identity -C testego -c test_idp.conf | ||
28 | gnunet-identity -C rpego -c test_idp.conf | ||
29 | TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') | ||
30 | gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf | ||
31 | gnunet-idp -e testego -a name -V John -c test_idp.conf | ||
32 | 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 new file mode 100755 index 000000000..0d05145e0 --- /dev/null +++ b/src/identity-provider/test_idp_consume.sh | |||
@@ -0,0 +1,36 @@ | |||
1 | #!/bin/bash | ||
2 | trap "gnunet-arm -e -c test_idp.conf" SIGINT | ||
3 | |||
4 | LOCATION=$(which gnunet-config) | ||
5 | if [ -z $LOCATION ] | ||
6 | then | ||
7 | LOCATION="gnunet-config" | ||
8 | fi | ||
9 | $LOCATION --version 1> /dev/null | ||
10 | if test $? != 0 | ||
11 | then | ||
12 | echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" | ||
13 | exit 77 | ||
14 | fi | ||
15 | |||
16 | rm -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 | |||
23 | which timeout &> /dev/null && DO_TIMEOUT="timeout 30" | ||
24 | |||
25 | TEST_ATTR="test" | ||
26 | gnunet-arm -s -c test_idp.conf | ||
27 | gnunet-identity -C testego -c test_idp.conf | ||
28 | gnunet-identity -C rpego -c test_idp.conf | ||
29 | SUBJECT_KEY=$(gnunet-identity -d -c test_idp.conf | grep rpego | 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 > /dev/null 2>&1 | ||
32 | gnunet-idp -e testego -a name -V John -c test_idp.conf > /dev/null 2>&1 | ||
33 | TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') | ||
34 | echo "Consuming ticket $TICKET" | ||
35 | gnunet-idp -e rpego -C $TICKET -c test_idp.conf | ||
36 | 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 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 | ||
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}') |
31 | TEST_KEY=$(gnunet-identity -d -c test_idp.conf | grep testego | awk '{print $3}') | 31 | 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 > /dev/null 2>&1 |
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 > /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 | TICKET=$(gnunet-idp -e testego -i "email,name" -r $SUBJECT_KEY -c test_idp.conf | awk '{print $1}') |
36 | curl http://localhost:7776/idp/attributes/testego | 36 | #curl http://localhost:7776/idp/attributes/testego |
37 | #echo "Consuming $TICKET" | 37 | echo "Ticket: $TICKET" |
38 | gnunet-idp -e rpego -C $TICKET -c test_idp.conf | ||
39 | gnunet-arm -e -c test_idp.conf | 38 | gnunet-arm -e -c test_idp.conf |