gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 01/02: GNS: new SBOX test cases


From: gnunet
Subject: [gnunet] 01/02: GNS: new SBOX test cases
Date: Thu, 14 Dec 2023 22:58:13 +0100

This is an automated email from the git hooks/post-receive script.

sebi pushed a commit to branch master
in repository gnunet.

commit be653ce5a258c87090edb6548a31f82c19cf2bc2
Author: Sebastian Nadler <sebastian.nadler@tum.de>
AuthorDate: Thu Dec 14 21:57:44 2023 +0100

    GNS: new SBOX test cases
---
 src/cli/gns/test_gns_sbox.sh                       | 85 ++++++++++++++++++++--
 .../{test_gns_sbox.sh => test_gns_sbox_simple.sh}  |  8 +-
 2 files changed, 82 insertions(+), 11 deletions(-)

diff --git a/src/cli/gns/test_gns_sbox.sh b/src/cli/gns/test_gns_sbox.sh
index 54e51fa2c..7d4b90943 100755
--- a/src/cli/gns/test_gns_sbox.sh
+++ b/src/cli/gns/test_gns_sbox.sh
@@ -19,22 +19,93 @@ which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
 TEST_A="139.134.54.9"
 MY_EGO="myego"
 LABEL="testsbox"
-HASH="c93f1e400f26708f98cb19d936620da35eec8f72e57f9eec01c1afd6"
-PROTOCOL_TEXT="_smimecert"
+PREFIX1="_name"
+PREFIX2="__"
+PREFIX3="_a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_"
+PREFIX4="abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz._abc"
+PREFIX5="abc.abc._abc.abc"
+PREFIX6="abc.abc._abc.abc._abc"
+PREFIX7="abc.abc._abc.abc._abc.abc"
 gnunet-arm -s -c test_gns_lookup.conf
 gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
-gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$HASH.$PROTOCOL_TEXT 1 
$TEST_A" -e never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX1 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX2 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX3 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX4 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX5 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX6 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$PREFIX7 1 $TEST_A" -e 
never -c test_gns_lookup.conf
 sleep 0.5
-RES_A=`$DO_TIMEOUT gnunet-gns --raw -u $HASH.$PROTOCOL_TEXT.$LABEL.$MY_EGO -t 
A -c test_gns_lookup.conf`
-gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$HASH.$PROTOCOL_TEXT 1 
$TEST_A" -e never -c test_gns_lookup.conf
+RES_A1=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX1.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+RES_A2=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX2.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+RES_A3=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX3.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+RES_A4=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX4.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+RES_A5=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX5.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+RES_A6=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX6.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+RES_A7=`$DO_TIMEOUT gnunet-gns --raw -u $PREFIX7.$LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX1 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX2 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX3 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX4 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX5 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX6 1 $TEST_A" -e 
never -c test_gns_lookup.conf
+gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$PREFIX7 1 $TEST_A" -e 
never -c test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
 gnunet-arm -e -c test_gns_lookup.conf
 rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
 
-if [ "$RES_A" = "$TEST_A" ]
+if [ "$RES_A1" = "$TEST_A" ]
 then
   exit 0
 else
-  echo "Failed to resolve to proper A, got '$RES_A'."
+  echo "Failed to resolve to proper A, got '$RES_A1'."
   exit 1
 fi
+
+if [ "$RES_A2" = "$TEST_A" ]
+then
+  exit 0
+else
+  echo "Failed to resolve to proper A, got '$RES_A2'."
+  exit 1
+fi
+
+if [ "$RES_A3" = "$TEST_A" ]
+then
+  exit 0
+else
+  echo "Failed to resolve to proper A, got '$RES_A3'."
+  exit 1
+fi
+
+if [ "$RES_A4" = "$TEST_A" ]
+then
+  exit 0
+else
+  echo "Failed to resolve to proper A, got '$RES_A4'."
+  exit 1
+fi
+
+if [ "$RES_A5" = "$TEST_A" ]
+then
+  echo "Should have failed to resolve to proper A, got '$RES_A5' anyway."
+  exit 1
+else
+  exit 0
+fi
+
+if [ "$RES_A6" = "$TEST_A" ]
+then
+  exit 0
+else
+  echo "Failed to resolve to proper A, got '$RES_A6'."
+  exit 1
+fi
+
+if [ "$RES_A7" = "$TEST_A" ]
+then
+  echo "Should have failed to resolve to proper A, got '$RES_A7' anyway."
+  exit 1
+else
+  exit 0
+fi
diff --git a/src/cli/gns/test_gns_sbox.sh b/src/cli/gns/test_gns_sbox_simple.sh
similarity index 76%
copy from src/cli/gns/test_gns_sbox.sh
copy to src/cli/gns/test_gns_sbox_simple.sh
index 54e51fa2c..1706a2a22 100755
--- a/src/cli/gns/test_gns_sbox.sh
+++ b/src/cli/gns/test_gns_sbox_simple.sh
@@ -18,15 +18,15 @@ rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths 
-o GNUNET_TEST_HOME`
 which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
 TEST_A="139.134.54.9"
 MY_EGO="myego"
-LABEL="testsbox"
 HASH="c93f1e400f26708f98cb19d936620da35eec8f72e57f9eec01c1afd6"
 PROTOCOL_TEXT="_smimecert"
 gnunet-arm -s -c test_gns_lookup.conf
 gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
-gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t SBOX -V "$HASH.$PROTOCOL_TEXT 1 
$TEST_A" -e never -c test_gns_lookup.conf
+gnunet-namestore -p -z $MY_EGO -a -n '@' -t SBOX -V "$HASH.$PROTOCOL_TEXT 1 
$TEST_A" -e never -c test_gns_lookup.conf
 sleep 0.5
-RES_A=`$DO_TIMEOUT gnunet-gns --raw -u $HASH.$PROTOCOL_TEXT.$LABEL.$MY_EGO -t 
A -c test_gns_lookup.conf`
-gnunet-namestore -z $MY_EGO -d -n $LABEL -t SBOX -V "$HASH.$PROTOCOL_TEXT 1 
$TEST_A" -e never -c test_gns_lookup.conf
+gnunet-namestore -D -c test_gns_lookup.conf
+RES_A=`$DO_TIMEOUT gnunet-gns --raw -u $HASH.$PROTOCOL_TEXT.$MY_EGO -t A -c 
test_gns_lookup.conf`
+gnunet-namestore -z $MY_EGO -d -n '@' -t SBOX -V "$HASH.$PROTOCOL_TEXT 1 
$TEST_A" -e never -c test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
 gnunet-arm -e -c test_gns_lookup.conf
 rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]