aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_quickupdate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gns_quickupdate.sh')
-rwxr-xr-xsrc/gns/test_gns_quickupdate.sh34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/gns/test_gns_quickupdate.sh b/src/gns/test_gns_quickupdate.sh
index d58a2712c..5606491e4 100755
--- a/src/gns/test_gns_quickupdate.sh
+++ b/src/gns/test_gns_quickupdate.sh
@@ -9,41 +9,49 @@ fi
9$LOCATION --version 1> /dev/null 9$LOCATION --version 1> /dev/null
10if test $? != 0 10if test $? != 0
11then 11then
12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" 12 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
13 exit 77 13 exit 77
14fi 14fi
15 15
16MY_EGO="myego"
17OTHER_EGO="delegatedego"
18
19
16rm -rf /tmp/test-gnunet-gns-peer-1/ 20rm -rf /tmp/test-gnunet-gns-peer-1/
17which timeout &> /dev/null && DO_TIMEOUT="timeout 5" 21which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
18TEST_IP="127.0.0.1" 22TEST_IP="127.0.0.1"
19gnunet-arm -s -c test_gns_lookup.conf 23gnunet-arm -s -c test_gns_lookup.conf
20gnunet-identity -C testego -c test_gns_lookup.conf 24gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
21gnunet-identity -C delegatedego -c test_gns_lookup.conf 25gnunet-identity -C $OTHER_EGO -c test_gns_lookup.conf
22DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego | awk '{print $3}') 26DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep $OTHER_EGO | awk '{print $3}')
23gnunet-arm -i gns -c test_gns_lookup.conf 27gnunet-arm -i gns -c test_gns_lookup.conf
24gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf 28gnunet-namestore -p -z $MY_EGO -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
25# Give GNS/namestore time to fully start and finish initial iteration 29# Give GNS/namestore time to fully start and finish initial iteration
26sleep 2 30sleep 2
27# Performing namestore update 31# Performing namestore update
28gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 32gnunet-namestore -p -z $OTHER_EGO -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
29# Give GNS chance to observe store event via monitor 33# Give GNS chance to observe store event via monitor
30sleep 1 34sleep 1
31gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 35gnunet-namestore -z $OTHER_EGO -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
32# give GNS chance to process monitor event 36# give GNS chance to process monitor event
33sleep 1 37sleep 1
34# stop everything and restart to check that DHT PUT did happen 38# stop everything and restart to check that DHT PUT did happen
35gnunet-arm -k gns -c test_gns_lookup.conf 39gnunet-arm -k gns -c test_gns_lookup.conf
36gnunet-arm -k namestore -c test_gns_lookup.conf 40gnunet-arm -k namestore -c test_gns_lookup.conf
37gnunet-arm -k namecache -c test_gns_lookup.conf 41gnunet-arm -k namecache -c test_gns_lookup.conf
42gnunet-arm -k zonemaster -c test_gns_lookup.conf
38# Purge nameacache, as we might otherwise fetch from there 43# Purge nameacache, as we might otherwise fetch from there
39rm -r `gnunet-config -c test_gns_lookup.conf -s namecache-sqlite -o FILENAME` 44# FIXME: testcase started failing after the line below was fixed by adding '-f',
45# might have never worked (!)
46rm -r `gnunet-config -f -c test_gns_lookup.conf -s namecache-sqlite -o FILENAME`
40gnunet-arm -i namestore -c test_gns_lookup.conf 47gnunet-arm -i namestore -c test_gns_lookup.conf
41gnunet-arm -i namecache -c test_gns_lookup.conf 48gnunet-arm -i namecache -c test_gns_lookup.conf
49gnunet-arm -i zonemaster -c test_gns_lookup.conf
42gnunet-arm -i gns -c test_gns_lookup.conf 50gnunet-arm -i gns -c test_gns_lookup.conf
43RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf` 51RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u www.b.$MY_EGO -t A -c test_gns_lookup.conf`
44gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf 52gnunet-namestore -z $MY_EGO -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
45gnunet-identity -D testego -c test_gns_lookup.conf 53gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
46gnunet-identity -D delegatedego -c test_gns_lookup.conf 54gnunet-identity -D $OTHER_EGO -c test_gns_lookup.conf
47gnunet-arm -e -c test_gns_lookup.conf 55gnunet-arm -e -c test_gns_lookup.conf
48rm -rf /tmp/test-gnunet-gns-peer-1/ 56rm -rf /tmp/test-gnunet-gns-peer-1/
49 57
@@ -51,6 +59,6 @@ if [ "$RES_IP" == "$TEST_IP" ]
51then 59then
52 exit 0 60 exit 0
53else 61else
54 echo "Failed to properly resolve IP, got $RES_IP." 62 echo "Failed to properly resolve IP, expected $TEST_IP, got $RES_IP."
55 exit 1 63 exit 1
56fi 64fi