gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -fix gns tests with slower(?) zonemaster


From: gnunet
Subject: [gnunet] branch master updated: -fix gns tests with slower(?) zonemaster
Date: Fri, 21 Oct 2022 01:56:14 +0200

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 34c3a6c5a -fix gns tests with slower(?) zonemaster
34c3a6c5a is described below

commit 34c3a6c5ae3a7ce2b4ec8b2f13ee934cb7816f5a
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Oct 21 08:56:06 2022 +0900

    -fix gns tests with slower(?) zonemaster
---
 src/gns/test_gns_at_lookup.sh              |  1 +
 src/gns/test_gns_caa_lookup.sh             |  1 +
 src/gns/test_gns_delegated_lookup.sh       |  1 +
 src/gns/test_gns_gns2dns_cname_lookup.sh   |  3 +--
 src/gns/test_gns_gns2dns_lookup.sh         |  4 +---
 src/gns/test_gns_gns2dns_zkey_lookup.sh    |  1 +
 src/gns/test_gns_ipv6_lookup.sh            |  1 +
 src/gns/test_gns_lookup.sh                 |  1 +
 src/gns/test_gns_mx_lookup.sh              |  2 +-
 src/gns/test_gns_redirect_lookup.sh        |  2 +-
 src/gns/test_gns_rel_expiration.sh         |  1 +
 src/gns/test_gns_revocation.sh             |  1 +
 src/gns/test_gns_soa_lookup.sh             |  1 +
 src/gns/test_gns_txt_lookup.sh             |  1 +
 src/zonemaster/gnunet-service-zonemaster.c | 26 ++++++++++++++------------
 15 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/src/gns/test_gns_at_lookup.sh b/src/gns/test_gns_at_lookup.sh
index 998bca700..6a2c958de 100755
--- a/src/gns/test_gns_at_lookup.sh
+++ b/src/gns/test_gns_at_lookup.sh
@@ -25,6 +25,7 @@ DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | 
grep delegatedego
 gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
 gnunet-namestore -p -z $MY_EGO -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c 
test_gns_lookup.conf
 gnunet-namestore -p -z delegatedego -a -n '@' -t A -V $TEST_IP -e never -c 
test_gns_lookup.conf
+sleep 0.5
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u b.$MY_EGO -t A -c test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n b -t PKEY -V $DELEGATED_PKEY  -e never -c 
test_gns_lookup.conf
 gnunet-namestore -z delegatedego -d -n '@' -t A -V $TEST_IP  -e never -c 
test_gns_lookup.conf
diff --git a/src/gns/test_gns_caa_lookup.sh b/src/gns/test_gns_caa_lookup.sh
index 043a1a937..fb488f47b 100755
--- a/src/gns/test_gns_caa_lookup.sh
+++ b/src/gns/test_gns_caa_lookup.sh
@@ -22,6 +22,7 @@ LABEL="testcaa"
 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 CAA -V "$TEST_CAA" -e never -c 
test_gns_lookup.conf
+sleep 0.5
 RES_CAA=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$MY_EGO -t CAA -c 
test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n $LABEL -t CAA -V "$TEST_CAA" -e never -c 
test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
diff --git a/src/gns/test_gns_delegated_lookup.sh 
b/src/gns/test_gns_delegated_lookup.sh
index c4885820d..5105abdb5 100755
--- a/src/gns/test_gns_delegated_lookup.sh
+++ b/src/gns/test_gns_delegated_lookup.sh
@@ -28,6 +28,7 @@ DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | 
grep $OTHER_EGO |
 gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
 gnunet-namestore -p -z $MY_EGO -a -n $DELEGATION_LABEL -t PKEY -V 
$DELEGATED_PKEY -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z $OTHER_EGO -a -n $FINAL_LABEL -t A -V $TEST_IP -e never 
-c test_gns_lookup.conf
+sleep 0.5
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u $FINAL_LABEL.$DELEGATION_LABEL.$MY_EGO 
-t A -c test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n b -t PKEY -V $DELEGATED_PKEY  -e never -c 
test_gns_lookup.conf
 gnunet-namestore -z $OTHER_EGO -d -n $FINAL_LABEL -t A -V $TEST_IP  -e never 
-c test_gns_lookup.conf
diff --git a/src/gns/test_gns_gns2dns_cname_lookup.sh 
b/src/gns/test_gns_gns2dns_cname_lookup.sh
index 9315f6b2f..c33c9d132 100755
--- a/src/gns/test_gns_gns2dns_cname_lookup.sh
+++ b/src/gns/test_gns_gns2dns_cname_lookup.sh
@@ -63,8 +63,7 @@ gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t 
GNS2DNS -V $TEST_RECOR
 
 gnunet-namestore -z $MY_EGO -D -c test_gns_lookup.conf
 
-echo "EGOs:"
-gnunet-identity -d
+sleep 0.5
 
 # lookup 'www.gnunet.org', IPv4
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN -t A -c 
test_gns_lookup.conf`
diff --git a/src/gns/test_gns_gns2dns_lookup.sh 
b/src/gns/test_gns_gns2dns_lookup.sh
index 240e441a4..9419330e6 100755
--- a/src/gns/test_gns_gns2dns_lookup.sh
+++ b/src/gns/test_gns_gns2dns_lookup.sh
@@ -64,9 +64,7 @@ gnunet-namestore -p -z $MY_EGO -a -n $TEST_RESOLVER_LABEL -t 
A -V $TEST_IP_GNS2D
 # map '$TEST_RECORD_NAME.$MY_EGO' to 'gnunet.org' in DNS
 gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V 
$TEST_RECORD_GNS2DNS -e never -c test_gns_lookup.conf
 
-
-echo "EGOs:"
-gnunet-identity -d
+sleep 1
 
 # lookup 'www.gnunet.org', IPv4
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN -t A -c 
test_gns_lookup.conf`
diff --git a/src/gns/test_gns_gns2dns_zkey_lookup.sh 
b/src/gns/test_gns_gns2dns_zkey_lookup.sh
index a299c34b6..ee3f3a748 100755
--- a/src/gns/test_gns_gns2dns_zkey_lookup.sh
+++ b/src/gns/test_gns_gns2dns_zkey_lookup.sh
@@ -65,6 +65,7 @@ gnunet-namestore -p -z $MY_EGO -a -n $TEST_RESOLVER_LABEL -t 
A -V $TEST_IP_GNS2D
 # map '$TEST_RECORD_NAME.$MY_EGO' to 'gnunet.org' in DNS
 gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V 
$TEST_RECORD_GNS2DNS -e never -c test_gns_lookup.conf
 
+sleep 1
 # lookup 'www.gnunet.org', IPv4
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN -t A -c 
test_gns_lookup.conf`
 # lookup 'www.gnunet.org', IPv6
diff --git a/src/gns/test_gns_ipv6_lookup.sh b/src/gns/test_gns_ipv6_lookup.sh
index 9766ac902..31e662f68 100755
--- a/src/gns/test_gns_ipv6_lookup.sh
+++ b/src/gns/test_gns_ipv6_lookup.sh
@@ -21,6 +21,7 @@ TEST_IP="dead::beef"
 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 www -t AAAA -V $TEST_IP -e never -c 
test_gns_lookup.conf
+sleep 0.5
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u www.$MY_EGO -t AAAA -c 
test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n www -t AAAA -V $TEST_IP -e never -c 
test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
diff --git a/src/gns/test_gns_lookup.sh b/src/gns/test_gns_lookup.sh
index fe273b2a3..92dfae28b 100755
--- a/src/gns/test_gns_lookup.sh
+++ b/src/gns/test_gns_lookup.sh
@@ -22,6 +22,7 @@ LABEL="www"
 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 A -V $TEST_IP -e never -c 
test_gns_lookup.conf
+sleep 0.5
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$MY_EGO -t A -c 
test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n $LABEL -t A -V $TEST_IP -e never -c 
test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
diff --git a/src/gns/test_gns_mx_lookup.sh b/src/gns/test_gns_mx_lookup.sh
index ffbe5a1b6..6f2b8192d 100755
--- a/src/gns/test_gns_mx_lookup.sh
+++ b/src/gns/test_gns_mx_lookup.sh
@@ -24,7 +24,7 @@ gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
 PKEY=`gnunet-identity -d | grep "$MY_EGO - " | awk '{print $3'}`
 WANT_MX="5 mail.$PKEY"
 gnunet-namestore -p -z $MY_EGO -a -n www -t MX -V "$TEST_MX" -e never -c 
test_gns_lookup.conf
-
+sleep 0.5
 RES_MX=`$DO_TIMEOUT gnunet-gns --raw -u www.$MY_EGO -t MX -c 
test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n www -t MX -V "$TEST_MX" -e never -c 
test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
diff --git a/src/gns/test_gns_redirect_lookup.sh 
b/src/gns/test_gns_redirect_lookup.sh
index dfe5087ef..4ee5c0e3e 100755
--- a/src/gns/test_gns_redirect_lookup.sh
+++ b/src/gns/test_gns_redirect_lookup.sh
@@ -48,7 +48,7 @@ gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME_DNS -t 
REDIRECT -V $TEST_
 gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME_PLUS -t REDIRECT -V 
$TEST_RECORD_REDIRECT_PLUS -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME_ZKEY -t REDIRECT -V 
$TEST_RECORD_REDIRECT_ZKEY -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_REDIRECT_SERVER -t A -V 
$TEST_IP_PLUS -e never -c test_gns_lookup.conf
-gnunet-namestore -D -z $MY_EGO
+sleep 3
 RES_REDIRECT=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN_PLUS -t A -c 
test_gns_lookup.conf`
 RES_REDIRECT_RAW=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN_PLUS -t 
REDIRECT -c test_gns_lookup.conf`
 RES_REDIRECT_ZKEY=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN_ZKEY -t A -c 
test_gns_lookup.conf`
diff --git a/src/gns/test_gns_rel_expiration.sh 
b/src/gns/test_gns_rel_expiration.sh
index 5334e048d..a240cfd0f 100755
--- a/src/gns/test_gns_rel_expiration.sh
+++ b/src/gns/test_gns_rel_expiration.sh
@@ -34,6 +34,7 @@ DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | 
grep $OTHER_EGO |
 gnunet-namestore -p -z $MY_EGO -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c 
test_gns_lookup.conf
 gnunet-namestore -p -z $OTHER_EGO -a -n www -t A -V $TEST_IP -e '5 s' -c 
test_gns_lookup.conf
 gnunet-arm -i gns -c test_gns_lookup.conf
+sleep 0.5
 # confirm that lookup currently works
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u www.b.$MY_EGO -t A -c 
test_gns_lookup.conf`
 # remove entry
diff --git a/src/gns/test_gns_revocation.sh b/src/gns/test_gns_revocation.sh
index 500cced1e..2253adcb4 100755
--- a/src/gns/test_gns_revocation.sh
+++ b/src/gns/test_gns_revocation.sh
@@ -26,6 +26,7 @@ DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | 
grep $OTHER_EGO |
 gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
 gnunet-namestore -p -z $MY_EGO -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c 
test_gns_lookup.conf
 gnunet-namestore -p -z $OTHER_EGO -a -n www -t A -V $TEST_IP -e never -c 
test_gns_lookup.conf
+sleep 1
 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u www.b.$MY_EGO -t A -c 
test_gns_lookup.conf`
 gnunet-revocation -R $OTHER_EGO -p  -c test_gns_lookup.conf
 RES_IP_REV=`$DO_TIMEOUT gnunet-gns --raw -u www.b.$MY_EGO -t A -c 
