gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (ff2452d55 -> 2caf34724)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (ff2452d55 -> 2caf34724)
Date: Tue, 19 Feb 2019 02:02:02 +0100

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

grothoff pushed a change to branch master
in repository gnunet.

    from ff2452d55 clean up python logic a bit, remove duplicate print() calls 
when we have log calls
     new e902386cf extra sanity check for #5582
     new f53c0c9eb unset XDG vars in test explicitly in case test is run by hand
     new f773f02ad do not use rps in consensus test
     new 472250336 fix possibility of NULL result for empty database
     new 726ccfadf do not strictly require mq non-NULL, as peerinfo service 
might have died already
     new 5268a6fed note about assertion actually failing
     new 29184ebd9 got integration tests to pass, fixes #5560
     new 2caf34724 update ignore file

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/consensus/test_consensus.conf                  |   4 +
 src/datastore/plugin_datastore_postgres.c          |   8 +-
 src/gns/.gitignore                                 |   1 +
 src/integration-tests/gnunet_testing.py.in         |   5 +-
 .../test_integration_bootstrap_and_connect.py.in   |   2 +-
 .../test_integration_disconnect_nat.py.in          |   2 +-
 .../test_integration_reconnect.py.in               | 110 ++++++++++-----------
 .../test_integration_reconnect_nat.py.in           |   2 +-
 src/namestore/test_plugin_namestore.c              |   3 +-
 src/peerinfo/peerinfo_api.c                        |   5 +-
 src/pq/pq_result_helper.c                          |   2 +-
 src/sq/sq.c                                        |   2 +-
 src/transport/transport_api_core.c                 |   2 +-
 13 files changed, 78 insertions(+), 70 deletions(-)

diff --git a/src/consensus/test_consensus.conf 
b/src/consensus/test_consensus.conf
index fa42c3c1a..4f17fa359 100644
--- a/src/consensus/test_consensus.conf
+++ b/src/consensus/test_consensus.conf
@@ -81,3 +81,7 @@ WAN_QUOTA_OUT = unlimited
 
 [core]
 USE_EPHEMERAL_KEYS = NO
+
+[rps]
+START_ON_DEMAND = NO
+IMMEDIATE_START = NO
diff --git a/src/datastore/plugin_datastore_postgres.c 
b/src/datastore/plugin_datastore_postgres.c
index 94db6e116..0a3018411 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -11,7 +11,7 @@
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -153,7 +153,11 @@ init_connection (struct Plugin *plugin)
                             "SELECT hash FROM gn090",
                             0),
     GNUNET_PQ_make_prepare ("estimate_size",
-                            "SELECT SUM(LENGTH(value))+256*COUNT(*) AS total 
FROM gn090",
+                            "SELECT CASE WHEN NOT EXISTS"
+                            "  (SELECT 1 FROM gn090)"
+                            "  THEN 0"
+                            "  ELSE (SELECT SUM(LENGTH(value))+256*COUNT(*) 
FROM gn090)"
+                            "END AS total",
                             0),
     GNUNET_PQ_PREPARED_STATEMENT_END
   };
diff --git a/src/gns/.gitignore b/src/gns/.gitignore
index afd062cb3..3bbb2eb3d 100644
--- a/src/gns/.gitignore
+++ b/src/gns/.gitignore
@@ -9,3 +9,4 @@ local.crt
 local.der
 local.key
 server.csr
+gnunet-gns-proxy-setup-ca
diff --git a/src/integration-tests/gnunet_testing.py.in 
b/src/integration-tests/gnunet_testing.py.in
index 75fffb1ab..c9342ecf0 100644
--- a/src/integration-tests/gnunet_testing.py.in
+++ b/src/integration-tests/gnunet_testing.py.in
@@ -178,7 +178,7 @@ class StatisticsCondition(Condition):
             fail = ""
             op = " == "
         if (((self.fulfilled == False) and (failed_only == True)) or 
(failed_only == False)):
-            logger.debug('%s %s condition in subsystem %s: %s: (expected/real 
value) %s %s %s %s', self.peer.id[:4].decode("utf-8"), peer.cfg, 
self.subsystem.ljust(12), self.name.ljust(30), self.value, op, self.result, 
fail)
+            logger.debug('%s %s condition in subsystem %s: %s: (expected/real 
value) %s %s %s %s', self.peer.id[:4].decode("utf-8"), self.peer.cfg, 
self.subsystem.ljust(12), self.name.ljust(30), self.value, op, self.result, 
fail)
         return self.fulfilled
 
 
@@ -272,6 +272,9 @@ class Peer(object):
             return False
 
     def start(self):
+        os.unsetenv ("XDG_CONFIG_HOME")
+        os.unsetenv ("XDG_DATA_HOME")
+        os.unsetenv ("XDG_CACHE_HOME")
         self.test.p("Starting peer using cfg " + self.cfg)
         try:
             server = subprocess.Popen([self.test.gnunetarm, '-sq', '-c', 
self.cfg])
diff --git a/src/integration-tests/test_integration_bootstrap_and_connect.py.in 
b/src/integration-tests/test_integration_bootstrap_and_connect.py.in
index 560a429fd..f0de1c0cd 100755
--- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in
+++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in
@@ -11,7 +11,7 @@
 #    WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 #    Affero General Public License for more details.
