From: Christian Grothoff Date: Thu, 15 Mar 2012 12:46:12 +0000 (+0000) Subject: -fix testcase, reintroduce timeout X-Git-Tag: initial-import-from-subversion-38251~14247 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d9e8e70828e22f1a7f43825e460d5817d9e6e21b;p=oweals%2Fgnunet.git -fix testcase, reintroduce timeout --- diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 03b628dcb..ed4fd5193 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -38,6 +38,11 @@ */ #define HELLO_URI_PREFIX "gnunet://hello/" +/** + * How long until we time out during peerinfo iterations? + */ +#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) + /** * Structure we use to collect printable address information. */ @@ -783,7 +788,7 @@ state_machine (void *cls, get_info = GNUNET_NO; GPI_plugins_load (cfg); pic = GNUNET_PEERINFO_iterate (peerinfo, NULL, - GNUNET_TIME_UNIT_FOREVER_REL, + TIMEOUT, &print_peer_info, NULL); return; } @@ -812,7 +817,7 @@ state_machine (void *cls, GNUNET_free (pkey); GPI_plugins_load (cfg); pic = GNUNET_PEERINFO_iterate (peerinfo, &my_peer_identity, - GNUNET_TIME_UNIT_FOREVER_REL, + TIMEOUT, &print_my_uri, guc); get_uri = GNUNET_NO; return; diff --git a/src/peerinfo-tool/test_gnunet_peerinfo.py.in b/src/peerinfo-tool/test_gnunet_peerinfo.py.in index ee8bc4af6..8a954641a 100755 --- a/src/peerinfo-tool/test_gnunet_peerinfo.py.in +++ b/src/peerinfo-tool/test_gnunet_peerinfo.py.in @@ -42,8 +42,8 @@ elif os.name == 'nt': pinfo = pexpect () -pinfo.spawn (None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) -pinfo.expect ("stdout", re.compile (r'Error in communication with PEERINFO service\r?\n')) +pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) +pinfo.expect ("stdout", re.compile (r'Error in communication with PEERINFO service: Failed to transmit iteration request to `PEERINFO\' service\r?\n')) pinfo.expect ("stdout", "EOF") if os.name == "nt": @@ -67,13 +67,13 @@ try: arm.communicate () time.sleep (1) - pinfo.spawn (None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) pinfo.expect ("stdout", re.compile ("Peer `.*'\r?\n")) m = pinfo.expect ("stdout", re.compile ("\s.*:24357\r?\n")) while len (m.group (0)) > 0: m = pinfo.expect ("stdout", re.compile ("(\s.*:24357\r?\n|\r?\n|)")) - pinfo.spawn (None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-n'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-n'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) pinfo.expect ("stdout", re.compile ("Peer `.*'\r?\n")) m = pinfo.expect ("stdout", re.compile ("\s.*:24357\r?\n")) while len (m.group (0)) > 0: