which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
# This test tests shortening functionality based on NICK records:
-#
+#
# zone "delegatedego": Alice's zone
# zone "testego": Local zone with delegation to alice
then
LOCATION="gnunet-config"
fi
-$LOCATION --version
+$LOCATION --version 1> /dev/null
if test $? != 0
then
- echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
+ echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
exit 77
fi
# Deleting home directory from previous runs
TEST_CONFIG="test_gns_nick_shorten.conf "
-rm -rf `gnunet-config -c test_gns_nick_shorten.conf -s PATHS -o GNUNET_HOME -f`
+rm -rf /tmp/test-gnunet-gns-peer-1/
TEST_IP="127.0.0.1"
TEST_IP="127.0.0.2"
TEST_NICK_EGO="ego"
gnunet-namestore -z testego -i $TEST_NICK_EGO -c $TEST_CONFIG
gnunet-namestore -z delegatedego -i $TEST_NICK_DELEGATED -c $TEST_CONFIG
-# Adding label www in Alice's delegatedego zone
+# Adding label www in Alice's delegatedego zone
echo "Adding www record with IP $TEST_IP"
gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_nick_shorten.conf
else
echo "FAIL: Expected PKEY in $DELEGATED_PKEY, received PKEY $PKEY_SHORT_RES in master zone."
RES=1
-fi
+fi
if [ $RES -eq 0 ]
then
- RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME_SHORT -t A -c test_gns_nick_shorten.conf`
- if [ "$RES_IP" == "$TEST_IP" ]
+ RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u $TEST_NAME_SHORT -t A -c test_gns_nick_shorten.conf`
+ if [ "$RES_IP" == "$TEST_IP" ]
then
echo "PASS: Received $TEST_IP for $TEST_NAME_SHORT"
else
gnunet-identity -D -z short-zone -c $TEST_CONFIG
gnunet-arm -e -c test_gns_nick_shorten.conf
-rm -rf `gnunet-config -c test_gns_nick_shorten.conf -s PATHS -o GNUNET_HOME -f`
+rm -rf /tmp/test-gnunet-gns-peer-1/
exit $RES