-#   
+#
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
diff --git a/src/integration-tests/test_integration_disconnect_nat.py.in 
b/src/integration-tests/test_integration_disconnect_nat.py.in
index 825c1cfa1..601586f47 100755
--- a/src/integration-tests/test_integration_disconnect_nat.py.in
+++ b/src/integration-tests/test_integration_disconnect_nat.py.in
@@ -11,7 +11,7 @@
 #    WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 #    Affero General Public License for more details.
-#   
+#
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
diff --git a/src/integration-tests/test_integration_reconnect.py.in 
b/src/integration-tests/test_integration_reconnect.py.in
index 573ae221a..e8abacd48 100755
--- a/src/integration-tests/test_integration_reconnect.py.in
+++ b/src/integration-tests/test_integration_reconnect.py.in
@@ -11,13 +11,13 @@
 #    WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 #    Affero General Public License for more details.
-#   
+#
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
-# 
+#
 from __future__ import print_function
 import sys
 import os
@@ -30,13 +30,13 @@ from gnunet_testing import Peer
 from gnunet_testing import Test
 from gnunet_testing import Check
 from gnunet_testing import Condition
-from gnunet_testing import * 
- 
+from gnunet_testing import *
+
 
 #
 # This test tests if a fresh peer bootstraps from a hostlist server and then
 # successfully connects to the server. When both peers are connected
-# in transport, core, topology, fs, botth peers are shutdown and restarted 
+# in transport, core, topology, fs, botth peers are shutdown and restarted
 #
 # Conditions for successful exit:
 # Both peers have 1 connected peer in transport, core, topology, fs after 
restart
@@ -68,68 +68,68 @@ def cleanup_onerror (function, path, excinfo):
 
 def cleanup ():
     retries = 10
-    path = os.path.join (tmp, "c_bootstrap_server")  
-    test.p ("Removing " + path)      
+    path = os.path.join (tmp, "c_bootstrap_server")
+    test.p ("Removing " + path)
     while ((os.path.exists(path)) and (retries > 0)):
         shutil.rmtree ((path), False, cleanup_onerror)
         time.sleep (1)
         retries -= 1
     if (os.path.exists(path)):
-        test.p ("Failed to remove " + path) 
-        
-    
+        test.p ("Failed to remove " + path)
+
+
     retries = 10
-    path = os.path.join (tmp, "c_no_nat_client")  
-    test.p ("Removing " + path)      
+    path = os.path.join (tmp, "c_no_nat_client")
+    test.p ("Removing " + path)
     while ((os.path.exists(path)) and (retries > 0)):
         shutil.rmtree ((path), False, cleanup_onerror)
         time.sleep (1)
         retries -= 1
     if (os.path.exists(path)):
-        test.p ("Failed to remove " + path) 
+        test.p ("Failed to remove " + path)
 
 def success_restart_cont (check):
-       global success 
+       global success
        print('Peers connected successfully after restart')
        server.stop ()
        client.stop ()
-       success = True; 
+       success = True;
 
 
-def fail_restart_cont (check):    
-       global success 
+def fail_restart_cont (check):
+       global success
        success = False;
        print('Peers failed to connect after restart')
-       check.evaluate(True)   
-    
+       check.evaluate(True)
+
 
 def success_connect_cont (check):
        print('Peers connected successfully')
        server.stop ()
        client.stop ()
-       
+
        time.sleep(5)
-       
+
        test.p ('Restarting client & server')
        server.start ()
        client.start ()
