diff options
Diffstat (limited to 'src/credential/test_credential_lookup.sh')
-rwxr-xr-x | src/credential/test_credential_lookup.sh | 40 |
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 | ||
2 | trap "gnunet-arm -e -c test_credential_lookup.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_credential_lookup.conf -s PATHS -o GNUNET_HOME -f` | ||
17 | which timeout &> /dev/null && DO_TIMEOUT="timeout 30" | ||
18 | TEST_CREDENTIAL="keySub keyIss credName" | ||
19 | gnunet-arm -s -c test_credential_lookup.conf | ||
20 | gnunet-identity -C testsubject -c test_credential_lookup.conf | ||
21 | |||
22 | #TODO1 Plugin serialization functions see REVERSE in gns/plugin_gnsrecord_gns.c | ||
23 | gnunet-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 | ||
26 | RES_IP=`$DO_TIMEOUT gnunet-credential -z testsubject -s testsubject -u credName -c test_credential_lookup.conf` | ||
27 | gnunet-namestore -z testsubject -d -n newcred -t CRED -e never -c test_credential_lookup.conf | ||
28 | gnunet-identity -D testsubject -c test_credential_lookup.conf | ||
29 | gnunet-arm -e -c test_credential_lookup.conf | ||
30 | |||
31 | #TODO3 proper test | ||
32 | exit 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 | ||