aboutsummaryrefslogtreecommitdiff
path: root/src/escrow/test_gns_escrow.sh
diff options
context:
space:
mode:
authorjospaeth <spaethj@in.tum.de>2020-08-06 16:12:32 +0200
committerjospaeth <spaethj@in.tum.de>2020-08-06 16:12:32 +0200
commit90e87e4a0fc1a4673341e948a5eedd0d9a1d60ea (patch)
treeb356c688618a5893f996dc0abe77246ca37d490c /src/escrow/test_gns_escrow.sh
parent7359d93752bfe39d1154ea0e67f556dab0020cff (diff)
downloadgnunet-90e87e4a0fc1a4673341e948a5eedd0d9a1d60ea.tar.gz
gnunet-90e87e4a0fc1a4673341e948a5eedd0d9a1d60ea.zip
add tests for plaintext and gns escrow
Diffstat (limited to 'src/escrow/test_gns_escrow.sh')
-rwxr-xr-xsrc/escrow/test_gns_escrow.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/escrow/test_gns_escrow.sh b/src/escrow/test_gns_escrow.sh
new file mode 100755
index 000000000..00f8f3a49
--- /dev/null
+++ b/src/escrow/test_gns_escrow.sh
@@ -0,0 +1,47 @@
1#!/bin/sh
2
3LOCATION=$(which gnunet-config)
4if [ -z $LOCATION ]
5then
6 LOCATION="gnunet-config"
7fi
8$LOCATION --version 1> /dev/null
9if test $? != 0
10then
11 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
12 exit 77
13fi
14
15rm -rf `gnunet-config -c test_escrow.conf -s PATHS -o GNUNET_HOME -f`
16
17which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
18
19gnunet-arm -s -c test_escrow.conf
20gnunet-identity -C testego -c test_escrow.conf
21ANCHOR=$(gnunet-escrow -m gns -P testego -c test_escrow.conf)
22if test $? != 0
23then
24 echo "GNS escrow failed!"
25 gnunet-arm -e -c test_escrow.conf
26 exit 1
27else
28 ANCHOR=$(echo $ANCHOR | awk 'NF>1{print $NF}')
29fi
30gnunet-escrow -m gns -V testego -a $ANCHOR -c test_escrow.conf
31if test $? != 0
32then
33 echo "GNS verification failed!"
34 gnunet-arm -e -c test_escrow.conf
35 exit 1
36fi
37gnunet-identity -D testego -c test_escrow.conf
38gnunet-escrow -m gns -G testego -a $ANCHOR -c test_escrow.conf
39if test $? != 0
40then
41 echo "GNS restore failed!"
42 gnunet-arm -e -c test_escrow.conf
43 exit 1
44fi
45gnunet-arm -e -c test_escrow.conf
46
47exit 0