-       
+
        check = Check (test)
        check.add (StatisticsCondition (client, 'transport', '# peers 
connected',1))
        check.add (StatisticsCondition (client, 'core', '# peers connected',1))
        check.add (StatisticsCondition (client, 'topology', '# peers 
connected',1))
        check.add (StatisticsCondition (client, 'fs', '# peers connected',1))
-       
+
        check.add (StatisticsCondition (server, 'transport', '# peers 
connected',1))
        check.add (StatisticsCondition (server, 'core', '# peers connected',1))
        check.add (StatisticsCondition (server, 'topology', '# peers 
connected',1))
-       check.add (StatisticsCondition (server, 'fs', '# peers connected',1))  
-       
+       check.add (StatisticsCondition (server, 'fs', '# peers connected',1))
+
        check.run_blocking (check_timeout, success_restart_cont, 
fail_restart_cont)
 
 
-def fail_connect_cont (check):    
-       global success 
+def fail_connect_cont (check):
+       global success
        success= False;
        print('Peers failed to connect')
        check.evaluate(True)
@@ -141,28 +141,28 @@ def check_connect ():
        check.add (StatisticsCondition (client, 'core', '# peers connected',1))
        check.add (StatisticsCondition (client, 'topology', '# peers 
connected',1))
        check.add (StatisticsCondition (client, 'fs', '# peers connected',1))
-       
+
        check.add (StatisticsCondition (server, 'transport', '# peers 
connected',1))
        check.add (StatisticsCondition (server, 'core', '# peers connected',1))
        check.add (StatisticsCondition (server, 'topology', '# peers 
connected',1))
-       check.add (StatisticsCondition (server, 'fs', '# peers connected',1))  
-       
+       check.add (StatisticsCondition (server, 'fs', '# peers connected',1))
+
        check.run_blocking (check_timeout, success_connect_cont, 
fail_connect_cont)
 
-# 
+#
 # Test execution
-# 
+#
 
 
 def SigHandler(signum = None, frame = None):
-       global success  
+       global success
        global server
-       global client  
-       
+       global client
+
        print('Test was aborted!')
        if (None != server):
                server.stop ()
-       if (None != client):            
+       if (None != client):
                client.stop ()
        cleanup ()
        sys.exit(success)
@@ -172,68 +172,66 @@ def run ():
        global test
        global server
        global client
-       
+
        success = False
        server = None
-       client = None   
+       client = None
 
        for sig in signals:
                signal.signal(sig, SigHandler)
-       
-       
+
+
        test = Test ('test_integration_disconnect', verbose)
        cleanup ()
        server = Peer(test, './confs/c_bootstrap_server.conf');
        server.start();
-       
+
        client = Peer(test, './confs/c_no_nat_client.conf');
        client.start();
-       
+
 
        if (True != server.start()):
                print('Failed to start server')
                if (None != server):
                        server.stop ()
-               if (None != server):            
+               if (None != server):
                        client.stop ()
                cleanup ()
                sys.exit(success)
-               
+
        # Give the server time to start
        time.sleep(5)
-                       
+
        if (True != client.start()):
                print('Failed to start client')
                if (None != server):
                        server.stop ()
-               if (None != server):            
+               if (None != server):
                        client.stop ()
                cleanup ()
                sys.exit(success)
-       
+
        check_connect ()
-       
-       server.stop ()    
+
+       server.stop ()
        client.stop ()
        cleanup ()
-       
+
        if (success == False):
                print ('Test failed')
                return True
        else:
                return False
 
-       
+
 try:
     run ()
-except (KeyboardInterrupt, SystemExit):    
+except (KeyboardInterrupt, SystemExit):
     print('Test interrupted')
     server.stop ()
     client.stop ()
     cleanup ()
 if (success == False):
-       sys.exit(1)   
+       sys.exit(1)
 else:
-       sys.exit(0)    
-
-       
+       sys.exit(0)
diff --git a/src/integration-tests/test_integration_reconnect_nat.py.in 
b/src/integration-tests/test_integration_reconnect_nat.py.in
index 5b3f34d02..61d2ea966 100755
--- a/src/integration-tests/test_integration_reconnect_nat.py.in
+++ b/src/integration-tests/test_integration_reconnect_nat.py.in
@@ -11,7 +11,7 @@
 #    WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 #    Affero General Public License for more details.
-#   
+#
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
diff --git a/src/namestore/test_plugin_namestore.c 
b/src/namestore/test_plugin_namestore.c
index 30778ed69..9c978749f 100644
--- a/src/namestore/test_plugin_namestore.c
+++ b/src/namestore/test_plugin_namestore.c
@@ -107,7 +107,8 @@ test_record (void *cls,
   GNUNET_snprintf (tname,
                    sizeof (tname),
                   "a%u",
-                   (unsigned int ) id);
+                   (unsigned int) id);
+  GNUNET_assert (trd_count == rd_count);
   for (unsigned int i=0;i<trd_count;i++)
   {
     GNUNET_assert (rd[i].data_size == id % 10);
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index f2af27c0b..4b56b34c7 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -11,7 +11,7 @@
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -565,10 +565,7 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
   struct GNUNET_PeerIdentity peer;
 
   if (NULL == h->mq)
-  {
-    GNUNET_break (0);
     return NULL;
-  }
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_HELLO_get_id (hello,
                                       &peer));
diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
index b0f0a8a6b..336ca8c42 100644
--- a/src/pq/pq_result_helper.c
+++ b/src/pq/pq_result_helper.c
@@ -11,7 +11,7 @@
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Affero General Public License for more details.
- 
+
   You should have received a copy of the GNU Affero General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
diff --git a/src/sq/sq.c b/src/sq/sq.c
index 36200aa26..e74071b81 100644
--- a/src/sq/sq.c
+++ b/src/sq/sq.c
@@ -11,7 +11,7 @@
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Affero General Public License for more details.
- 
+
   You should have received a copy of the GNU Affero General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
diff --git a/src/transport/transport_api_core.c 
b/src/transport/transport_api_core.c
index b144ef6b6..75287b5e7 100644
--- a/src/transport/transport_api_core.c
+++ b/src/transport/transport_api_core.c
@@ -558,7 +558,7 @@ handle_connect (void *cls,
                       &cim->id);
   if (NULL != n)
   {
-    GNUNET_break (0);
+    GNUNET_break (0); /* FIXME: this assertion seems to fail sometimes!? */
     disconnect_and_schedule_reconnect (h);
     return;
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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