test_gns_lookup.conf`
diff --git a/src/gns/test_gns_soa_lookup.sh b/src/gns/test_gns_soa_lookup.sh
index 326b99a8f..a697782bb 100755
--- a/src/gns/test_gns_soa_lookup.sh
+++ b/src/gns/test_gns_soa_lookup.sh
@@ -34,6 +34,7 @@ fi
 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 $TEST_RECORD_NAME -t GNS2DNS -V 
${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf
+sleep 0.5
 RES_SOA=`$DO_TIMEOUT gnunet-gns --raw -u $TEST_DOMAIN -t SOA -c 
test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n $TEST_RECORD_NAME -t GNS2DNS -V 
${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf > 
/dev/null 2>&1
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
diff --git a/src/gns/test_gns_txt_lookup.sh b/src/gns/test_gns_txt_lookup.sh
index 5956d8bc7..4e36e8ad8 100755
--- a/src/gns/test_gns_txt_lookup.sh
+++ b/src/gns/test_gns_txt_lookup.sh
@@ -22,6 +22,7 @@ LABEL="testtxt"
 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 TXT -V "$TEST_TXT" -e never -c 
test_gns_lookup.conf
+sleep 0.5
 RES_TXT=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$MY_EGO -t TXT -c 
test_gns_lookup.conf`
 gnunet-namestore -z $MY_EGO -d -n $LABEL -t TXT -V "$TEST_TXT" -e never -c 
test_gns_lookup.conf
 gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
diff --git a/src/zonemaster/gnunet-service-zonemaster.c 
b/src/zonemaster/gnunet-service-zonemaster.c
index 48c27380b..029abe208 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -100,7 +100,7 @@
 /**
  * Our workers
  */
-static pthread_t *worker;
+static pthread_t * worker;
 
 /**
  * Lock for the open jobs queue.
@@ -112,6 +112,11 @@ static pthread_mutex_t jobs_lock;
  */
 static pthread_mutex_t results_lock;
 
+/**
+ * Wait condition on new jobs
+ */
+static pthread_cond_t empty_jobs;
+
 /**
  * For threads to know we are shutting down
  */
@@ -855,6 +860,7 @@ perform_dht_put (const struct GNUNET_IDENTITY_PrivateKey 
*key,
   job->expire_pub = expire_pub;
   GNUNET_CONTAINER_DLL_insert (jobs_head, jobs_tail, job);
   GNUNET_assert (0 == pthread_mutex_unlock (&jobs_lock));
+  pthread_cond_signal (&empty_jobs);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Storing %u record(s) for label `%s' in DHT with expiration 
`%s'\n",
               rd_public_count,
@@ -1208,6 +1214,7 @@ perform_dht_put_monitor (const struct 
GNUNET_IDENTITY_PrivateKey *key,
   job->expire_pub = expire_pub;
   GNUNET_CONTAINER_DLL_insert (jobs_head, jobs_tail, job);
   GNUNET_assert (0 == pthread_mutex_unlock (&jobs_lock));
+  pthread_cond_signal (&empty_jobs);
 }
 
 
@@ -1297,13 +1304,12 @@ sign_worker (void *cls)
   while (GNUNET_YES != in_shutdown)
   {
     GNUNET_assert (0 == pthread_mutex_lock (&jobs_lock));
-    if (NULL != jobs_head)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Taking on Job for %s\n", jobs_head->label);
-      job = jobs_head;
-      GNUNET_CONTAINER_DLL_remove (jobs_head, jobs_tail, job);
-    }
+    while (NULL == jobs_head)
+      pthread_cond_wait (&empty_jobs, &jobs_lock);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Taking on Job for %s\n", jobs_head->label);
+    job = jobs_head;
+    GNUNET_CONTAINER_DLL_remove (jobs_head, jobs_tail, job);
     GNUNET_assert (0 == pthread_mutex_unlock (&jobs_lock));
     if (NULL != job)
     {
@@ -1318,10 +1324,6 @@ sign_worker (void *cls)
                   "Done, notifying main thread through pipe!\n");
       GNUNET_DISK_file_write (fh, "!", 1);
     }
-    else
-    {
-      sleep (1);
-    }
   }
   return NULL;
 }

-- 
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]