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