aboutsummaryrefslogtreecommitdiff
path: root/src/cli/namestore/test_namestore_box_lightest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/namestore/test_namestore_box_lightest.sh')
-rwxr-xr-xsrc/cli/namestore/test_namestore_box_lightest.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/cli/namestore/test_namestore_box_lightest.sh b/src/cli/namestore/test_namestore_box_lightest.sh
new file mode 100755
index 000000000..3c8ad2799
--- /dev/null
+++ b/src/cli/namestore/test_namestore_box_lightest.sh
@@ -0,0 +1,63 @@
1#!/bin/bash
2CONFIGURATION="test_namestore_api.conf"
3trap "gnunet-arm -e -c $CONFIGURATION" SIGINT
4
5LOCATION=$(which gnunet-config)
6if [ -z $LOCATION ]
7then
8 LOCATION="gnunet-config"
9fi
10$LOCATION --version 1> /dev/null
11if test $? != 0
12then
13 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
14 exit 77
15fi
16
17rm -rf `$LOCATION -c $CONFIGURATION -s PATHS -o GNUNET_HOME`
18TEST_RECORD_NAME_DNS="trust"
19TEST_RECORD_VALUE_SMIMEA="49152 49153 53 0 0 1 d2abde240d7cd3ee6b4b28c54df034b97983a1d16e8a410e4561cb106618e971"
20TEST_RECORD_VALUE_URI="49152 49152 256 10 10 \"http://lightest.nletlabs.nl/\""
21which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
22
23function start_peer
24{
25 gnunet-arm -s -c $CONFIGURATION
26 gnunet-identity -C testego -c $CONFIGURATION
27}
28
29function stop_peer
30{
31 gnunet-identity -D testego -c $CONFIGURATION
32 gnunet-arm -e -c $CONFIGURATION
33}
34
35
36start_peer
37# Create a public SMIMEA record
38gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t BOX -V "$TEST_RECORD_VALUE_SMIMEA" -e never -c $CONFIGURATION
39NAMESTORE_RES=$?
40
41if [ $NAMESTORE_RES = 0 ]
42then
43 echo "PASS: Creating boxed name in namestore SMIMEA"
44else
45 echo "FAIL: Creating boxed name in namestore failed with $NAMESTORE_RES."
46 stop_peer
47 exit 1
48fi
49
50# Create a public URI record
51gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t BOX -V "$TEST_RECORD_VALUE_URI" -e never -c $CONFIGURATION
52NAMESTORE_RES=$?
53
54if [ $NAMESTORE_RES = 0 ]
55then
56 echo "PASS: Creating boxed name in namestore URI"
57else
58 echo "FAIL: Creating boxed name in namestore failed with $NAMESTORE_RES."
59 stop_peer
60 exit 1
61fi
62
63stop_peer \ No newline at end of file