aboutsummaryrefslogtreecommitdiff
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.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/credential/test_credential_lookup.sh b/src/credential/test_credential_lookup.sh
new file mode 100755
index 000000000..216c281d7
--- /dev/null
+++ b/src/credential/test_credential_lookup.sh
@@ -0,0 +1,40 @@
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`
17which timeout &> /dev/null && DO_TIMEOUT="timeout 30"
18TEST_CREDENTIAL="keySub keyIss credName"
19gnunet-arm -s -c test_credential_lookup.conf
20gnunet-identity -C testsubject -c test_credential_lookup.conf
21
22#TODO1 Plugin serialization functions see REVERSE in gns/plugin_gnsrecord_gns.c
23gnunet-namestore -p -z testsubject -a -n newcred -t CRED -V $TEST_CREDENTIAL -e never -c test_credential_lookup.conf
24
25#TODO2 Add -z swich like in gnunet-gns
26RES_IP=`$DO_TIMEOUT gnunet-credential -z testsubject -s testsubject -u credName -c test_credential_lookup.conf`
27gnunet-namestore -z testsubject -d -n newcred -t CRED -e never -c test_credential_lookup.conf
28gnunet-identity -D testsubject -c test_credential_lookup.conf
29gnunet-arm -e -c test_credential_lookup.conf
30
31#TODO3 proper test
32exit 0
33
34#if [ "$RES_IP" == "$TEST_CRED" ]
35#then
36# exit 0
37#else
38# echo "FAIL: Failed to resolve to proper IP, got $RES_IP."
39# exit 1
40#fi