aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-12-03 16:03:07 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-12-03 16:03:07 +0000
commit1695e22c1880e52273dccc544a576b025dae2132 (patch)
treeeb27b3f6ce92769883ed0326d32dc85e6e558b16 /src/gns
parentb0060cd8403d9611930a8ce17e1c1ce25adcb951 (diff)
downloadgnunet-1695e22c1880e52273dccc544a576b025dae2132.tar.gz
gnunet-1695e22c1880e52273dccc544a576b025dae2132.zip
modify test to test shortened delegations in shorten and master zone
Diffstat (limited to 'src/gns')
-rwxr-xr-xsrc/gns/test_gns_nick_shorten.sh31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/gns/test_gns_nick_shorten.sh b/src/gns/test_gns_nick_shorten.sh
index 9e76b970b..3e15f1caa 100755
--- a/src/gns/test_gns_nick_shorten.sh
+++ b/src/gns/test_gns_nick_shorten.sh
@@ -54,40 +54,45 @@ gnunet-namestore -p -z testego -a -n mail -t A -V $TEST_IP -e never -c test_gns
54gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 54gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
55 55
56# Delete namecache content 56# Delete namecache content
57gnunet-arm -c test_gns_lookup.conf -k gns 57#gnunet-arm -c test_gns_lookup.conf -k gns
58gnunet-arm -c test_gns_lookup.conf -k namecache 58gnunet-arm -c test_gns_lookup.conf -k namecache
59rm -rf `gnunet-config -c test_gns_lookup.conf -s namecache-sqlite -o FILENAME -f` 59rm -rf `gnunet-config -c test_gns_lookup.conf -s namecache-sqlite -o FILENAME -f`
60 60
61# Force start of GNS 61# Force start of GNS
62gnunet-arm -c test_gns_lookup.conf -i gns 62gnunet-arm -c test_gns_lookup.conf -i gns
63
64# need to sleep here, to give PSEU record chance to be copied to DHT 63# need to sleep here, to give PSEU record chance to be copied to DHT
65sleep 1 64sleep 1
65
66RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME -t A -c test_gns_lookup.conf` 66RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME -t A -c test_gns_lookup.conf`
67 67
68# need to sleep here, as shortening happens asynchronously... 68# need to sleep here, as shortening happens asynchronously...
69sleep 1 69sleep 1
70RES_IP_PSEU=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.alice.short.gnu -t A -c test_gns_lookup.conf`
71gnunet-namestore -z testego -d -n mybestfriendalice -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
72 70
71# DO THAT
72PKEY_SHORT_RES=$($DO_TIMEOUT gnunet-gns --raw -c test_gns_lookup.conf -z short-zone -u alice.gnu -t PKEY)
73echo "Resolving alice's PKEY in shorten zone: $PKEY_SHORT_RES"
74PKEY_RES=$($DO_TIMEOUT gnunet-gns --raw -c test_gns_lookup.conf -z testego -u alice.short.gnu -t PKEY)
75echo "Resolving alice's PKEY in master zone: $PKEY_RES"
76
77#RES_IP_PSEU=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.alice.short.gnu -t A -c test_gns_lookup.conf`
78
79gnunet-namestore -z testego -d -n mybestfriendalice -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
73gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 80gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
74gnunet-arm -e -c test_gns_lookup.conf 81gnunet-arm -e -c test_gns_lookup.conf
75 82
76rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` 83rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
77 84
78if [ "$RES_IP" == "$TEST_IP" ] 85if [ "$DELEGATED_PKEY" == "$PKEY_SHORT_RES" ]
79then 86then
80 echo "PASS: Resolved $TEST_NAME properly to $RES_IP." 87 echo "PASS: Resolved delegation for shorten name in shortened zone"
81else 88else
82 echo "FAIL: Could not resolve $TEST_NAME to proper IP, got $RES_IP." 89 echo "FAIL: Expected PKEY in $DELEGATED_PKEY, received PKEY '$PKEY_SHORT_RES' in shorten zone."
83 exit 1
84fi 90fi
85 91
86if [ "$RES_IP_PSEU" == "$TEST_IP" ] 92if [ "$DELEGATED_PKEY" == "$PKEY_RES" ]
87then 93then
88 echo "PASS: Resolved $TEST_NAME_SHORT properly to $RES_IP." 94 echo "PASS: Resolved delegation for shorten name in master zone"
89 exit 0 95 exit 0
90else 96else
91 echo "FAIL: Could not resolve $TEST_NAME_SHORT to proper IP, got $RES_IP_PSEU." 97 echo "FAIL: Expected PKEY in $DELEGATED_PKEY, received PKEY $PKEY_SHORT_RES in master zone."
92 exit 1 98fi
93fi \ No newline at end of file