diff options
Diffstat (limited to 'src/gns/test_gns_txt_lookup.sh')
-rwxr-xr-x | src/gns/test_gns_txt_lookup.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gns/test_gns_txt_lookup.sh b/src/gns/test_gns_txt_lookup.sh new file mode 100755 index 000000000..ac8bc7e45 --- /dev/null +++ b/src/gns/test_gns_txt_lookup.sh | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/bash | ||
2 | trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT | ||
3 | rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME` | ||
4 | which timeout &> /dev/null && DO_TIMEOUT="timeout 5" | ||
5 | TEST_TXT="GNS powered txt record data" | ||
6 | gnunet-arm -s -c test_gns_lookup.conf | ||
7 | gnunet-identity -C testego -c test_gns_lookup.conf | ||
8 | gnunet-namestore -p -z testego -a -n testtxt -t TXT -V "$TEST_TXT" -e never -c test_gns_lookup.conf | ||
9 | RES_TXT=`$DO_TIMEOUT gnunet-gns --raw -z testego -u testtxt.gnu -t TXT -c test_gns_lookup.conf` | ||
10 | gnunet-namestore -z testego -d -n testtxt -t TXT -V "$TEST_TXT" -e never -c test_gns_lookup.conf | ||
11 | gnunet-identity -D testego -c test_gns_lookup.conf | ||
12 | gnunet-arm -e -c test_gns_lookup.conf | ||
13 | |||
14 | if [ "$RES_TXT" == "$TEST_TXT" ] | ||
15 | then | ||
16 | exit 0 | ||
17 | else | ||
18 | echo "Failed to resolve to proper TXT, got $RES_TXT." | ||
19 | exit 1 | ||
20 | fi | ||