summaryrefslogtreecommitdiff
path: root/src/credential/test_credential_lookup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/credential/test_credential_lookup.sh')
-rwxr-xr-xsrc/credential/test_credential_lookup.sh66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/credential/test_credential_lookup.sh b/src/credential/test_credential_lookup.sh
deleted file mode 100755
index fc6a59c50..000000000
--- a/src/credential/test_credential_lookup.sh
+++ /dev/null
@@ -1,66 +0,0 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_credential_lookup.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_credential_lookup.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"
24TEST_ISSUER="PKEY1"
25TEST_ATTR="user"
26TEST_SUB_ATTR="resu"
27TEST_DELEGATION_SUBJECT="PKEY2"
28TEST_DELEGATION_ATTR="$TEST_SUB_ATTR.$TEST_ATTR"
29TEST_SUBDELEGATION_SUBJECT="PKEY3"
30TEST_SUBJECT="PKEY4"
31TEST_CREDENTIAL="c1"
32gnunet-arm -s -c test_credential_lookup.conf
33gnunet-identity -C testone -c test_credential_lookup.conf
34gnunet-identity -C testtwo -c test_credential_lookup.conf
35gnunet-identity -C testthree -c test_credential_lookup.conf
36gnunet-identity -C testfour -c test_credential_lookup.conf
37
38#TODO1 Get credential and store it with subject (3)
39CRED=`$DO_TIMEOUT gnunet-credential --issue --issuer=$TEST_SUBDELEGATION_SUBJECT --attribute=$TEST_SUB_ATTR --expiration 1m -c test_credential_lookup.conf`
40gnunet-namestore -p -z testfour -a -n $TEST_CREDENTIAL -t CRED -V $CRED -e 5m -c test_credential_lookup.conf
41
42# (1)
43gnunet-namestore -p -z testone -a -n $TEST_ATTR -t ATTR -V "$TEST_DELEGATION_SUBJECT $TEST_DELEGATION_ATTR"
44
45# (2)
46gnunet-namestore -p -z testtwo -a -n $TEST_SUB_ATTR -t ATTR -V "$TEST_SUBDELEGATION_SUBJECT"
47
48
49#TODO2 Add -z swich like in gnunet-gns
50RES_IP=`$DO_TIMEOUT gnunet-credential --verify --issuer=$TEST_ISSUER --attribute="$TEST_DELEGATION_ATTR" --subject=$TEST_SUBJECT --credential=$TEST_CREDENTIAL -c test_credential_lookup.conf`
51
52#TODO cleanup properly
53gnunet-namestore -z testsubject -d -n newcred -t CRED -e never -c test_credential_lookup.conf
54gnunet-identity -D testsubject -c test_credential_lookup.conf
55gnunet-arm -e -c test_credential_lookup.conf
56
57#TODO3 proper test
58exit 0
59
60#if [ "$RES_IP" == "$TEST_CRED" ]
61#then
62# exit 0
63#else
64# echo "FAIL: Failed to resolve to proper IP, got $RES_IP."
65# exit 1
66#fi