diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-15 12:46:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-15 12:46:12 +0000 |
commit | d9e8e70828e22f1a7f43825e460d5817d9e6e21b (patch) | |
tree | 47946135c00dc13eeea53cfd43e1ffaddb38cb36 | |
parent | f28a2f4ecd4764362b120862e188c6893453ed2b (diff) | |
download | gnunet-d9e8e70828e22f1a7f43825e460d5817d9e6e21b.tar.gz gnunet-d9e8e70828e22f1a7f43825e460d5817d9e6e21b.zip |
-fix testcase, reintroduce timeout
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo.c | 9 | ||||
-rwxr-xr-x | src/peerinfo-tool/test_gnunet_peerinfo.py.in | 8 |
2 files changed, 11 insertions, 6 deletions
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 | |||
@@ -39,6 +39,11 @@ | |||
39 | #define HELLO_URI_PREFIX "gnunet://hello/" | 39 | #define HELLO_URI_PREFIX "gnunet://hello/" |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * How long until we time out during peerinfo iterations? | ||
43 | */ | ||
44 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) | ||
45 | |||
46 | /** | ||
42 | * Structure we use to collect printable address information. | 47 | * Structure we use to collect printable address information. |
43 | */ | 48 | */ |
44 | struct PrintContext; | 49 | struct PrintContext; |
@@ -783,7 +788,7 @@ state_machine (void *cls, | |||
783 | get_info = GNUNET_NO; | 788 | get_info = GNUNET_NO; |
784 | GPI_plugins_load (cfg); | 789 | GPI_plugins_load (cfg); |
785 | pic = GNUNET_PEERINFO_iterate (peerinfo, NULL, | 790 | pic = GNUNET_PEERINFO_iterate (peerinfo, NULL, |
786 | GNUNET_TIME_UNIT_FOREVER_REL, | 791 | TIMEOUT, |
787 | &print_peer_info, NULL); | 792 | &print_peer_info, NULL); |
788 | return; | 793 | return; |
789 | } | 794 | } |
@@ -812,7 +817,7 @@ state_machine (void *cls, | |||
812 | GNUNET_free (pkey); | 817 | GNUNET_free (pkey); |
813 | GPI_plugins_load (cfg); | 818 | GPI_plugins_load (cfg); |
814 | pic = GNUNET_PEERINFO_iterate (peerinfo, &my_peer_identity, | 819 | pic = GNUNET_PEERINFO_iterate (peerinfo, &my_peer_identity, |
815 | GNUNET_TIME_UNIT_FOREVER_REL, | 820 | TIMEOUT, |
816 | &print_my_uri, guc); | 821 | &print_my_uri, guc); |
817 | get_uri = GNUNET_NO; | 822 | get_uri = GNUNET_NO; |
818 | return; | 823 | 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': | |||
42 | 42 | ||
43 | 43 | ||
44 | pinfo = pexpect () | 44 | pinfo = pexpect () |
45 | pinfo.spawn (None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 45 | pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
46 | pinfo.expect ("stdout", re.compile (r'Error in communication with PEERINFO service\r?\n')) | 46 | pinfo.expect ("stdout", re.compile (r'Error in communication with PEERINFO service: Failed to transmit iteration request to `PEERINFO\' service\r?\n')) |
47 | pinfo.expect ("stdout", "EOF") | 47 | pinfo.expect ("stdout", "EOF") |
48 | 48 | ||
49 | if os.name == "nt": | 49 | if os.name == "nt": |
@@ -67,13 +67,13 @@ try: | |||
67 | arm.communicate () | 67 | arm.communicate () |
68 | time.sleep (1) | 68 | time.sleep (1) |
69 | 69 | ||
70 | pinfo.spawn (None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 70 | pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
71 | pinfo.expect ("stdout", re.compile ("Peer `.*'\r?\n")) | 71 | pinfo.expect ("stdout", re.compile ("Peer `.*'\r?\n")) |
72 | m = pinfo.expect ("stdout", re.compile ("\s.*:24357\r?\n")) | 72 | m = pinfo.expect ("stdout", re.compile ("\s.*:24357\r?\n")) |
73 | while len (m.group (0)) > 0: | 73 | while len (m.group (0)) > 0: |
74 | m = pinfo.expect ("stdout", re.compile ("(\s.*:24357\r?\n|\r?\n|)")) | 74 | m = pinfo.expect ("stdout", re.compile ("(\s.*:24357\r?\n|\r?\n|)")) |
75 | 75 | ||
76 | pinfo.spawn (None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-n'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 76 | pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-n'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
77 | pinfo.expect ("stdout", re.compile ("Peer `.*'\r?\n")) | 77 | pinfo.expect ("stdout", re.compile ("Peer `.*'\r?\n")) |
78 | m = pinfo.expect ("stdout", re.compile ("\s.*:24357\r?\n")) | 78 | m = pinfo.expect ("stdout", re.compile ("\s.*:24357\r?\n")) |
79 | while len (m.group (0)) > 0: | 79 | while len (m.group (0)) > 0: |