diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-03 16:03:07 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-03 16:03:07 +0000 |
commit | 1695e22c1880e52273dccc544a576b025dae2132 (patch) | |
tree | eb27b3f6ce92769883ed0326d32dc85e6e558b16 /src/gns | |
parent | b0060cd8403d9611930a8ce17e1c1ce25adcb951 (diff) | |
download | gnunet-1695e22c1880e52273dccc544a576b025dae2132.tar.gz gnunet-1695e22c1880e52273dccc544a576b025dae2132.zip |
modify test to test shortened delegations in shorten and master zone
Diffstat (limited to 'src/gns')
-rwxr-xr-x | src/gns/test_gns_nick_shorten.sh | 31 |
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 | |||
54 | gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf | 54 | gnunet-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 |
57 | gnunet-arm -c test_gns_lookup.conf -k gns | 57 | #gnunet-arm -c test_gns_lookup.conf -k gns |
58 | gnunet-arm -c test_gns_lookup.conf -k namecache | 58 | gnunet-arm -c test_gns_lookup.conf -k namecache |
59 | rm -rf `gnunet-config -c test_gns_lookup.conf -s namecache-sqlite -o FILENAME -f` | 59 | rm -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 |
62 | gnunet-arm -c test_gns_lookup.conf -i gns | 62 | gnunet-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 |
65 | sleep 1 | 64 | sleep 1 |
65 | |||
66 | RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME -t A -c test_gns_lookup.conf` | 66 | RES_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... |
69 | sleep 1 | 69 | sleep 1 |
70 | RES_IP_PSEU=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.alice.short.gnu -t A -c test_gns_lookup.conf` | ||
71 | gnunet-namestore -z testego -d -n mybestfriendalice -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf | ||
72 | 70 | ||
71 | # DO THAT | ||
72 | PKEY_SHORT_RES=$($DO_TIMEOUT gnunet-gns --raw -c test_gns_lookup.conf -z short-zone -u alice.gnu -t PKEY) | ||
73 | echo "Resolving alice's PKEY in shorten zone: $PKEY_SHORT_RES" | ||
74 | PKEY_RES=$($DO_TIMEOUT gnunet-gns --raw -c test_gns_lookup.conf -z testego -u alice.short.gnu -t PKEY) | ||
75 | echo "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 | |||
79 | gnunet-namestore -z testego -d -n mybestfriendalice -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf | ||
73 | gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf | 80 | gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf |
74 | gnunet-arm -e -c test_gns_lookup.conf | 81 | gnunet-arm -e -c test_gns_lookup.conf |
75 | 82 | ||
76 | rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` | 83 | rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` |
77 | 84 | ||
78 | if [ "$RES_IP" == "$TEST_IP" ] | 85 | if [ "$DELEGATED_PKEY" == "$PKEY_SHORT_RES" ] |
79 | then | 86 | then |
80 | echo "PASS: Resolved $TEST_NAME properly to $RES_IP." | 87 | echo "PASS: Resolved delegation for shorten name in shortened zone" |
81 | else | 88 | else |
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 | ||
84 | fi | 90 | fi |
85 | 91 | ||
86 | if [ "$RES_IP_PSEU" == "$TEST_IP" ] | 92 | if [ "$DELEGATED_PKEY" == "$PKEY_RES" ] |
87 | then | 93 | then |
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 |
90 | else | 96 | else |
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 | 98 | fi |
93 | fi \ No newline at end of file | ||