diff options
Diffstat (limited to 'src')
56 files changed, 869 insertions, 587 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 51bf2d63d..09d176100 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -12,9 +12,7 @@ endif | |||
12 | if HAVE_EXPERIMENTAL | 12 | if HAVE_EXPERIMENTAL |
13 | EXP_DIR = \ | 13 | EXP_DIR = \ |
14 | rps \ | 14 | rps \ |
15 | abd \ | 15 | abd |
16 | reclaim-attribute \ | ||
17 | reclaim | ||
18 | if HAVE_ABE | 16 | if HAVE_ABE |
19 | EXP_DIR += \ | 17 | EXP_DIR += \ |
20 | abe | 18 | abe |
@@ -59,6 +57,9 @@ endif | |||
59 | if HAVE_MHD | 57 | if HAVE_MHD |
60 | if HAVE_JSON | 58 | if HAVE_JSON |
61 | REST_DIR = rest | 59 | REST_DIR = rest |
60 | RECLAIM_DIR = \ | ||
61 | reclaim-attribute \ | ||
62 | reclaim | ||
62 | endif | 63 | endif |
63 | endif | 64 | endif |
64 | 65 | ||
@@ -121,6 +122,7 @@ SUBDIRS = \ | |||
121 | exit \ | 122 | exit \ |
122 | pt \ | 123 | pt \ |
123 | secretsharing \ | 124 | secretsharing \ |
125 | $(RECLAIM_DIR) \ | ||
124 | $(EXP_DIR) \ | 126 | $(EXP_DIR) \ |
125 | integration-tests | 127 | integration-tests |
126 | 128 | ||
diff --git a/src/arm/Makefile.am b/src/arm/Makefile.am index 28440d857..422084bfe 100644 --- a/src/arm/Makefile.am +++ b/src/arm/Makefile.am | |||
@@ -21,7 +21,7 @@ libgnunetarm_la_LIBADD = \ | |||
21 | $(top_builddir)/src/util/libgnunetutil.la \ | 21 | $(top_builddir)/src/util/libgnunetutil.la \ |
22 | $(GN_LIBINTL) $(XLIB) | 22 | $(GN_LIBINTL) $(XLIB) |
23 | libgnunetarm_la_LDFLAGS = \ | 23 | libgnunetarm_la_LDFLAGS = \ |
24 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 24 | $(GN_LIB_LDFLAGS) \ |
25 | -version-info 2:0:0 | 25 | -version-info 2:0:0 |
26 | 26 | ||
27 | 27 | ||
diff --git a/src/arm/test_gnunet_arm.py.in b/src/arm/test_gnunet_arm.py.in index 1d067b5d9..9605c4eae 100644 --- a/src/arm/test_gnunet_arm.py.in +++ b/src/arm/test_gnunet_arm.py.in | |||
@@ -56,25 +56,41 @@ def fail(result): | |||
56 | def end_arm_failer(command, rc, stdo, stde, normal): | 56 | def end_arm_failer(command, rc, stdo, stde, normal): |
57 | if normal: | 57 | if normal: |
58 | if rc != 0: | 58 | if rc != 0: |
59 | fail("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 59 | fail( |
60 | "FAIL: error running {}\nCommand output was:\n{}\n{}".format( | ||
61 | command, stdo, stde | ||
62 | ) | ||
63 | ) | ||
60 | else: | 64 | else: |
61 | if rc == 0: | 65 | if rc == 0: |
62 | fail("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 66 | fail( |
67 | "FAIL: expected error while running {}\nCommand output was:\n{}\n{}" | ||
68 | .format(command, stdo, stde) | ||
69 | ) | ||
63 | 70 | ||
64 | 71 | ||
65 | def print_only_failer(command, rc, stdo, stde, normal): | 72 | def print_only_failer(command, rc, stdo, stde, normal): |
66 | if normal: | 73 | if normal: |
67 | if rc != 0: | 74 | if rc != 0: |
68 | print("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 75 | print( |
76 | "FAIL: error running {}\nCommand output was:\n{}\n{}".format( | ||
77 | command, stdo, stde | ||
78 | ) | ||
79 | ) | ||
69 | sys.exit(1) | 80 | sys.exit(1) |
70 | else: | 81 | else: |
71 | if rc == 0: | 82 | if rc == 0: |
72 | print("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 83 | print( |
84 | "FAIL: expected error while running {}\nCommand output was:\n{}\n{}" | ||
85 | .format(command, stdo, stde) | ||
86 | ) | ||
73 | sys.exit(1) | 87 | sys.exit(1) |
74 | 88 | ||
75 | 89 | ||
76 | def r_something(to_run, extra_args, failer=None, normal=True, **kw): | 90 | def r_something(to_run, extra_args, failer=None, normal=True, **kw): |
77 | rc, stdo, stde = sub_run(to_run + extra_args, nofail=True, want_stde=True, **kw) | 91 | rc, stdo, stde = sub_run( |
92 | to_run + extra_args, nofail=True, want_stde=True, **kw | ||
93 | ) | ||
78 | if failer is not None: | 94 | if failer is not None: |
79 | failer(to_run + extra_args, rc, stdo, stde, normal) | 95 | failer(to_run + extra_args, rc, stdo, stde, normal) |
80 | return (rc, stdo, stde) | 96 | return (rc, stdo, stde) |
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am index bd8962158..0b8e7309a 100644 --- a/src/ats/Makefile.am +++ b/src/ats/Makefile.am | |||
@@ -30,7 +30,7 @@ libgnunetats_la_LIBADD = \ | |||
30 | $(top_builddir)/src/util/libgnunetutil.la \ | 30 | $(top_builddir)/src/util/libgnunetutil.la \ |
31 | $(LTLIBINTL) | 31 | $(LTLIBINTL) |
32 | libgnunetats_la_LDFLAGS = \ | 32 | libgnunetats_la_LDFLAGS = \ |
33 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 33 | $(GN_LIB_LDFLAGS) \ |
34 | -version-info 4:0:0 | 34 | -version-info 4:0:0 |
35 | 35 | ||
36 | libgnunet_plugin_ats_proportional_la_SOURCES = \ | 36 | libgnunet_plugin_ats_proportional_la_SOURCES = \ |
diff --git a/src/cadet/Makefile.am b/src/cadet/Makefile.am index cd4beb4b7..b6e72688d 100644 --- a/src/cadet/Makefile.am +++ b/src/cadet/Makefile.am | |||
@@ -40,7 +40,7 @@ libgnunetcadet_la_LIBADD = \ | |||
40 | $(XLIB) \ | 40 | $(XLIB) \ |
41 | $(LTLIBINTL) | 41 | $(LTLIBINTL) |
42 | libgnunetcadet_la_LDFLAGS = \ | 42 | libgnunetcadet_la_LDFLAGS = \ |
43 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 43 | $(GN_LIB_LDFLAGS) \ |
44 | -version-info 7:0:0 | 44 | -version-info 7:0:0 |
45 | 45 | ||
46 | gnunet_cadet_SOURCES = \ | 46 | gnunet_cadet_SOURCES = \ |
diff --git a/src/consensus/consensus-simulation.py.in b/src/consensus/consensus-simulation.py.in index 39daf81c6..c6b97e63f 100644 --- a/src/consensus/consensus-simulation.py.in +++ b/src/consensus/consensus-simulation.py.in | |||
@@ -46,9 +46,10 @@ def simulate(k, n, verbose): | |||
46 | 46 | ||
47 | def done_p(): | 47 | def done_p(): |
48 | for x in range(k, n): | 48 | for x in range(k, n): |
49 | if bsc(info[x]) < n-k: | 49 | if bsc(info[x]) < n - k: |
50 | return False | 50 | return False |
51 | return True | 51 | return True |
52 | |||
52 | rounds = 0 | 53 | rounds = 0 |
53 | while not done_p(): | 54 | while not done_p(): |
54 | if verbose: | 55 | if verbose: |
@@ -65,7 +66,10 @@ def simulate(k, n, verbose): | |||
65 | partner_physical = peers.index(partner_logical) | 66 | partner_physical = peers.index(partner_logical) |
66 | if peer_physical < k or partner_physical < k: | 67 | if peer_physical < k or partner_physical < k: |
67 | if verbose: | 68 | if verbose: |
68 | print("bad peer in connection", peer_physical, "--", partner_physical) | 69 | print( |
70 | "bad peer in connection", peer_physical, "--", | ||
71 | partner_physical | ||
72 | ) | ||
69 | continue | 73 | continue |
70 | if peer_logical & arc == 0: | 74 | if peer_logical & arc == 0: |
71 | # we are outgoing | 75 | # we are outgoing |
@@ -78,8 +82,11 @@ def simulate(k, n, verbose): | |||
78 | ghost_partner_logical = (peer_logical - arc) % n | 82 | ghost_partner_logical = (peer_logical - arc) % n |
79 | if ghost_partner_logical & arc == 0: | 83 | if ghost_partner_logical & arc == 0: |
80 | peer_type = peer_type + ", ghost incoming" | 84 | peer_type = peer_type + ", ghost incoming" |
81 | new_info[peer_physical] = new_info[peer_physical] | info[peer_physical] | info[partner_physical] | 85 | new_info[peer_physical] = new_info[peer_physical] | info[ |
82 | new_info[partner_physical] = new_info[partner_physical] | info[peer_physical] | info[partner_physical] | 86 | peer_physical] | info[partner_physical] |
87 | new_info[partner_physical | ||
88 | ] = new_info[partner_physical] | info[ | ||
89 | peer_physical] | info[partner_physical] | ||
83 | else: | 90 | else: |
84 | peer_type = "incoming" | 91 | peer_type = "incoming" |
85 | if verbose > 1: | 92 | if verbose > 1: |
diff --git a/src/conversation/Makefile.am b/src/conversation/Makefile.am index dc8283e9b..7645b7973 100644 --- a/src/conversation/Makefile.am +++ b/src/conversation/Makefile.am | |||
@@ -52,7 +52,7 @@ libgnunetmicrophone_la_SOURCES = \ | |||
52 | libgnunetmicrophone_la_LIBADD = \ | 52 | libgnunetmicrophone_la_LIBADD = \ |
53 | $(top_builddir)/src/util/libgnunetutil.la | 53 | $(top_builddir)/src/util/libgnunetutil.la |
54 | libgnunetmicrophone_la_LDFLAGS = \ | 54 | libgnunetmicrophone_la_LDFLAGS = \ |
55 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 55 | $(GN_LIB_LDFLAGS) \ |
56 | -version-info 0:0:0 | 56 | -version-info 0:0:0 |
57 | 57 | ||
58 | libgnunetspeaker_la_SOURCES = \ | 58 | libgnunetspeaker_la_SOURCES = \ |
@@ -60,7 +60,7 @@ libgnunetspeaker_la_SOURCES = \ | |||
60 | libgnunetspeaker_la_LIBADD = \ | 60 | libgnunetspeaker_la_LIBADD = \ |
61 | $(top_builddir)/src/util/libgnunetutil.la | 61 | $(top_builddir)/src/util/libgnunetutil.la |
62 | libgnunetspeaker_la_LDFLAGS = \ | 62 | libgnunetspeaker_la_LDFLAGS = \ |
63 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 63 | $(GN_LIB_LDFLAGS) \ |
64 | -version-info 0:0:0 | 64 | -version-info 0:0:0 |
65 | 65 | ||
66 | 66 | ||
@@ -76,7 +76,7 @@ libgnunetconversation_la_LIBADD = \ | |||
76 | $(top_builddir)/src/util/libgnunetutil.la | 76 | $(top_builddir)/src/util/libgnunetutil.la |
77 | 77 | ||
78 | libgnunetconversation_la_LDFLAGS = \ | 78 | libgnunetconversation_la_LDFLAGS = \ |
79 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 79 | $(GN_LIB_LDFLAGS) \ |
80 | -version-info 0:0:0 | 80 | -version-info 0:0:0 |
81 | 81 | ||
82 | 82 | ||
@@ -116,8 +116,8 @@ gnunet_helper_audio_record_LDADD = \ | |||
116 | $(top_builddir)/src/util/libgnunetutil.la \ | 116 | $(top_builddir)/src/util/libgnunetutil.la \ |
117 | -lpulse -lopus -logg \ | 117 | -lpulse -lopus -logg \ |
118 | $(INTLLIBS) | 118 | $(INTLLIBS) |
119 | gnunet_helper_audio_record_LDFLAGS = \ | 119 | #gnunet_helper_audio_record_LDFLAGS = \ |
120 | $(WINFLAGS) | 120 | # |
121 | 121 | ||
122 | gnunet_helper_audio_playback_SOURCES = \ | 122 | gnunet_helper_audio_playback_SOURCES = \ |
123 | gnunet-helper-audio-playback.c | 123 | gnunet-helper-audio-playback.c |
@@ -125,8 +125,8 @@ gnunet_helper_audio_playback_LDADD = \ | |||
125 | $(top_builddir)/src/util/libgnunetutil.la \ | 125 | $(top_builddir)/src/util/libgnunetutil.la \ |
126 | -lpulse -lopus -logg \ | 126 | -lpulse -lopus -logg \ |
127 | $(INTLLIBS) | 127 | $(INTLLIBS) |
128 | gnunet_helper_audio_playback_LDFLAGS = \ | 128 | #gnunet_helper_audio_playback_LDFLAGS = \ |
129 | $(WINFLAGS) | 129 | # |
130 | else | 130 | else |
131 | if BUILD_GST_HELPERS | 131 | if BUILD_GST_HELPERS |
132 | gnunet_helper_audio_record_SOURCES = \ | 132 | gnunet_helper_audio_record_SOURCES = \ |
@@ -136,7 +136,7 @@ gnunet_helper_audio_record_LDADD = \ | |||
136 | $(GST_LIBS) \ | 136 | $(GST_LIBS) \ |
137 | $(INTLLIBS) | 137 | $(INTLLIBS) |
138 | gnunet_helper_audio_record_LDFLAGS = \ | 138 | gnunet_helper_audio_record_LDFLAGS = \ |
139 | $(WINFLAGS) $(GST_LDFLAGS) | 139 | $(GST_LDFLAGS) |
140 | gnunet_helper_audio_record_CFLAGS = \ | 140 | gnunet_helper_audio_record_CFLAGS = \ |
141 | $(GST_CFLAGS) | 141 | $(GST_CFLAGS) |
142 | 142 | ||
@@ -147,7 +147,7 @@ gnunet_helper_audio_playback_LDADD = \ | |||
147 | $(GST_LIBS) \ | 147 | $(GST_LIBS) \ |
148 | $(INTLLIBS) | 148 | $(INTLLIBS) |
149 | gnunet_helper_audio_playback_LDFLAGS = \ | 149 | gnunet_helper_audio_playback_LDFLAGS = \ |
150 | $(WINFLAGS) $(GST_LDFLAGS) | 150 | $(GST_LDFLAGS) |
151 | gnunet_helper_audio_playback_CFLAGS = \ | 151 | gnunet_helper_audio_playback_CFLAGS = \ |
152 | $(GST_CFLAGS) -DIS_SPEAKER | 152 | $(GST_CFLAGS) -DIS_SPEAKER |
153 | else | 153 | else |
@@ -159,7 +159,7 @@ gnunet_helper_audio_record_LDADD = \ | |||
159 | $(GST_LIBS) \ | 159 | $(GST_LIBS) \ |
160 | $(INTLLIBS) | 160 | $(INTLLIBS) |
161 | gnunet_helper_audio_record_LDFLAGS = \ | 161 | gnunet_helper_audio_record_LDFLAGS = \ |
162 | $(WINFLAGS) $(GST_LDFLAGS) | 162 | $(GST_LDFLAGS) |
163 | gnunet_helper_audio_record_CFLAGS = \ | 163 | gnunet_helper_audio_record_CFLAGS = \ |
164 | $(GST_CFLAGS) -DIS_MIC | 164 | $(GST_CFLAGS) -DIS_MIC |
165 | 165 | ||
@@ -170,7 +170,7 @@ gnunet_helper_audio_playback_LDADD = \ | |||
170 | $(GST_LIBS) \ | 170 | $(GST_LIBS) \ |
171 | $(INTLLIBS) | 171 | $(INTLLIBS) |
172 | gnunet_helper_audio_playback_LDFLAGS = \ | 172 | gnunet_helper_audio_playback_LDFLAGS = \ |
173 | $(WINFLAGS) $(GST_LDFLAGS) | 173 | $(GST_LDFLAGS) |
174 | gnunet_helper_audio_playback_CFLAGS = \ | 174 | gnunet_helper_audio_playback_CFLAGS = \ |
175 | $(GST_CFLAGS) -DIS_SPEAKER | 175 | $(GST_CFLAGS) -DIS_SPEAKER |
176 | endif | 176 | endif |
@@ -186,8 +186,8 @@ gnunet_service_conversation_LDADD = \ | |||
186 | $(top_builddir)/src/cadet/libgnunetcadet.la \ | 186 | $(top_builddir)/src/cadet/libgnunetcadet.la \ |
187 | $(top_builddir)/src/util/libgnunetutil.la \ | 187 | $(top_builddir)/src/util/libgnunetutil.la \ |
188 | $(INTLLIBS) | 188 | $(INTLLIBS) |
189 | gnunet_service_conversation_LDFLAGS = \ | 189 | #gnunet_service_conversation_LDFLAGS = \ |
190 | $(WINFLAGS) | 190 | # |
191 | 191 | ||
192 | gnunet_conversation_SOURCES = \ | 192 | gnunet_conversation_SOURCES = \ |
193 | gnunet-conversation.c | 193 | gnunet-conversation.c |
@@ -201,8 +201,8 @@ gnunet_conversation_LDADD = \ | |||
201 | $(top_builddir)/src/identity/libgnunetidentity.la \ | 201 | $(top_builddir)/src/identity/libgnunetidentity.la \ |
202 | $(top_builddir)/src/util/libgnunetutil.la \ | 202 | $(top_builddir)/src/util/libgnunetutil.la \ |
203 | $(INTLLIBS) | 203 | $(INTLLIBS) |
204 | gnunet_conversation_LDFLAGS = \ | 204 | #gnunet_conversation_LDFLAGS = \ |
205 | $(WINFLAGS) | 205 | # |
206 | 206 | ||
207 | gnunet_conversation_test_SOURCES = \ | 207 | gnunet_conversation_test_SOURCES = \ |
208 | gnunet-conversation-test.c | 208 | gnunet-conversation-test.c |
@@ -211,8 +211,8 @@ gnunet_conversation_test_LDADD = \ | |||
211 | libgnunetspeaker.la \ | 211 | libgnunetspeaker.la \ |
212 | $(top_builddir)/src/util/libgnunetutil.la \ | 212 | $(top_builddir)/src/util/libgnunetutil.la \ |
213 | $(INTLLIBS) | 213 | $(INTLLIBS) |
214 | gnunet_conversation_test_LDFLAGS = \ | 214 | #gnunet_conversation_test_LDFLAGS = \ |
215 | $(WINFLAGS) | 215 | # |
216 | 216 | ||
217 | 217 | ||
218 | test_conversation_api_SOURCES = \ | 218 | test_conversation_api_SOURCES = \ |
@@ -227,7 +227,7 @@ test_conversation_api_LDADD = \ | |||
227 | $(top_builddir)/src/testing/libgnunettesting.la \ | 227 | $(top_builddir)/src/testing/libgnunettesting.la \ |
228 | $(top_builddir)/src/util/libgnunetutil.la | 228 | $(top_builddir)/src/util/libgnunetutil.la |
229 | test_conversation_api_LDFLAGS = \ | 229 | test_conversation_api_LDFLAGS = \ |
230 | $(WINFLAGS) -export-dynamic | 230 | -export-dynamic |
231 | 231 | ||
232 | test_conversation_api_twocalls_SOURCES = \ | 232 | test_conversation_api_twocalls_SOURCES = \ |
233 | test_conversation_api_twocalls.c | 233 | test_conversation_api_twocalls.c |
@@ -241,7 +241,7 @@ test_conversation_api_twocalls_LDADD = \ | |||
241 | $(top_builddir)/src/testing/libgnunettesting.la \ | 241 | $(top_builddir)/src/testing/libgnunettesting.la \ |
242 | $(top_builddir)/src/util/libgnunetutil.la | 242 | $(top_builddir)/src/util/libgnunetutil.la |
243 | test_conversation_api_twocalls_LDFLAGS = \ | 243 | test_conversation_api_twocalls_LDFLAGS = \ |
244 | $(WINFLAGS) -export-dynamic | 244 | -export-dynamic |
245 | 245 | ||
246 | test_conversation_api_reject_SOURCES = \ | 246 | test_conversation_api_reject_SOURCES = \ |
247 | test_conversation_api_reject.c | 247 | test_conversation_api_reject.c |
@@ -255,7 +255,7 @@ test_conversation_api_reject_LDADD = \ | |||
255 | $(top_builddir)/src/testing/libgnunettesting.la \ | 255 | $(top_builddir)/src/testing/libgnunettesting.la \ |
256 | $(top_builddir)/src/util/libgnunetutil.la | 256 | $(top_builddir)/src/util/libgnunetutil.la |
257 | test_conversation_api_reject_LDFLAGS = \ | 257 | test_conversation_api_reject_LDFLAGS = \ |
258 | $(WINFLAGS) -export-dynamic | 258 | -export-dynamic |
259 | 259 | ||
260 | 260 | ||
261 | 261 | ||
diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 902be3599..80bdca812 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am | |||
@@ -24,7 +24,7 @@ libgnunetcore_la_LIBADD = \ | |||
24 | $(top_builddir)/src/util/libgnunetutil.la \ | 24 | $(top_builddir)/src/util/libgnunetutil.la \ |
25 | $(GN_LIBINTL) $(XLIB) | 25 | $(GN_LIBINTL) $(XLIB) |
26 | libgnunetcore_la_LDFLAGS = \ | 26 | libgnunetcore_la_LDFLAGS = \ |
27 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 27 | $(GN_LIB_LDFLAGS) \ |
28 | -version-info 0:1:0 | 28 | -version-info 0:1:0 |
29 | 29 | ||
30 | 30 | ||
diff --git a/src/datacache/Makefile.am b/src/datacache/Makefile.am index 9fc00bace..ecb02d1c3 100644 --- a/src/datacache/Makefile.am +++ b/src/datacache/Makefile.am | |||
@@ -30,7 +30,7 @@ libgnunetdatacache_la_LIBADD = \ | |||
30 | $(top_builddir)/src/util/libgnunetutil.la \ | 30 | $(top_builddir)/src/util/libgnunetutil.la \ |
31 | $(GN_LIBINTL) | 31 | $(GN_LIBINTL) |
32 | libgnunetdatacache_la_LDFLAGS = \ | 32 | libgnunetdatacache_la_LDFLAGS = \ |
33 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 33 | $(GN_LIB_LDFLAGS) \ |
34 | -version-info 0:1:0 | 34 | -version-info 0:1:0 |
35 | 35 | ||
36 | 36 | ||
diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am index ba65143af..cd1df4e5e 100644 --- a/src/datastore/Makefile.am +++ b/src/datastore/Makefile.am | |||
@@ -26,7 +26,7 @@ libgnunetdatastore_la_LIBADD = \ | |||
26 | $(top_builddir)/src/util/libgnunetutil.la \ | 26 | $(top_builddir)/src/util/libgnunetutil.la \ |
27 | $(GN_LIBINTL) | 27 | $(GN_LIBINTL) |
28 | libgnunetdatastore_la_LDFLAGS = \ | 28 | libgnunetdatastore_la_LDFLAGS = \ |
29 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 29 | $(GN_LIB_LDFLAGS) \ |
30 | -version-info 1:0:0 | 30 | -version-info 1:0:0 |
31 | 31 | ||
32 | bin_PROGRAMS = \ | 32 | bin_PROGRAMS = \ |
diff --git a/src/dht/Makefile.am b/src/dht/Makefile.am index 82d76f33c..0b2bc0946 100644 --- a/src/dht/Makefile.am +++ b/src/dht/Makefile.am | |||
@@ -25,7 +25,7 @@ libgnunetdht_la_LIBADD = \ | |||
25 | $(XLIB) \ | 25 | $(XLIB) \ |
26 | $(LTLIBINTL) | 26 | $(LTLIBINTL) |
27 | libgnunetdht_la_LDFLAGS = \ | 27 | libgnunetdht_la_LDFLAGS = \ |
28 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 28 | $(GN_LIB_LDFLAGS) \ |
29 | -version-info 3:0:0 | 29 | -version-info 3:0:0 |
30 | 30 | ||
31 | 31 | ||
diff --git a/src/dht/test_dht_tools.py.in b/src/dht/test_dht_tools.py.in index 2d9379a42..c2f95e4b5 100644 --- a/src/dht/test_dht_tools.py.in +++ b/src/dht/test_dht_tools.py.in | |||
@@ -94,20 +94,34 @@ def r_put(extra_args, **kw): | |||
94 | def end_arm_failer(command, rc, stdo, stde, normal): | 94 | def end_arm_failer(command, rc, stdo, stde, normal): |
95 | if normal: | 95 | if normal: |
96 | if rc != 0: | 96 | if rc != 0: |
97 | fail("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 97 | fail( |
98 | "FAIL: error running {}\nCommand output was:\n{}\n{}".format( | ||
99 | command, stdo, stde | ||
100 | ) | ||
101 | ) | ||
98 | else: | 102 | else: |
99 | if rc == 0: | 103 | if rc == 0: |
100 | fail("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 104 | fail( |
105 | "FAIL: expected error while running {}\nCommand output was:\n{}\n{}" | ||
106 | .format(command, stdo, stde) | ||
107 | ) | ||
101 | 108 | ||
102 | 109 | ||
103 | def print_only_failer(command, rc, stdo, stde, normal): | 110 | def print_only_failer(command, rc, stdo, stde, normal): |
104 | if normal: | 111 | if normal: |
105 | if rc != 0: | 112 | if rc != 0: |
106 | print("FAIL: error running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 113 | print( |
114 | "FAIL: error running {}\nCommand output was:\n{}\n{}".format( | ||
115 | command, stdo, stde | ||
116 | ) | ||
117 | ) | ||
107 | cleanup(1) | 118 | cleanup(1) |
108 | else: | 119 | else: |
109 | if rc == 0: | 120 | if rc == 0: |
110 | print("FAIL: expected error while running {}\nCommand output was:\n{}\n{}".format(command, stdo, stde)) | 121 | print( |
122 | "FAIL: expected error while running {}\nCommand output was:\n{}\n{}" | ||
123 | .format(command, stdo, stde) | ||
124 | ) | ||
111 | cleanup(1) | 125 | cleanup(1) |
112 | 126 | ||
113 | 127 | ||
@@ -122,10 +136,13 @@ print("PASS") | |||
122 | time.sleep(1) | 136 | time.sleep(1) |
123 | 137 | ||
124 | print("TEST: Testing get...", end='') | 138 | print("TEST: Testing get...", end='') |
125 | rc, stdo, stde = r_get(['-k', 'testkey', '-T', '50 ms', '-t', '8'], want_stdo=True, failer=end_arm_failer) | 139 | rc, stdo, stde = r_get(['-k', 'testkey', '-T', '50 ms', '-t', '8'], |
140 | want_stdo=True, | ||
141 | failer=end_arm_failer) | ||
126 | stdo = stdo.decode('utf-8').replace('\r', '').splitlines() | 142 | stdo = stdo.decode('utf-8').replace('\r', '').splitlines() |
127 | expect = "Result 0, type 8:\ntestdata".splitlines() | 143 | expect = "Result 0, type 8:\ntestdata".splitlines() |
128 | if len(stdo) != 2 or len(expect) != 2 or stdo[0] != expect[0] or stdo[1] != expect[1]: | 144 | if len(stdo) != 2 or len(expect |
145 | ) != 2 or stdo[0] != expect[0] or stdo[1] != expect[1]: | ||
129 | fail("output `{}' differs from expected `{}'".format(stdo, expect)) | 146 | fail("output `{}' differs from expected `{}'".format(stdo, expect)) |
130 | print("PASS") | 147 | print("PASS") |
131 | 148 | ||
diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am index 33ec8ef85..d2598bd8a 100644 --- a/src/dns/Makefile.am +++ b/src/dns/Makefile.am | |||
@@ -16,10 +16,6 @@ pkgcfg_DATA = \ | |||
16 | 16 | ||
17 | if LINUX | 17 | if LINUX |
18 | HIJACKBIN = gnunet-helper-dns | 18 | HIJACKBIN = gnunet-helper-dns |
19 | install-exec-hook: | ||
20 | $(top_srcdir)/src/dns/install-dns-helper.sh $(DESTDIR)$(libexecdir) $(GNUNETDNS_GROUP) $(SUDO_BINARY) || true | ||
21 | else | ||
22 | install-exec-hook: | ||
23 | endif | 19 | endif |
24 | 20 | ||
25 | lib_LTLIBRARIES = \ | 21 | lib_LTLIBRARIES = \ |
diff --git a/src/dns/install-dns-helper.sh b/src/dns/install-dns-helper.sh deleted file mode 100755 index 14d5caa70..000000000 --- a/src/dns/install-dns-helper.sh +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # $1 - bindir | ||
3 | # $2 - gnunetdns group | ||
4 | # $3 - sudo binary (optional) | ||
5 | $3 chown root $1/gnunet-helper-dns | ||
6 | $3 chgrp $2 $1/gnunet-helper-dns | ||
7 | $3 chmod 4750 $1/gnunet-helper-dns | ||
8 | # In case user 'gnunet' does not exist, at least set the group | ||
9 | $3 chgrp $2 $1/gnunet-service-dns | ||
10 | # Usually we want both... | ||
11 | $3 chown gnunet:$2 $1/gnunet-service-dns | ||
12 | $3 chmod 2750 $1/gnunet-service-dns | ||
diff --git a/src/dns/test_gnunet_dns.sh b/src/dns/test_gnunet_dns.sh index 0fa338c9b..e0fcb711d 100755 --- a/src/dns/test_gnunet_dns.sh +++ b/src/dns/test_gnunet_dns.sh | |||
@@ -42,6 +42,12 @@ then | |||
42 | exit 77 | 42 | exit 77 |
43 | fi | 43 | fi |
44 | 44 | ||
45 | if test ! `id nobody`; | ||
46 | then | ||
47 | echo "This tests requires a user account 'nobody'. Skipping." | ||
48 | exit 77 | ||
49 | fi | ||
50 | |||
45 | export PATH=".:$PATH" | 51 | export PATH=".:$PATH" |
46 | gnunet-service-dns -c dns.conf & | 52 | gnunet-service-dns -c dns.conf & |
47 | gnunet-dns-redirector -c dns.conf -4 127.0.0.1 & | 53 | gnunet-dns-redirector -c dns.conf -4 127.0.0.1 & |
diff --git a/src/exit/Makefile.am b/src/exit/Makefile.am index b7286349d..c0323d0d6 100644 --- a/src/exit/Makefile.am +++ b/src/exit/Makefile.am | |||
@@ -16,10 +16,6 @@ dist_pkgcfg_DATA = \ | |||
16 | 16 | ||
17 | if LINUX | 17 | if LINUX |
18 | EXITBIN = gnunet-helper-exit | 18 | EXITBIN = gnunet-helper-exit |
19 | install-exec-hook: | ||
20 | $(top_srcdir)/src/exit/install-exit-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true | ||
21 | else | ||
22 | install-exec-hook: | ||
23 | endif | 19 | endif |
24 | 20 | ||
25 | 21 | ||
diff --git a/src/exit/install-exit-helper.sh b/src/exit/install-exit-helper.sh deleted file mode 100755 index d9ae14106..000000000 --- a/src/exit/install-exit-helper.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # $1 - bindir | ||
3 | # $2 - sudo binary (optional) | ||
4 | $2 chown root:root $1/gnunet-helper-exit || true | ||
5 | $2 chmod u+s $1/gnunet-helper-exit || true | ||
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 0840242ea..f0efefc4b 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am | |||
@@ -55,7 +55,7 @@ libgnunetfs_la_LIBADD += \ | |||
55 | endif | 55 | endif |
56 | 56 | ||
57 | libgnunetfs_la_LDFLAGS = \ | 57 | libgnunetfs_la_LDFLAGS = \ |
58 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 58 | $(GN_LIB_LDFLAGS) \ |
59 | -version-info 3:1:1 | 59 | -version-info 3:1:1 |
60 | 60 | ||
61 | 61 | ||
diff --git a/src/fs/test_gnunet_fs_idx.py.in b/src/fs/test_gnunet_fs_idx.py.in index 4798cf503..2c8c7e8ec 100755 --- a/src/fs/test_gnunet_fs_idx.py.in +++ b/src/fs/test_gnunet_fs_idx.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -43,7 +43,9 @@ elif os.name == 'nt': | |||
43 | unindex = './gnunet-unindex.exe' | 43 | unindex = './gnunet-unindex.exe' |
44 | 44 | ||
45 | if os.name == "nt": | 45 | if os.name == "nt": |
46 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-idx"), True) | 46 | shutil.rmtree( |
47 | os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-idx"), True | ||
48 | ) | ||
47 | else: | 49 | else: |
48 | shutil.rmtree("/tmp/gnunet-test-fs-py-idx", True) | 50 | shutil.rmtree("/tmp/gnunet-test-fs-py-idx", True) |
49 | 51 | ||
@@ -53,22 +55,59 @@ arm.communicate() | |||
53 | try: | 55 | try: |
54 | pub = pexpect() | 56 | pub = pexpect() |
55 | 57 | ||
56 | pub.spawn(None, [publish, '-c', 'test_gnunet_fs_idx_data.conf', '-m', "description:Test archive", '-k', 'tst', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 58 | pub.spawn( |
57 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822'\.\r?\n")) | 59 | None, [ |
60 | publish, '-c', 'test_gnunet_fs_idx_data.conf', '-m', | ||
61 | "description:Test archive", '-k', 'tst', | ||
62 | 'test_gnunet_fs_rec_data.tgz' | ||
63 | ], | ||
64 | stdout=subprocess.PIPE, | ||
65 | stderr=subprocess.STDOUT | ||
66 | ) | ||
67 | pub.expect( | ||
68 | "stdout", | ||
69 | re.compile( | ||
70 | r"URI is `gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822'\.\r?\n" | ||
71 | ) | ||
72 | ) | ||
58 | 73 | ||
59 | down = pexpect() | 74 | down = pexpect() |
60 | down.spawn(None, [download, '-c', 'test_gnunet_fs_idx_data.conf', '-o', 'test_gnunet_fs_rec_data.tar.gz', 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 75 | down.spawn( |
61 | down.expect("stdout", re.compile(r"Downloading `test_gnunet_fs_rec_data.tar.gz' done (.*).\r?\n")) | 76 | None, [ |
77 | download, '-c', 'test_gnunet_fs_idx_data.conf', '-o', | ||
78 | 'test_gnunet_fs_rec_data.tar.gz', | ||
79 | 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822' | ||
80 | ], | ||
81 | stdout=subprocess.PIPE, | ||
82 | stderr=subprocess.STDOUT | ||
83 | ) | ||
84 | down.expect( | ||
85 | "stdout", | ||
86 | re.compile( | ||
87 | r"Downloading `test_gnunet_fs_rec_data.tar.gz' done (.*).\r?\n" | ||
88 | ) | ||
89 | ) | ||
62 | os.remove("test_gnunet_fs_rec_data.tar.gz") | 90 | os.remove("test_gnunet_fs_rec_data.tar.gz") |
63 | 91 | ||
64 | un = pexpect() | 92 | un = pexpect() |
65 | un.spawn(None, [unindex, '-c', 'test_gnunet_fs_idx_data.conf', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 93 | un.spawn( |
94 | None, [ | ||
95 | unindex, '-c', 'test_gnunet_fs_idx_data.conf', | ||
96 | 'test_gnunet_fs_rec_data.tgz' | ||
97 | ], | ||
98 | stdout=subprocess.PIPE, | ||
99 | stderr=subprocess.STDOUT | ||
100 | ) | ||
66 | un.expect("stdout", re.compile(r'Unindexing done\.\r?\n')) | 101 | un.expect("stdout", re.compile(r'Unindexing done\.\r?\n')) |
67 | 102 | ||
68 | finally: | 103 | finally: |
69 | arm = subprocess.Popen([gnunetarm, '-eq', '-c', 'test_gnunet_fs_idx_data.conf']) | 104 | arm = subprocess.Popen([ |
105 | gnunetarm, '-eq', '-c', 'test_gnunet_fs_idx_data.conf' | ||
106 | ]) | ||
70 | arm.communicate() | 107 | arm.communicate() |
71 | if os.name == "nt": | 108 | if os.name == "nt": |
72 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-idx"), True) | 109 | shutil.rmtree( |
110 | os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-idx"), True | ||
111 | ) | ||
73 | else: | 112 | else: |
74 | shutil.rmtree("/tmp/gnunet-test-fs-py-idx", True) | 113 | shutil.rmtree("/tmp/gnunet-test-fs-py-idx", True) |
diff --git a/src/fs/test_gnunet_fs_psd.py.in b/src/fs/test_gnunet_fs_psd.py.in index a1e4db9d5..abb3d0b83 100755 --- a/src/fs/test_gnunet_fs_psd.py.in +++ b/src/fs/test_gnunet_fs_psd.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -38,8 +38,8 @@ except NameError: | |||
38 | reload(sys) | 38 | reload(sys) |
39 | 39 | ||
40 | # Force encoding to utf-8, as this test otherwise fails | 40 | # Force encoding to utf-8, as this test otherwise fails |
41 | # on some systems (see #5094). In Python 3+ there is no attribute | 41 | # on some systems (see #5094). In Python 3+ there is no attribute |
42 | # sys.setdefaultencoding anymore. | 42 | # sys.setdefaultencoding anymore. |
43 | if (3 < sys.version_info[0]): | 43 | if (3 < sys.version_info[0]): |
44 | sys.setdefaultencoding('utf8') | 44 | sys.setdefaultencoding('utf8') |
45 | 45 | ||
@@ -68,9 +68,11 @@ if "GNUNET_PREFIX" in os.environ: | |||
68 | else: | 68 | else: |
69 | print("You need to export GNUNET_PREFIX") | 69 | print("You need to export GNUNET_PREFIX") |
70 | sys.exit(1) | 70 | sys.exit(1) |
71 | 71 | ||
72 | if os.name == "nt": | 72 | if os.name == "nt": |
73 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-psd"), True) | 73 | shutil.rmtree( |
74 | os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-psd"), True | ||
75 | ) | ||
74 | else: | 76 | else: |
75 | shutil.rmtree("/tmp/gnunet-test-fs-py-psd", True) | 77 | shutil.rmtree("/tmp/gnunet-test-fs-py-psd", True) |
76 | 78 | ||
@@ -80,23 +82,68 @@ arm.communicate() | |||
80 | # first, basic publish-search-download run | 82 | # first, basic publish-search-download run |
81 | try: | 83 | try: |
82 | pub = pexpect() | 84 | pub = pexpect() |
83 | pub.spawn(None, [publish, '-c', 'test_gnunet_fs_psd_data.conf', '-n', '-m', "description:Test archive", '-k', 'tst', 'test_gnunet_fs_rec_data.tgz'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 85 | pub.spawn( |
84 | pub.expect("stdout", re.compile(r"Publishing `.+test_gnunet_fs_rec_data.tgz' done\.\r?\n")) | 86 | None, [ |
85 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822'\.\r?\n")) | 87 | publish, '-c', 'test_gnunet_fs_psd_data.conf', '-n', '-m', |
88 | "description:Test archive", '-k', 'tst', | ||
89 | 'test_gnunet_fs_rec_data.tgz' | ||
90 | ], | ||
91 | stdout=subprocess.PIPE, | ||
92 | stderr=subprocess.STDOUT | ||
93 | ) | ||
94 | pub.expect( | ||
95 | "stdout", | ||
96 | re.compile(r"Publishing `.+test_gnunet_fs_rec_data.tgz' done\.\r?\n") | ||
97 | ) | ||
98 | pub.expect( | ||
99 | "stdout", | ||
100 | re.compile( | ||
101 | r"URI is `gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822'\.\r?\n" | ||
102 | ) | ||
103 | ) | ||
86 | 104 | ||
87 | s = pexpect() | 105 | s = pexpect() |
88 | s.spawn(None, [search, '-V', '-t', '1000 ms', '-N', '1', '-c', 'test_gnunet_fs_psd_data.conf', 'tst'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 106 | s.spawn( |
89 | s.expect("stdout", re.compile(r'gnunet-download -o "test_gnunet_fs_rec_data.tgz" gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822\r?\n')) | 107 | None, [ |
108 | search, '-V', '-t', '1000 ms', '-N', '1', '-c', | ||
109 | 'test_gnunet_fs_psd_data.conf', 'tst' | ||
110 | ], | ||
111 | stdout=subprocess.PIPE, | ||
112 | stderr=subprocess.STDOUT | ||
113 | ) | ||
114 | s.expect( | ||
115 | "stdout", | ||
116 | re.compile( | ||
117 | r'gnunet-download -o "test_gnunet_fs_rec_data.tgz" gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822\r?\n' | ||
118 | ) | ||
119 | ) | ||
90 | 120 | ||
91 | down = pexpect() | 121 | down = pexpect() |
92 | down.spawn(None, [download, '-c', 'test_gnunet_fs_psd_data.conf', '-o', 'test_gnunet_fs_rec_data.tar.gz', 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 122 | down.spawn( |
93 | down.expect("stdout", re.compile(r"Downloading `test_gnunet_fs_rec_data.tar.gz' done (.*).\r?\n")) | 123 | None, [ |
124 | download, '-c', 'test_gnunet_fs_psd_data.conf', '-o', | ||
125 | 'test_gnunet_fs_rec_data.tar.gz', | ||
126 | 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822' | ||
127 | ], | ||
128 | stdout=subprocess.PIPE, | ||
129 | stderr=subprocess.STDOUT | ||
130 | ) | ||
131 | down.expect( | ||
132 | "stdout", | ||
133 | re.compile( | ||
134 | r"Downloading `test_gnunet_fs_rec_data.tar.gz' done (.*).\r?\n" | ||
135 | ) | ||
136 | ) | ||
94 | os.remove("test_gnunet_fs_rec_data.tar.gz") | 137 | os.remove("test_gnunet_fs_rec_data.tar.gz") |
95 | 138 | ||
96 | finally: | 139 | finally: |
97 | arm = subprocess.Popen([gnunetarm, '-eq', '-c', 'test_gnunet_fs_psd_data.conf']) | 140 | arm = subprocess.Popen([ |
141 | gnunetarm, '-eq', '-c', 'test_gnunet_fs_psd_data.conf' | ||
142 | ]) | ||
98 | arm.communicate() | 143 | arm.communicate() |
99 | if os.name == "nt": | 144 | if os.name == "nt": |
100 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-psd"), True) | 145 | shutil.rmtree( |
146 | os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-psd"), True | ||
147 | ) | ||
101 | else: | 148 | else: |
102 | shutil.rmtree("/tmp/gnunet-test-fs-py-psd", True) | 149 | shutil.rmtree("/tmp/gnunet-test-fs-py-psd", True) |
diff --git a/src/fs/test_gnunet_fs_rec.py.in b/src/fs/test_gnunet_fs_rec.py.in index 0f881564f..f827aa3a5 100755 --- a/src/fs/test_gnunet_fs_rec.py.in +++ b/src/fs/test_gnunet_fs_rec.py.in | |||
@@ -50,48 +50,97 @@ elif os.name == 'nt': | |||
50 | directory = './gnunet-directory.exe' | 50 | directory = './gnunet-directory.exe' |
51 | 51 | ||
52 | if os.name == "nt": | 52 | if os.name == "nt": |
53 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-rec"), True) | 53 | shutil.rmtree( |
54 | os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-rec"), True | ||
55 | ) | ||
54 | else: | 56 | else: |
55 | shutil.rmtree("/tmp/gnunet-test-fs-py-rec", True) | 57 | shutil.rmtree("/tmp/gnunet-test-fs-py-rec", True) |
56 | 58 | ||
57 | arm = subprocess.Popen([gnunetarm, '-sq', '-c', 'test_gnunet_fs_rec_data.conf']) | 59 | arm = subprocess.Popen([gnunetarm, '-sq', '-c', 'test_gnunet_fs_rec_data.conf']) |
58 | arm.communicate() | 60 | arm.communicate() |
59 | 61 | ||
60 | # pray that `tar' is in PATH. | ||
61 | # FIXME: Actually we should check for that and output | ||
62 | # a message if it isn't found. | ||
63 | tar = tarfile.open('test_gnunet_fs_rec_data.tgz') | 62 | tar = tarfile.open('test_gnunet_fs_rec_data.tgz') |
64 | tar.extractall() | 63 | tar.extractall() |
65 | # first, basic publish-search-download run | 64 | # first, basic publish-search-download run |
66 | try: | 65 | try: |
67 | pub = pexpect() | 66 | pub = pexpect() |
68 | pub.spawn(None, [publish, '-c', 'test_gnunet_fs_rec_data.conf', '-k', 'testdir', 'dir/'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 67 | pub.spawn( |
68 | None, [ | ||
69 | publish, '-c', 'test_gnunet_fs_rec_data.conf', '-k', 'testdir', | ||
70 | 'dir/' | ||
71 | ], | ||
72 | stdout=subprocess.PIPE, | ||
73 | stderr=subprocess.STDOUT | ||
74 | ) | ||
69 | # Can't say much for publishing, except that the last one is the toplevel directory | 75 | # Can't say much for publishing, except that the last one is the toplevel directory |
70 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) | 76 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) |
71 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n")) | 77 | pub.expect( |
78 | "stdout", | ||
79 | re.compile( | ||
80 | r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n" | ||
81 | ) | ||
82 | ) | ||
72 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) | 83 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) |
73 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n")) | 84 | pub.expect( |
85 | "stdout", | ||
86 | re.compile( | ||
87 | r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n" | ||
88 | ) | ||
89 | ) | ||
74 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) | 90 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) |
75 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n")) | 91 | pub.expect( |
92 | "stdout", | ||
93 | re.compile( | ||
94 | r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n" | ||
95 | ) | ||
96 | ) | ||
76 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) | 97 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) |
77 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n")) | 98 | pub.expect( |
99 | "stdout", | ||
100 | re.compile( | ||
101 | r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n" | ||
102 | ) | ||
103 | ) | ||
78 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) | 104 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) |
79 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n")) | 105 | pub.expect( |
106 | "stdout", | ||
107 | re.compile( | ||
108 | r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n" | ||
109 | ) | ||
110 | ) | ||
80 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) | 111 | pub.expect("stdout", re.compile(r"Publishing `.+' done\.\r?\n")) |
81 | pub.expect("stdout", re.compile(r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n")) | 112 | pub.expect( |
82 | pub.expect("stdout", re.compile(r"Publishing `.+[\\/]dir[\\/]' done\.\r?\n")) | 113 | "stdout", |
114 | re.compile( | ||
115 | r"URI is `gnunet://fs/chk/[A-Z0-9]{103}\.[A-Z0-9]{103}\.\d+'\.\r?\n" | ||
116 | ) | ||
117 | ) | ||
118 | pub.expect( | ||
119 | "stdout", re.compile(r"Publishing `.+[\\/]dir[\\/]' done\.\r?\n") | ||
120 | ) | ||
83 | m = pub.expect("stdout", re.compile(r".+\r?\n")) | 121 | m = pub.expect("stdout", re.compile(r".+\r?\n")) |
84 | if not m: | 122 | if not m: |
85 | sys.exit(3) | 123 | sys.exit(3) |
86 | output = m.string | 124 | output = m.string |
87 | url = output[output.find("`")+1:output.find("'")] | 125 | url = output[output.find("`") + 1:output.find("'")] |
88 | 126 | ||
89 | down = pexpect() | 127 | down = pexpect() |
90 | down.spawn(None, [download, '-c', 'test_gnunet_fs_rec_data.conf', '-R', '-o', 'rdir.gnd', url], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 128 | down.spawn( |
129 | None, [ | ||
130 | download, '-c', 'test_gnunet_fs_rec_data.conf', '-R', '-o', | ||
131 | 'rdir.gnd', url | ||
132 | ], | ||
133 | stdout=subprocess.PIPE, | ||
134 | stderr=subprocess.STDOUT | ||
135 | ) | ||
91 | down.expect("stdout", re.compile(r"Downloading `rdir.gnd' done (.*).\r?\n")) | 136 | down.expect("stdout", re.compile(r"Downloading `rdir.gnd' done (.*).\r?\n")) |
92 | 137 | ||
93 | d = pexpect() | 138 | d = pexpect() |
94 | d.spawn(None, [directory, '-c', 'test_gnunet_fs_rec_data.conf', 'rdir/a.gnd'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 139 | d.spawn( |
140 | None, [directory, '-c', 'test_gnunet_fs_rec_data.conf', 'rdir/a.gnd'], | ||
141 | stdout=subprocess.PIPE, | ||
142 | stderr=subprocess.STDOUT | ||
143 | ) | ||
95 | d.expect("stdout", re.compile(r"Directory `a/' meta data:\r?\n")) | 144 | d.expect("stdout", re.compile(r"Directory `a/' meta data:\r?\n")) |
96 | d.expect("stdout", re.compile(r"Directory `a/' contents:\r?\n")) | 145 | d.expect("stdout", re.compile(r"Directory `a/' contents:\r?\n")) |
97 | d.expect("stdout", re.compile(r"COPYING (.*)\r?\n")) | 146 | d.expect("stdout", re.compile(r"COPYING (.*)\r?\n")) |
@@ -101,14 +150,20 @@ try: | |||
101 | os.remove("rdir/a.gnd") | 150 | os.remove("rdir/a.gnd") |
102 | diff = dcdiff('dir', 'rdir') | 151 | diff = dcdiff('dir', 'rdir') |
103 | if len(diff) != 0: | 152 | if len(diff) != 0: |
104 | raise Exception("Unexpected difference between source directory and downloaded result:\n{}".format(diff)) | 153 | raise Exception( |
105 | 154 | "Unexpected difference between source directory and downloaded result:\n{}" | |
155 | .format(diff) | ||
156 | ) | ||
106 | 157 | ||
107 | finally: | 158 | finally: |
108 | arm = subprocess.Popen([gnunetarm, '-eq', '-c', 'test_gnunet_fs_rec_data.conf']) | 159 | arm = subprocess.Popen([ |
160 | gnunetarm, '-eq', '-c', 'test_gnunet_fs_rec_data.conf' | ||
161 | ]) | ||
109 | arm.communicate() | 162 | arm.communicate() |
110 | if os.name == "nt": | 163 | if os.name == "nt": |
111 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-rec"), True) | 164 | shutil.rmtree( |
165 | os.path.join(os.getenv("TEMP"), "gnunet-test-fs-py-rec"), True | ||
166 | ) | ||
112 | else: | 167 | else: |
113 | shutil.rmtree("/tmp/gnunet-test-fs-py-rec", True) | 168 | shutil.rmtree("/tmp/gnunet-test-fs-py-rec", True) |
114 | shutil.rmtree("dir", True) | 169 | shutil.rmtree("dir", True) |
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index 6cc09c098..48d13e3c0 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am | |||
@@ -158,10 +158,18 @@ gnunet_dns2gns_LDADD = \ | |||
158 | $(top_builddir)/src/identity/libgnunetidentity.la \ | 158 | $(top_builddir)/src/identity/libgnunetidentity.la \ |
159 | $(GN_LIBINTL) | 159 | $(GN_LIBINTL) |
160 | 160 | ||
161 | if HAVE_SUDO | ||
162 | SUDO_OR_DOAS_BINARY= $(SUDO_BINARY) | ||
163 | else | ||
164 | if HAVE_DOAS_BINARY | ||
165 | SUDO_OR_DOAS_BINARY= $(DOAS_BINARY) | ||
166 | endif | ||
167 | endif | ||
168 | |||
161 | if LINUX | 169 | if LINUX |
162 | HIJACKBIN = gnunet-dns2gns | 170 | HIJACKBIN = gnunet-dns2gns |
163 | install-exec-hook: | 171 | install-exec-hook: |
164 | $(SUDO_BINARY) setcap 'cap_net_bind_service=+ep' $(DESTDIR)$(libexecdir)/gnunet-dns2gns || true | 172 | $(SUDO_OR_DOAS_BINARY) setcap 'cap_net_bind_service=+ep' $(DESTDIR)$(libexecdir)/gnunet-dns2gns || true |
165 | else | 173 | else |
166 | install-exec-hook: | 174 | install-exec-hook: |
167 | endif | 175 | endif |
diff --git a/src/gnsrecord/Makefile.am b/src/gnsrecord/Makefile.am index 81bee5a6b..3da9af9ca 100644 --- a/src/gnsrecord/Makefile.am +++ b/src/gnsrecord/Makefile.am | |||
@@ -37,7 +37,7 @@ libgnunetgnsrecord_la_LIBADD = \ | |||
37 | $(top_builddir)/src/util/libgnunetutil.la \ | 37 | $(top_builddir)/src/util/libgnunetutil.la \ |
38 | $(GN_LIBINTL) | 38 | $(GN_LIBINTL) |
39 | libgnunetgnsrecord_la_LDFLAGS = \ | 39 | libgnunetgnsrecord_la_LDFLAGS = \ |
40 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 40 | $(GN_LIB_LDFLAGS) \ |
41 | -version-info 0:0:0 | 41 | -version-info 0:0:0 |
42 | 42 | ||
43 | 43 | ||
diff --git a/src/identity/Makefile.am b/src/identity/Makefile.am index 39d423506..9f580f0f9 100644 --- a/src/identity/Makefile.am +++ b/src/identity/Makefile.am | |||
@@ -46,7 +46,7 @@ libgnunetidentity_la_LIBADD = \ | |||
46 | $(top_builddir)/src/util/libgnunetutil.la \ | 46 | $(top_builddir)/src/util/libgnunetutil.la \ |
47 | $(GN_LIBINTL) $(XLIB) | 47 | $(GN_LIBINTL) $(XLIB) |
48 | libgnunetidentity_la_LDFLAGS = \ | 48 | libgnunetidentity_la_LDFLAGS = \ |
49 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 49 | $(GN_LIB_LDFLAGS) \ |
50 | -version-info 1:0:0 | 50 | -version-info 1:0:0 |
51 | 51 | ||
52 | bin_PROGRAMS = \ | 52 | bin_PROGRAMS = \ |
diff --git a/src/integration-tests/gnunet_pyexpect.py.in b/src/integration-tests/gnunet_pyexpect.py.in index d757634a5..aad84e4f7 100644 --- a/src/integration-tests/gnunet_pyexpect.py.in +++ b/src/integration-tests/gnunet_pyexpect.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -26,58 +26,69 @@ import sys | |||
26 | import shutil | 26 | import shutil |
27 | import time | 27 | import time |
28 | 28 | ||
29 | class pexpect (object): | ||
30 | def __init__ (self): | ||
31 | super (pexpect, self).__init__ () | ||
32 | 29 | ||
33 | def spawn (self, stdin, arglist, *pargs, **kwargs): | 30 | class pexpect(object): |
34 | env = kwargs.pop ('env', None) | 31 | def __init__(self): |
35 | if env is None: | 32 | super(pexpect, self).__init__() |
36 | env = os.environ.copy () | 33 | |
37 | # This messes up some testcases, disable log redirection | 34 | def spawn(self, stdin, arglist, *pargs, **kwargs): |
38 | env.pop ('GNUNET_FORCE_LOGFILE', None) | 35 | env = kwargs.pop('env', None) |
39 | self.proc = subprocess.Popen (arglist, *pargs, env=env, **kwargs) | 36 | if env is None: |
40 | if self.proc is None: | 37 | env = os.environ.copy() |
41 | print ("Failed to spawn a process {0}".format (arglist)) | 38 | # This messes up some testcases, disable log redirection |
42 | sys.exit (1) | 39 | env.pop('GNUNET_FORCE_LOGFILE', None) |
43 | if stdin is not None: | 40 | self.proc = subprocess.Popen(arglist, *pargs, env=env, **kwargs) |
44 | self.stdo, self.stde = self.proc.communicate (stdin) | 41 | if self.proc is None: |
45 | else: | 42 | print("Failed to spawn a process {0}".format(arglist)) |
46 | self.stdo, self.stde = self.proc.communicate () | 43 | sys.exit(1) |
47 | return self.proc | 44 | if stdin is not None: |
45 | self.stdo, self.stde = self.proc.communicate(stdin) | ||
46 | else: | ||
47 | self.stdo, self.stde = self.proc.communicate() | ||
48 | return self.proc | ||
48 | 49 | ||
49 | def expect (self, s, r, flags=0): | 50 | def expect(self, s, r, flags=0): |
50 | stream = self.stdo if s == 'stdout' else self.stde | 51 | stream = self.stdo if s == 'stdout' else self.stde |
51 | if isinstance (r, str): | 52 | if isinstance(r, str): |
52 | if r == "EOF": | 53 | if r == "EOF": |
53 | if len (stream) == 0: | 54 | if len(stream) == 0: |
54 | return True | 55 | return True |
56 | else: | ||
57 | print( | ||
58 | "Failed to find `{1}' in {0}, which is `{2}' ({3})". | ||
59 | format(s, r, stream, len(stream)) | ||
60 | ) | ||
61 | sys.exit(2) | ||
62 | raise ValueError( | ||
63 | "Argument `r' should be an instance of re.RegexObject or a special string, but is `{0}'" | ||
64 | .format(r) | ||
65 | ) | ||
66 | m = r.search(stream, flags) | ||
67 | if not m: | ||
68 | print( | ||
69 | "Failed to find `{1}' in {0}, which is is `{2}'".format( | ||
70 | s, r.pattern, stream | ||
71 | ) | ||
72 | ) | ||
73 | sys.exit(2) | ||
74 | stream = stream[m.end():] | ||
75 | if s == 'stdout': | ||
76 | self.stdo = stream | ||
55 | else: | 77 | else: |
56 | print ("Failed to find `{1}' in {0}, which is `{2}' ({3})".format (s, r, stream, len (stream))) | 78 | self.stde = stream |
57 | sys.exit (2) | 79 | return m |
58 | raise ValueError ("Argument `r' should be an instance of re.RegexObject or a special string, but is `{0}'".format (r)) | ||
59 | m = r.search (stream, flags) | ||
60 | if not m: | ||
61 | print ("Failed to find `{1}' in {0}, which is is `{2}'".format (s, r.pattern, stream)) | ||
62 | sys.exit (2) | ||
63 | stream = stream[m.end ():] | ||
64 | if s == 'stdout': | ||
65 | self.stdo = stream | ||
66 | else: | ||
67 | self.stde = stream | ||
68 | return m | ||
69 | 80 | ||
70 | def read (self, s, size=-1): | 81 | def read(self, s, size=-1): |
71 | stream = self.stdo if s == 'stdout' else self.stde | 82 | stream = self.stdo if s == 'stdout' else self.stde |
72 | result = "" | 83 | result = "" |
73 | if size < 0: | 84 | if size < 0: |
74 | result = stream | 85 | result = stream |
75 | new_stream = "" | 86 | new_stream = "" |
76 | else: | 87 | else: |
77 | result = stream[0:size] | 88 | result = stream[0:size] |
78 | new_stream = stream[size:] | 89 | new_stream = stream[size:] |
79 | if s == 'stdout': | 90 | if s == 'stdout': |
80 | self.stdo = new_stream | 91 | self.stdo = new_stream |
81 | else: | 92 | else: |
82 | self.stde = new_stream | 93 | self.stde = new_stream |
83 | return result | 94 | return result |
diff --git a/src/integration-tests/gnunet_testing.py.in b/src/integration-tests/gnunet_testing.py.in index c3596d232..10f9d4475 100644 --- a/src/integration-tests/gnunet_testing.py.in +++ b/src/integration-tests/gnunet_testing.py.in | |||
@@ -30,11 +30,13 @@ import logging | |||
30 | logger = logging.getLogger() | 30 | logger = logging.getLogger() |
31 | handler = logging.StreamHandler() | 31 | handler = logging.StreamHandler() |
32 | formatter = logging.Formatter( | 32 | formatter = logging.Formatter( |
33 | '%(asctime)s %(name)-12s %(levelname)-8s %(message)s') | 33 | '%(asctime)s %(name)-12s %(levelname)-8s %(message)s' |
34 | ) | ||
34 | handler.setFormatter(formatter) | 35 | handler.setFormatter(formatter) |
35 | logger.addHandler(handler) | 36 | logger.addHandler(handler) |
36 | logger.setLevel(logging.DEBUG) | 37 | logger.setLevel(logging.DEBUG) |
37 | 38 | ||
39 | |||
38 | class Check(object): | 40 | class Check(object): |
39 | def __init__(self, test): | 41 | def __init__(self, test): |
40 | self.fulfilled = False | 42 | self.fulfilled = False |
@@ -92,7 +94,9 @@ class Check(object): | |||
92 | neg += 1 | 94 | neg += 1 |
93 | else: | 95 | else: |
94 | pos += 1 | 96 | pos += 1 |
95 | logger.debug('%s out of %s conditions fulfilled', str(pos), str(pos+neg)) | 97 | logger.debug( |
98 | '%s out of %s conditions fulfilled', str(pos), str(pos + neg) | ||
99 | ) | ||
96 | return self.fulfilled | 100 | return self.fulfilled |
97 | 101 | ||
98 | def reset(self): | 102 | def reset(self): |
@@ -115,9 +119,13 @@ class Condition(object): | |||
115 | 119 | ||
116 | def evaluate(self, failed_only): | 120 | def evaluate(self, failed_only): |
117 | if ((self.fulfilled == False) and (failed_only == True)): | 121 | if ((self.fulfilled == False) and (failed_only == True)): |
118 | logger.debug('%s condition for was %s', str(self.type), str(self.fulfilled)) | 122 | logger.debug( |
123 | '%s condition for was %s', str(self.type), str(self.fulfilled) | ||
124 | ) | ||
119 | elif (failed_only == False): | 125 | elif (failed_only == False): |
120 | logger.debug('%s condition for was %s', str(self.type), str(self.fulfilled)) | 126 | logger.debug( |
127 | '%s condition for was %s', str(self.type), str(self.fulfilled) | ||
128 | ) | ||
121 | return self.fulfilled | 129 | return self.fulfilled |
122 | 130 | ||
123 | 131 | ||
@@ -140,9 +148,15 @@ class FileExistCondition(Condition): | |||
140 | 148 | ||
141 | def evaluate(self, failed_only): | 149 | def evaluate(self, failed_only): |
142 | if ((self.fulfilled == False) and (failed_only == True)): | 150 | if ((self.fulfilled == False) and (failed_only == True)): |
143 | logger.debug('%s confition for file %s was %s', str(self.type), self.file, str(self.fulfilled)) | 151 | logger.debug( |
152 | '%s confition for file %s was %s', str(self.type), self.file, | ||
153 | str(self.fulfilled) | ||
154 | ) | ||
144 | elif (failed_only == False): | 155 | elif (failed_only == False): |
145 | logger.debug('%s confition for file %s was %s', str(self.type), self.file, str(self.fulfilled)) | 156 | logger.debug( |
157 | '%s confition for file %s was %s', str(self.type), self.file, | ||
158 | str(self.fulfilled) | ||
159 | ) | ||
146 | return self.fulfilled | 160 | return self.fulfilled |
147 | 161 | ||
148 | 162 | ||
@@ -158,7 +172,9 @@ class StatisticsCondition(Condition): | |||
158 | 172 | ||
159 | def check(self): | 173 | def check(self): |
160 | if (self.fulfilled == False): | 174 | if (self.fulfilled == False): |
161 | self.result = self.peer.get_statistics_value(self.subsystem, self.name) | 175 | self.result = self.peer.get_statistics_value( |
176 | self.subsystem, self.name | ||
177 | ) | ||
162 | if (self.result == self.value): | 178 | if (self.result == self.value): |
163 | self.fulfilled = True | 179 | self.fulfilled = True |
164 | return True | 180 | return True |
@@ -174,8 +190,14 @@ class StatisticsCondition(Condition): | |||
174 | else: | 190 | else: |
175 | fail = "" | 191 | fail = "" |
176 | op = " == " | 192 | op = " == " |
177 | if (((self.fulfilled == False) and (failed_only == True)) or (failed_only == False)): | 193 | if (((self.fulfilled == False) and (failed_only == True)) |
178 | 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) | 194 | or (failed_only == False)): |
195 | logger.debug( | ||
196 | '%s %s condition in subsystem %s: %s: (expected/real value) %s %s %s %s', | ||
197 | self.peer.id[:4].decode("utf-8"), self.peer.cfg, | ||
198 | self.subsystem.ljust(12), self.name.ljust(30), self.value, op, | ||
199 | self.result, fail | ||
200 | ) | ||
179 | return self.fulfilled | 201 | return self.fulfilled |
180 | 202 | ||
181 | 203 | ||
@@ -195,8 +217,12 @@ class EqualStatisticsCondition(Condition): | |||
195 | 217 | ||
196 | def check(self): | 218 | def check(self): |
197 | if (self.fulfilled == False): | 219 | if (self.fulfilled == False): |
198 | self.result = self.peer.get_statistics_value(self.subsystem, self.name) | 220 | self.result = self.peer.get_statistics_value( |
199 | self.result2 = self.peer2.get_statistics_value(self.subsystem2, self.name2) | 221 | self.subsystem, self.name |
222 | ) | ||
223 | self.result2 = self.peer2.get_statistics_value( | ||
224 | self.subsystem2, self.name2 | ||
225 | ) | ||
200 | if (self.result == self.result2): | 226 | if (self.result == self.result2): |
201 | self.fulfilled = True | 227 | self.fulfilled = True |
202 | return True | 228 | return True |
@@ -206,8 +232,14 @@ class EqualStatisticsCondition(Condition): | |||
206 | return True | 232 | return True |
207 | 233 | ||
208 | def evaluate(self, failed_only): | 234 | def evaluate(self, failed_only): |
209 | if (((self.fulfilled == False) and (failed_only == True)) or (failed_only == False)): | 235 | if (((self.fulfilled == False) and (failed_only == True)) |
210 | logger.debug('%s %s %s == %s %s %s %s %s', self.peer.id[:4], self.subsystem.ljust(12), self.name.ljust(30), self.result, self.peer2.id[:4], self.subsystem2.ljust(12), self.name2.ljust(30), self.result2) | 236 | or (failed_only == False)): |
237 | logger.debug( | ||
238 | '%s %s %s == %s %s %s %s %s', self.peer.id[:4], | ||
239 | self.subsystem.ljust(12), self.name.ljust(30), self.result, | ||
240 | self.peer2.id[:4], self.subsystem2.ljust(12), | ||
241 | self.name2.ljust(30), self.result2 | ||
242 | ) | ||
211 | return self.fulfilled | 243 | return self.fulfilled |
212 | 244 | ||
213 | 245 | ||
@@ -262,19 +294,23 @@ class Peer(object): | |||
262 | # print('ERROR! Peer using cfg ' + | 294 | # print('ERROR! Peer using cfg ' + |
263 | # self.cfg + | 295 | # self.cfg + |
264 | # ' could not be stopped') | 296 | # ' could not be stopped') |
265 | logger.debug('ERROR! Peer using cfg %s could not be stopped', self.cfg) | 297 | logger.debug( |
298 | 'ERROR! Peer using cfg %s could not be stopped', self.cfg | ||
299 | ) | ||
266 | self.started = False | 300 | self.started = False |
267 | return ret | 301 | return ret |
268 | else: | 302 | else: |
269 | return False | 303 | return False |
270 | 304 | ||
271 | def start(self): | 305 | def start(self): |
272 | os.unsetenv ("XDG_CONFIG_HOME") | 306 | os.unsetenv("XDG_CONFIG_HOME") |
273 | os.unsetenv ("XDG_DATA_HOME") | 307 | os.unsetenv("XDG_DATA_HOME") |
274 | os.unsetenv ("XDG_CACHE_HOME") | 308 | os.unsetenv("XDG_CACHE_HOME") |
275 | self.test.p("Starting peer using cfg " + self.cfg) | 309 | self.test.p("Starting peer using cfg " + self.cfg) |
276 | try: | 310 | try: |
277 | server = subprocess.Popen([self.test.gnunetarm, '-sq', '-c', self.cfg]) | 311 | server = subprocess.Popen([ |
312 | self.test.gnunetarm, '-sq', '-c', self.cfg | ||
313 | ]) | ||
278 | server.communicate() | 314 | server.communicate() |
279 | except OSError: | 315 | except OSError: |
280 | # print("Can not start peer") | 316 | # print("Can not start peer") |
@@ -285,7 +321,11 @@ class Peer(object): | |||
285 | test = '' | 321 | test = '' |
286 | try: | 322 | try: |
287 | server = pexpect() | 323 | server = pexpect() |
288 | server.spawn(None, [self.test.gnunetpeerinfo, '-c', self.cfg, '-s'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 324 | server.spawn( |
325 | None, [self.test.gnunetpeerinfo, '-c', self.cfg, '-s'], | ||
326 | stdout=subprocess.PIPE, | ||
327 | stderr=subprocess.STDOUT | ||
328 | ) | ||
289 | test = server.read("stdout", 1024) | 329 | test = server.read("stdout", 1024) |
290 | except OSError: | 330 | except OSError: |
291 | # print("Can not get peer identity") | 331 | # print("Can not get peer identity") |
@@ -299,7 +339,9 @@ class Peer(object): | |||
299 | return False | 339 | return False |
300 | self.test.p("Stopping peer using cfg " + self.cfg) | 340 | self.test.p("Stopping peer using cfg " + self.cfg) |
301 | try: | 341 | try: |
302 | server = subprocess.Popen([self.test.gnunetarm, '-eq', '-c', self.cfg]) | 342 | server = subprocess.Popen([ |
343 | self.test.gnunetarm, '-eq', '-c', self.cfg | ||
344 | ]) | ||
303 | server.communicate() | 345 | server.communicate() |
304 | except OSError: | 346 | except OSError: |
305 | # print("Can not stop peer") | 347 | # print("Can not stop peer") |
@@ -310,7 +352,14 @@ class Peer(object): | |||
310 | 352 | ||
311 | def get_statistics_value(self, subsystem, name): | 353 | def get_statistics_value(self, subsystem, name): |
312 | server = pexpect() | 354 | server = pexpect() |
313 | server.spawn(None, [self.test.gnunetstatistics, '-c', self.cfg, '-q', '-n', name, '-s', subsystem], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 355 | server.spawn( |
356 | None, [ | ||
357 | self.test.gnunetstatistics, '-c', self.cfg, '-q', '-n', name, | ||
358 | '-s', subsystem | ||
359 | ], | ||
360 | stdout=subprocess.PIPE, | ||
361 | stderr=subprocess.STDOUT | ||
362 | ) | ||
314 | # server.expect ("stdout", re.compile (r"")) | 363 | # server.expect ("stdout", re.compile (r"")) |
315 | test = server.read("stdout", 10240) | 364 | test = server.read("stdout", 10240) |
316 | tests = test.partition(b'\n') | 365 | tests = test.partition(b'\n') |
@@ -319,9 +368,14 @@ class Peer(object): | |||
319 | tests = (tests[0][:-1], tests[1], tests[2]) | 368 | tests = (tests[0][:-1], tests[1], tests[2]) |
320 | tests = tests[0] | 369 | tests = tests[0] |
321 | result = tests.decode("utf-8").strip() | 370 | result = tests.decode("utf-8").strip() |
322 | logger.debug('running gnunet-statistics %s for %s "/" %s yields %s', self.cfg, name, subsystem, result) | 371 | logger.debug( |
372 | 'running gnunet-statistics %s for %s "/" %s yields %s', self.cfg, | ||
373 | name, subsystem, result | ||
374 | ) | ||
323 | if (result.isdigit() == True): | 375 | if (result.isdigit() == True): |
324 | return result | 376 | return result |
325 | else: | 377 | else: |
326 | logger.debug('Invalid statistics value: %s is not a number!', result) | 378 | logger.debug( |
379 | 'Invalid statistics value: %s is not a number!', result | ||
380 | ) | ||
327 | return -1 | 381 | return -1 |
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 4b4b35629..ddac326cd 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in | |||
@@ -32,7 +32,6 @@ from gnunet_testing import Check | |||
32 | from gnunet_testing import Condition | 32 | from gnunet_testing import Condition |
33 | from gnunet_testing import * | 33 | from gnunet_testing import * |
34 | 34 | ||
35 | |||
36 | # | 35 | # |
37 | # This test tests if a fresh peer bootstraps from a hostlist server and then | 36 | # This test tests if a fresh peer bootstraps from a hostlist server and then |
38 | # successfully connects to the server | 37 | # successfully connects to the server |
@@ -124,6 +123,7 @@ def check(): | |||
124 | 123 | ||
125 | check.run_blocking(check_timeout, success_cont, fail_cont) | 124 | check.run_blocking(check_timeout, success_cont, fail_cont) |
126 | 125 | ||
126 | |||
127 | # | 127 | # |
128 | # Test execution | 128 | # Test execution |
129 | # | 129 | # |
diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in index 0444cf249..a23c025ca 100755 --- a/src/integration-tests/test_integration_clique.py.in +++ b/src/integration-tests/test_integration_clique.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -113,9 +113,13 @@ def check_connect(): | |||
113 | check.add(StatisticsCondition(client, 'dht', '# peers connected', 2)) | 113 | check.add(StatisticsCondition(client, 'dht', '# peers connected', 2)) |
114 | check.add(StatisticsCondition(client, 'fs', '# peers connected', 2)) | 114 | check.add(StatisticsCondition(client, 'fs', '# peers connected', 2)) |
115 | 115 | ||
116 | check.add(StatisticsCondition(client_nat, 'transport', '# peers connected', 2)) | 116 | check.add( |
117 | StatisticsCondition(client_nat, 'transport', '# peers connected', 2) | ||
118 | ) | ||
117 | check.add(StatisticsCondition(client_nat, 'core', '# peers connected', 2)) | 119 | check.add(StatisticsCondition(client_nat, 'core', '# peers connected', 2)) |
118 | check.add(StatisticsCondition(client_nat, 'topology', '# peers connected', 2)) | 120 | check.add( |
121 | StatisticsCondition(client_nat, 'topology', '# peers connected', 2) | ||
122 | ) | ||
119 | check.add(StatisticsCondition(client_nat, 'dht', '# peers connected', 2)) | 123 | check.add(StatisticsCondition(client_nat, 'dht', '# peers connected', 2)) |
120 | check.add(StatisticsCondition(client_nat, 'fs', '# peers connected', 2)) | 124 | check.add(StatisticsCondition(client_nat, 'fs', '# peers connected', 2)) |
121 | 125 | ||
@@ -127,6 +131,7 @@ def check_connect(): | |||
127 | 131 | ||
128 | check.run_blocking(check_timeout, success_cont, fail_cont) | 132 | check.run_blocking(check_timeout, success_cont, fail_cont) |
129 | 133 | ||
134 | |||
130 | # | 135 | # |
131 | # Test execution | 136 | # Test execution |
132 | # | 137 | # |
@@ -199,7 +204,8 @@ def run(): | |||
199 | cleanup() | 204 | cleanup() |
200 | sys.exit(success) | 205 | sys.exit(success) |
201 | 206 | ||
202 | if ((client.started == True) and (client_nat.started == True) and (server.started == True)): | 207 | if ((client.started == True) and (client_nat.started == True) |
208 | and (server.started == True)): | ||
203 | test.p('Peers started, running check') | 209 | test.p('Peers started, running check') |
204 | check_connect() | 210 | check_connect() |
205 | 211 | ||
diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in index 737014e61..9861728c2 100755 --- a/src/integration-tests/test_integration_disconnect.py.in +++ b/src/integration-tests/test_integration_disconnect.py.in | |||
@@ -32,7 +32,6 @@ from gnunet_testing import Check | |||
32 | from gnunet_testing import Condition | 32 | from gnunet_testing import Condition |
33 | from gnunet_testing import * | 33 | from gnunet_testing import * |
34 | 34 | ||
35 | |||
36 | # | 35 | # |
37 | # This test tests if a fresh peer bootstraps from a hostlist server and then | 36 | # This test tests if a fresh peer bootstraps from a hostlist server and then |
38 | # successfully connects to the server. When both peers are connected | 37 | # successfully connects to the server. When both peers are connected |
@@ -48,158 +47,169 @@ verbose = True | |||
48 | check_timeout = 180 | 47 | check_timeout = 180 |
49 | 48 | ||
50 | if os.name == "nt": | 49 | if os.name == "nt": |
51 | tmp = os.getenv ("TEMP") | 50 | tmp = os.getenv("TEMP") |
52 | signals = [signal.SIGTERM, signal.SIGINT] | 51 | signals = [signal.SIGTERM, signal.SIGINT] |
53 | else: | 52 | else: |
54 | tmp = "/tmp" | 53 | tmp = "/tmp" |
55 | signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT] | 54 | signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT] |
56 | 55 | ||
57 | def cleanup_onerror (function, path, excinfo): | 56 | |
58 | import stat | 57 | def cleanup_onerror(function, path, excinfo): |
59 | if not os.path.exists (path): | 58 | import stat |
60 | pass | 59 | if not os.path.exists(path): |
61 | elif not os.access(path, os.W_OK): | 60 | pass |
62 | # Is the error an access error ? | 61 | elif not os.access(path, os.W_OK): |
63 | os.chmod (path, stat.S_IWUSR) | 62 | # Is the error an access error ? |
64 | function (path) | 63 | os.chmod(path, stat.S_IWUSR) |
65 | else: | 64 | function(path) |
66 | raise | 65 | else: |
67 | 66 | raise | |
68 | def cleanup (): | 67 | |
69 | shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), False, cleanup_onerror) | 68 | |
70 | shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), False, cleanup_onerror) | 69 | def cleanup(): |
71 | 70 | shutil.rmtree( | |
72 | 71 | os.path.join(tmp, "c_bootstrap_server"), False, cleanup_onerror | |
73 | def success_disconnect_cont (check): | 72 | ) |
74 | print('Peers disconnected successfully') | 73 | shutil.rmtree(os.path.join(tmp, "c_no_nat_client"), False, cleanup_onerror) |
75 | global success | 74 | |
76 | success = True; | 75 | |
77 | 76 | def success_disconnect_cont(check): | |
78 | 77 | print('Peers disconnected successfully') | |
79 | def fail_disconnect_cont (check): | 78 | global success |
80 | global success | 79 | success = True |
81 | success = False; | 80 | |
82 | print('Peers failed to disconnect') | 81 | |
83 | check.evaluate(True) | 82 | def fail_disconnect_cont(check): |
84 | 83 | global success | |
85 | def check_disconnect (): | 84 | success = False |
86 | test.p ('Shutting down bootstrap server') | 85 | print('Peers failed to disconnect') |
87 | server.stop () | 86 | check.evaluate(True) |
88 | check = Check (test) | 87 | |
89 | check.add (StatisticsCondition (client, 'transport', '# peers connected',0)) | 88 | |
90 | check.add (StatisticsCondition (client, 'core', '# peers connected',0)) | 89 | def check_disconnect(): |
91 | check.add (StatisticsCondition (client, 'topology', '# peers connected',0)) | 90 | test.p('Shutting down bootstrap server') |
92 | check.add (StatisticsCondition (client, 'dht', '# peers connected',0)) | 91 | server.stop() |
93 | check.add (StatisticsCondition (client, 'fs', '# peers connected',0)) | 92 | check = Check(test) |
94 | check.run_blocking (check_timeout, success_disconnect_cont, fail_disconnect_cont) | 93 | check.add(StatisticsCondition(client, 'transport', '# peers connected', 0)) |
95 | 94 | check.add(StatisticsCondition(client, 'core', '# peers connected', 0)) | |
96 | 95 | check.add(StatisticsCondition(client, 'topology', '# peers connected', 0)) | |
97 | def success_connect_cont (check): | 96 | check.add(StatisticsCondition(client, 'dht', '# peers connected', 0)) |
98 | print('Peers connected successfully') | 97 | check.add(StatisticsCondition(client, 'fs', '# peers connected', 0)) |
99 | check_disconnect () | 98 | check.run_blocking( |
100 | 99 | check_timeout, success_disconnect_cont, fail_disconnect_cont | |
101 | 100 | ) | |
102 | def fail_connect_cont (check): | 101 | |
103 | global success | 102 | |
104 | success= False | 103 | def success_connect_cont(check): |
105 | print('Peers failed to connected!') | 104 | print('Peers connected successfully') |
106 | check.evaluate(True) | 105 | check_disconnect() |
107 | 106 | ||
108 | 107 | ||
109 | def check_connect (): | 108 | def fail_connect_cont(check): |
110 | check = Check (test) | 109 | global success |
111 | check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) | 110 | success = False |
112 | check.add (StatisticsCondition (server, 'core', '# peers connected',1)) | 111 | print('Peers failed to connected!') |
113 | check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) | 112 | check.evaluate(True) |
114 | check.add (StatisticsCondition (server, 'dht', '# peers connected',1)) | 113 | |
115 | check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) | 114 | |
116 | 115 | def check_connect(): | |
117 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) | 116 | check = Check(test) |
118 | check.add (StatisticsCondition (client, 'core', '# peers connected',1)) | 117 | check.add(StatisticsCondition(server, 'transport', '# peers connected', 1)) |
119 | check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) | 118 | check.add(StatisticsCondition(server, 'core', '# peers connected', 1)) |
120 | check.add (StatisticsCondition (client, 'dht', '# peers connected',1)) | 119 | check.add(StatisticsCondition(server, 'topology', '# peers connected', 1)) |
121 | check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) | 120 | check.add(StatisticsCondition(server, 'dht', '# peers connected', 1)) |
122 | 121 | check.add(StatisticsCondition(server, 'fs', '# peers connected', 1)) | |
123 | check.run_blocking (check_timeout, success_connect_cont, fail_connect_cont) | 122 | |
123 | check.add(StatisticsCondition(client, 'transport', '# peers connected', 1)) | ||
124 | check.add(StatisticsCondition(client, 'core', '# peers connected', 1)) | ||
125 | check.add(StatisticsCondition(client, 'topology', '# peers connected', 1)) | ||
126 | check.add(StatisticsCondition(client, 'dht', '# peers connected', 1)) | ||
127 | check.add(StatisticsCondition(client, 'fs', '# peers connected', 1)) | ||
128 | |||
129 | check.run_blocking(check_timeout, success_connect_cont, fail_connect_cont) | ||
130 | |||
124 | 131 | ||
125 | # | 132 | # |
126 | # Test execution | 133 | # Test execution |
127 | # | 134 | # |
128 | 135 | ||
129 | def SigHandler(signum = None, frame = None): | 136 | |
130 | global success | 137 | def SigHandler(signum=None, frame=None): |
131 | global server | 138 | global success |
132 | global client | 139 | global server |
133 | 140 | global client | |
134 | print('Test was aborted!') | 141 | |
135 | if (None != server): | 142 | print('Test was aborted!') |
136 | server.stop () | 143 | if (None != server): |
137 | if (None != client): | 144 | server.stop() |
138 | client.stop () | 145 | if (None != client): |
139 | cleanup () | 146 | client.stop() |
140 | sys.exit(success) | 147 | cleanup() |
141 | 148 | sys.exit(success) | |
142 | def run (): | 149 | |
143 | global success | 150 | |
144 | global test | 151 | def run(): |
145 | global server | 152 | global success |
146 | global client | 153 | global test |
147 | 154 | global server | |
148 | server = None | 155 | global client |
149 | client = None | 156 | |
150 | success = False | 157 | server = None |
151 | 158 | client = None | |
152 | for sig in signals: | 159 | success = False |
153 | signal.signal(sig, SigHandler) | 160 | |
154 | 161 | for sig in signals: | |
155 | test = Test ('test_integration_bootstrap_and_connect.py', verbose) | 162 | signal.signal(sig, SigHandler) |
156 | cleanup () | 163 | |
157 | 164 | test = Test('test_integration_bootstrap_and_connect.py', verbose) | |
158 | server = Peer(test, './confs/c_bootstrap_server.conf'); | 165 | cleanup() |
159 | client = Peer(test, './confs/c_no_nat_client.conf'); | 166 | |
160 | 167 | server = Peer(test, './confs/c_bootstrap_server.conf') | |
161 | if (True != server.start()): | 168 | client = Peer(test, './confs/c_no_nat_client.conf') |
162 | print('Failed to start server') | 169 | |
163 | if (None != server): | 170 | if (True != server.start()): |
164 | server.stop () | 171 | print('Failed to start server') |
165 | cleanup () | 172 | if (None != server): |
166 | sys.exit(success) | 173 | server.stop() |
167 | 174 | cleanup() | |
168 | # Give the server time to start | 175 | sys.exit(success) |
169 | time.sleep(5) | 176 | |
170 | 177 | # Give the server time to start | |
171 | if (True != client.start()): | 178 | time.sleep(5) |
172 | print('Failed to start client') | 179 | |
173 | if (None != server): | 180 | if (True != client.start()): |
174 | server.stop () | 181 | print('Failed to start client') |
175 | if (None != client): | 182 | if (None != server): |
176 | client.stop () | 183 | server.stop() |
177 | cleanup () | 184 | if (None != client): |
178 | sys.exit(success) | 185 | client.stop() |
179 | 186 | cleanup() | |
180 | if ((client.started == True) and (server.started == True)): | 187 | sys.exit(success) |
181 | test.p ('Peers started, running check') | 188 | |
182 | time.sleep(5) | 189 | if ((client.started == True) and (server.started == True)): |
183 | check_connect () | 190 | test.p('Peers started, running check') |
184 | server.stop () | 191 | time.sleep(5) |
185 | client.stop () | 192 | check_connect() |
186 | 193 | server.stop() | |
187 | cleanup () | 194 | client.stop() |
188 | 195 | ||
189 | if (success == False): | 196 | cleanup() |
190 | print ('Test failed') | 197 | |
191 | return False | 198 | if (success == False): |
192 | else: | 199 | print('Test failed') |
193 | return True | 200 | return False |
201 | else: | ||
202 | return True | ||
203 | |||
194 | 204 | ||
195 | try: | 205 | try: |
196 | run () | 206 | run() |
197 | except (KeyboardInterrupt, SystemExit): | 207 | except (KeyboardInterrupt, SystemExit): |
198 | print('Test interrupted') | 208 | print('Test interrupted') |
199 | server.stop () | 209 | server.stop() |
200 | client.stop () | 210 | client.stop() |
201 | cleanup () | 211 | cleanup() |
202 | if (success == False): | 212 | if (success == False): |
203 | sys.exit(1) | 213 | sys.exit(1) |
204 | else: | 214 | else: |
205 | sys.exit(0) | 215 | sys.exit(0) |
diff --git a/src/integration-tests/test_integration_disconnect_nat.py.in b/src/integration-tests/test_integration_disconnect_nat.py.in index c3d5d8901..d3ff84ebe 100755 --- a/src/integration-tests/test_integration_disconnect_nat.py.in +++ b/src/integration-tests/test_integration_disconnect_nat.py.in | |||
@@ -32,7 +32,6 @@ from gnunet_testing import Check | |||
32 | from gnunet_testing import Condition | 32 | from gnunet_testing import Condition |
33 | from gnunet_testing import * | 33 | from gnunet_testing import * |
34 | 34 | ||
35 | |||
36 | # | 35 | # |
37 | # This test tests if a fresh peer bootstraps from a hostlist server and then | 36 | # This test tests if a fresh peer bootstraps from a hostlist server and then |
38 | # successfully connects to the server. When both peers are connected | 37 | # successfully connects to the server. When both peers are connected |
@@ -68,7 +67,9 @@ def cleanup_onerror(function, path, excinfo): | |||
68 | 67 | ||
69 | 68 | ||
70 | def cleanup(): | 69 | def cleanup(): |
71 | shutil.rmtree(os.path.join(tmp, "c_bootstrap_server"), False, cleanup_onerror) | 70 | shutil.rmtree( |
71 | os.path.join(tmp, "c_bootstrap_server"), False, cleanup_onerror | ||
72 | ) | ||
72 | shutil.rmtree(os.path.join(tmp, "c_nat_client"), False, cleanup_onerror) | 73 | shutil.rmtree(os.path.join(tmp, "c_nat_client"), False, cleanup_onerror) |
73 | 74 | ||
74 | 75 | ||
@@ -80,7 +81,7 @@ def success_disconnect_cont(check): | |||
80 | 81 | ||
81 | def fail_disconnect_cont(check): | 82 | def fail_disconnect_cont(check): |
82 | global success | 83 | global success |
83 | success = False; | 84 | success = False |
84 | print('Peers failed to disconnect') | 85 | print('Peers failed to disconnect') |
85 | check.evaluate(True) | 86 | check.evaluate(True) |
86 | 87 | ||
@@ -96,7 +97,9 @@ def check_disconnect(): | |||
96 | check.add(StatisticsCondition(server, 'topology', '# peers connected', 0)) | 97 | check.add(StatisticsCondition(server, 'topology', '# peers connected', 0)) |
97 | check.add(StatisticsCondition(server, 'dht', '# peers connected', 0)) | 98 | check.add(StatisticsCondition(server, 'dht', '# peers connected', 0)) |
98 | check.add(StatisticsCondition(server, 'fs', '# peers connected', 0)) | 99 | check.add(StatisticsCondition(server, 'fs', '# peers connected', 0)) |
99 | check.run_blocking(check_timeout, success_disconnect_cont, fail_disconnect_cont) | 100 | check.run_blocking( |
101 | check_timeout, success_disconnect_cont, fail_disconnect_cont | ||
102 | ) | ||
100 | 103 | ||
101 | 104 | ||
102 | def success_connect_cont(check): | 105 | def success_connect_cont(check): |
@@ -115,9 +118,13 @@ def check_connect(): | |||
115 | global server | 118 | global server |
116 | global nat_client | 119 | global nat_client |
117 | check = Check(test) | 120 | check = Check(test) |
118 | check.add(StatisticsCondition(nat_client, 'transport', '# peers connected', 1)) | 121 | check.add( |
122 | StatisticsCondition(nat_client, 'transport', '# peers connected', 1) | ||
123 | ) | ||
119 | check.add(StatisticsCondition(nat_client, 'core', '# peers connected', 1)) | 124 | check.add(StatisticsCondition(nat_client, 'core', '# peers connected', 1)) |
120 | check.add(StatisticsCondition(nat_client, 'topology', '# peers connected', 1)) | 125 | check.add( |
126 | StatisticsCondition(nat_client, 'topology', '# peers connected', 1) | ||
127 | ) | ||
121 | check.add(StatisticsCondition(nat_client, 'dht', '# peers connected', 1)) | 128 | check.add(StatisticsCondition(nat_client, 'dht', '# peers connected', 1)) |
122 | check.add(StatisticsCondition(nat_client, 'fs', '# peers connected', 1)) | 129 | check.add(StatisticsCondition(nat_client, 'fs', '# peers connected', 1)) |
123 | 130 | ||
@@ -134,6 +141,7 @@ def check_connect(): | |||
134 | # Test execution | 141 | # Test execution |
135 | # | 142 | # |
136 | 143 | ||
144 | |||
137 | def SigHandler(signum=None, frame=None): | 145 | def SigHandler(signum=None, frame=None): |
138 | global success | 146 | global success |
139 | global server | 147 | global server |
@@ -204,7 +212,7 @@ def run(): | |||
204 | 212 | ||
205 | try: | 213 | try: |
206 | run() | 214 | run() |
207 | except(KeyboardInterrupt, SystemExit): | 215 | except (KeyboardInterrupt, SystemExit): |
208 | print('Test interrupted') | 216 | print('Test interrupted') |
209 | server.stop() | 217 | server.stop() |
210 | nat_client.stop() | 218 | nat_client.stop() |
diff --git a/src/integration-tests/test_integration_reconnect.py.in b/src/integration-tests/test_integration_reconnect.py.in index 8c4193680..5bffb72e3 100755 --- a/src/integration-tests/test_integration_reconnect.py.in +++ b/src/integration-tests/test_integration_reconnect.py.in | |||
@@ -32,7 +32,6 @@ from gnunet_testing import Check | |||
32 | from gnunet_testing import Condition | 32 | from gnunet_testing import Condition |
33 | from gnunet_testing import * | 33 | from gnunet_testing import * |
34 | 34 | ||
35 | |||
36 | # | 35 | # |
37 | # This test tests if a fresh peer bootstraps from a hostlist server and then | 36 | # This test tests if a fresh peer bootstraps from a hostlist server and then |
38 | # successfully connects to the server. When both peers are connected | 37 | # successfully connects to the server. When both peers are connected |
@@ -43,195 +42,196 @@ from gnunet_testing import * | |||
43 | 42 | ||
44 | #definitions | 43 | #definitions |
45 | 44 | ||
46 | |||
47 | testname = "test_integration_restart" | 45 | testname = "test_integration_restart" |
48 | verbose = True | 46 | verbose = True |
49 | check_timeout = 180 | 47 | check_timeout = 180 |
50 | 48 | ||
51 | if os.name == "nt": | 49 | if os.name == "nt": |
52 | tmp = os.getenv ("TEMP") | 50 | tmp = os.getenv("TEMP") |
53 | signals = [signal.SIGTERM, signal.SIGINT] | 51 | signals = [signal.SIGTERM, signal.SIGINT] |
54 | else: | 52 | else: |
55 | tmp = "/tmp" | 53 | tmp = "/tmp" |
56 | signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT] | 54 | signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT] |
57 | 55 | ||
58 | def cleanup_onerror (function, path, excinfo): | 56 | |
59 | import stat | 57 | def cleanup_onerror(function, path, excinfo): |
60 | if not os.path.exists (path): | 58 | import stat |
61 | pass | 59 | if not os.path.exists(path): |
62 | elif not os.access(path, os.W_OK): | 60 | pass |
63 | # Is the error an access error ? | 61 | elif not os.access(path, os.W_OK): |
64 | os.chmod (path, stat.S_IWUSR) | 62 | # Is the error an access error ? |
65 | function (path) | 63 | os.chmod(path, stat.S_IWUSR) |
66 | else: | 64 | function(path) |
67 | raise | 65 | else: |
68 | 66 | raise | |
69 | def cleanup (): | 67 | |
68 | |||
69 | def cleanup(): | ||
70 | retries = 10 | 70 | retries = 10 |
71 | path = os.path.join (tmp, "c_bootstrap_server") | 71 | path = os.path.join(tmp, "c_bootstrap_server") |
72 | test.p ("Removing " + path) | 72 | test.p("Removing " + path) |
73 | while ((os.path.exists(path)) and (retries > 0)): | 73 | while ((os.path.exists(path)) and (retries > 0)): |
74 | shutil.rmtree ((path), False, cleanup_onerror) | 74 | shutil.rmtree((path), False, cleanup_onerror) |
75 | time.sleep (1) | 75 | time.sleep(1) |
76 | retries -= 1 | 76 | retries -= 1 |
77 | if (os.path.exists(path)): | 77 | if (os.path.exists(path)): |
78 | test.p ("Failed to remove " + path) | 78 | test.p("Failed to remove " + path) |
79 | |||
80 | 79 | ||
81 | retries = 10 | 80 | retries = 10 |
82 | path = os.path.join (tmp, "c_no_nat_client") | 81 | path = os.path.join(tmp, "c_no_nat_client") |
83 | test.p ("Removing " + path) | 82 | test.p("Removing " + path) |
84 | while ((os.path.exists(path)) and (retries > 0)): | 83 | while ((os.path.exists(path)) and (retries > 0)): |
85 | shutil.rmtree ((path), False, cleanup_onerror) | 84 | shutil.rmtree((path), False, cleanup_onerror) |
86 | time.sleep (1) | 85 | time.sleep(1) |
87 | retries -= 1 | 86 | retries -= 1 |
88 | if (os.path.exists(path)): | 87 | if (os.path.exists(path)): |
89 | test.p ("Failed to remove " + path) | 88 | test.p("Failed to remove " + path) |
89 | |||
90 | 90 | ||
91 | def success_restart_cont (check): | 91 | def success_restart_cont(check): |
92 | global success | 92 | global success |
93 | print('Peers connected successfully after restart') | 93 | print('Peers connected successfully after restart') |
94 | server.stop () | 94 | server.stop() |
95 | client.stop () | 95 | client.stop() |
96 | success = True; | 96 | success = True |
97 | 97 | ||
98 | 98 | ||
99 | def fail_restart_cont (check): | 99 | def fail_restart_cont(check): |
100 | global success | 100 | global success |
101 | success = False; | 101 | success = False |
102 | print('Peers failed to connect after restart') | 102 | print('Peers failed to connect after restart') |
103 | check.evaluate(True) | 103 | check.evaluate(True) |
104 | 104 | ||
105 | 105 | ||
106 | def success_connect_cont (check): | 106 | def success_connect_cont(check): |
107 | print('Peers connected successfully') | 107 | print('Peers connected successfully') |
108 | server.stop () | 108 | server.stop() |
109 | client.stop () | 109 | client.stop() |
110 | 110 | ||
111 | time.sleep(5) | 111 | time.sleep(5) |
112 | 112 | ||
113 | test.p ('Restarting client & server') | 113 | test.p('Restarting client & server') |
114 | server.start () | 114 | server.start() |
115 | client.start () | 115 | client.start() |
116 | 116 | ||
117 | check = Check (test) | 117 | check = Check(test) |
118 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) | 118 | check.add(StatisticsCondition(client, 'transport', '# peers connected', 1)) |
119 | check.add (StatisticsCondition (client, 'core', '# peers connected',1)) | 119 | check.add(StatisticsCondition(client, 'core', '# peers connected', 1)) |
120 | check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) | 120 | check.add(StatisticsCondition(client, 'topology', '# peers connected', 1)) |
121 | check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) | 121 | check.add(StatisticsCondition(client, 'fs', '# peers connected', 1)) |
122 | 122 | ||
123 | check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) | 123 | check.add(StatisticsCondition(server, 'transport', '# peers connected', 1)) |
124 | check.add (StatisticsCondition (server, 'core', '# peers connected',1)) | 124 | check.add(StatisticsCondition(server, 'core', '# peers connected', 1)) |
125 | check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) | 125 | check.add(StatisticsCondition(server, 'topology', '# peers connected', 1)) |
126 | check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) | 126 | check.add(StatisticsCondition(server, 'fs', '# peers connected', 1)) |
127 | 127 | ||
128 | check.run_blocking (check_timeout, success_restart_cont, fail_restart_cont) | 128 | check.run_blocking(check_timeout, success_restart_cont, fail_restart_cont) |
129 | 129 | ||
130 | 130 | ||
131 | def fail_connect_cont (check): | 131 | def fail_connect_cont(check): |
132 | global success | 132 | global success |
133 | success= False; | 133 | success = False |
134 | print('Peers failed to connect') | 134 | print('Peers failed to connect') |
135 | check.evaluate(True) | 135 | check.evaluate(True) |
136 | 136 | ||
137 | 137 | ||
138 | def check_connect (): | 138 | def check_connect(): |
139 | check = Check (test) | 139 | check = Check(test) |
140 | check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) | 140 | check.add(StatisticsCondition(client, 'transport', '# peers connected', 1)) |
141 | check.add (StatisticsCondition (client, 'core', '# peers connected',1)) | 141 | check.add(StatisticsCondition(client, 'core', '# peers connected', 1)) |
142 | check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) | 142 | check.add(StatisticsCondition(client, 'topology', '# peers connected', 1)) |
143 | check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) | 143 | check.add(StatisticsCondition(client, 'fs', '# peers connected', 1)) |
144 | 144 | ||
145 | check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) | 145 | check.add(StatisticsCondition(server, 'transport', '# peers connected', 1)) |
146 | check.add (StatisticsCondition (server, 'core', '# peers connected',1)) | 146 | check.add(StatisticsCondition(server, 'core', '# peers connected', 1)) |
147 | check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) | 147 | check.add(StatisticsCondition(server, 'topology', '# peers connected', 1)) |
148 | check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) | 148 | check.add(StatisticsCondition(server, 'fs', '# peers connected', 1)) |
149 | |||
150 | check.run_blocking(check_timeout, success_connect_cont, fail_connect_cont) | ||
149 | 151 | ||
150 | check.run_blocking (check_timeout, success_connect_cont, fail_connect_cont) | ||
151 | 152 | ||
152 | # | 153 | # |
153 | # Test execution | 154 | # Test execution |
154 | # | 155 | # |
155 | 156 | ||
156 | 157 | ||
157 | def SigHandler(signum = None, frame = None): | 158 | def SigHandler(signum=None, frame=None): |
158 | global success | 159 | global success |
159 | global server | 160 | global server |
160 | global client | 161 | global client |
161 | |||
162 | print('Test was aborted!') | ||
163 | if (None != server): | ||
164 | server.stop () | ||
165 | if (None != client): | ||
166 | client.stop () | ||
167 | cleanup () | ||
168 | sys.exit(success) | ||
169 | 162 | ||
170 | def run (): | 163 | print('Test was aborted!') |
171 | global success | 164 | if (None != server): |
172 | global test | 165 | server.stop() |
173 | global server | 166 | if (None != client): |
174 | global client | 167 | client.stop() |
168 | cleanup() | ||
169 | sys.exit(success) | ||
175 | 170 | ||
176 | success = False | ||
177 | server = None | ||
178 | client = None | ||
179 | 171 | ||
180 | for sig in signals: | 172 | def run(): |
181 | signal.signal(sig, SigHandler) | 173 | global success |
174 | global test | ||
175 | global server | ||
176 | global client | ||
182 | 177 | ||
178 | success = False | ||
179 | server = None | ||
180 | client = None | ||
183 | 181 | ||
184 | test = Test ('test_integration_disconnect', verbose) | 182 | for sig in signals: |
185 | cleanup () | 183 | signal.signal(sig, SigHandler) |
186 | server = Peer(test, './confs/c_bootstrap_server.conf'); | ||
187 | server.start(); | ||
188 | 184 | ||
189 | client = Peer(test, './confs/c_no_nat_client.conf'); | 185 | test = Test('test_integration_disconnect', verbose) |
190 | client.start(); | 186 | cleanup() |
187 | server = Peer(test, './confs/c_bootstrap_server.conf') | ||
188 | server.start() | ||
191 | 189 | ||
190 | client = Peer(test, './confs/c_no_nat_client.conf') | ||
191 | client.start() | ||
192 | 192 | ||
193 | if (True != server.start()): | 193 | if (True != server.start()): |
194 | print('Failed to start server') | 194 | print('Failed to start server') |
195 | if (None != server): | 195 | if (None != server): |
196 | server.stop () | 196 | server.stop() |
197 | if (None != server): | 197 | if (None != server): |
198 | client.stop () | 198 | client.stop() |
199 | cleanup () | 199 | cleanup() |
200 | sys.exit(success) | 200 | sys.exit(success) |
201 | 201 | ||
202 | # Give the server time to start | 202 | # Give the server time to start |
203 | time.sleep(5) | 203 | time.sleep(5) |
204 | 204 | ||
205 | if (True != client.start()): | 205 | if (True != client.start()): |
206 | print('Failed to start client') | 206 | print('Failed to start client') |
207 | if (None != server): | 207 | if (None != server): |
208 | server.stop () | 208 | server.stop() |
209 | if (None != server): | 209 | if (None != server): |
210 | client.stop () | 210 | client.stop() |
211 | cleanup () | 211 | cleanup() |
212 | sys.exit(success) | 212 | sys.exit(success) |
213 | 213 | ||
214 | check_connect () | 214 | check_connect() |
215 | 215 | ||
216 | server.stop () | 216 | server.stop() |
217 | client.stop () | 217 | client.stop() |
218 | cleanup () | 218 | cleanup() |
219 | 219 | ||
220 | if (success == False): | 220 | if (success == False): |
221 | print ('Test failed') | 221 | print('Test failed') |
222 | return True | 222 | return True |
223 | else: | 223 | else: |
224 | return False | 224 | return False |
225 | 225 | ||
226 | 226 | ||
227 | try: | 227 | try: |
228 | run () | 228 | run() |
229 | except (KeyboardInterrupt, SystemExit): | 229 | except (KeyboardInterrupt, SystemExit): |
230 | print('Test interrupted') | 230 | print('Test interrupted') |
231 | server.stop () | 231 | server.stop() |
232 | client.stop () | 232 | client.stop() |
233 | cleanup () | 233 | cleanup() |
234 | if (success == False): | 234 | if (success == False): |
235 | sys.exit(1) | 235 | sys.exit(1) |
236 | else: | 236 | else: |
237 | sys.exit(0) | 237 | 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 45626d50d..751a0484b 100755 --- a/src/integration-tests/test_integration_reconnect_nat.py.in +++ b/src/integration-tests/test_integration_reconnect_nat.py.in | |||
@@ -32,7 +32,6 @@ from gnunet_testing import Check | |||
32 | from gnunet_testing import Condition | 32 | from gnunet_testing import Condition |
33 | from gnunet_testing import * | 33 | from gnunet_testing import * |
34 | 34 | ||
35 | |||
36 | # | 35 | # |
37 | # This test tests if a fresh peer bootstraps from a hostlist server and then | 36 | # This test tests if a fresh peer bootstraps from a hostlist server and then |
38 | # successfully connects to the server. When both peers are connected | 37 | # successfully connects to the server. When both peers are connected |
@@ -43,7 +42,6 @@ from gnunet_testing import * | |||
43 | 42 | ||
44 | # definitions | 43 | # definitions |
45 | 44 | ||
46 | |||
47 | testname = "test_integration_restart" | 45 | testname = "test_integration_restart" |
48 | verbose = True | 46 | verbose = True |
49 | check_timeout = 180 | 47 | check_timeout = 180 |
@@ -82,7 +80,7 @@ def cleanup(): | |||
82 | retries = 10 | 80 | retries = 10 |
83 | path = os.path.join(tmp, "c_nat_client") | 81 | path = os.path.join(tmp, "c_nat_client") |
84 | test.p("Removing " + path) | 82 | test.p("Removing " + path) |
85 | while((os.path.exists(path)) and(retries > 0)): | 83 | while ((os.path.exists(path)) and (retries > 0)): |
86 | shutil.rmtree((path), False, cleanup_onerror) | 84 | shutil.rmtree((path), False, cleanup_onerror) |
87 | time.sleep(1) | 85 | time.sleep(1) |
88 | retries -= 1 | 86 | retries -= 1 |
@@ -91,18 +89,18 @@ def cleanup(): | |||
91 | 89 | ||
92 | 90 | ||
93 | def success_restart_cont(check): | 91 | def success_restart_cont(check): |
94 | global success | 92 | global success |
95 | print('Peers connected successfully after restart') | 93 | print('Peers connected successfully after restart') |
96 | server.stop() | 94 | server.stop() |
97 | client.stop() | 95 | client.stop() |
98 | success = True | 96 | success = True |
99 | 97 | ||
100 | 98 | ||
101 | def fail_restart_cont(check): | 99 | def fail_restart_cont(check): |
102 | global success | 100 | global success |
103 | success = False | 101 | success = False |
104 | print('Peers failed to connect after restart') | 102 | print('Peers failed to connect after restart') |
105 | check.evaluate(True) | 103 | check.evaluate(True) |
106 | 104 | ||
107 | 105 | ||
108 | def success_connect_cont(check): | 106 | def success_connect_cont(check): |
@@ -151,6 +149,7 @@ def check_connect(): | |||
151 | 149 | ||
152 | check.run_blocking(check_timeout, success_connect_cont, fail_connect_cont) | 150 | check.run_blocking(check_timeout, success_connect_cont, fail_connect_cont) |
153 | 151 | ||
152 | |||
154 | # | 153 | # |
155 | # Test execution | 154 | # Test execution |
156 | # | 155 | # |
@@ -227,7 +226,7 @@ def run(): | |||
227 | 226 | ||
228 | try: | 227 | try: |
229 | run() | 228 | run() |
230 | except(KeyboardInterrupt, SystemExit): | 229 | except (KeyboardInterrupt, SystemExit): |
231 | print('Test interrupted') | 230 | print('Test interrupted') |
232 | server.stop() | 231 | server.stop() |
233 | client.stop() | 232 | client.stop() |
diff --git a/src/namecache/Makefile.am b/src/namecache/Makefile.am index 8abae68a4..5e80ea4c5 100644 --- a/src/namecache/Makefile.am +++ b/src/namecache/Makefile.am | |||
@@ -68,7 +68,7 @@ libgnunetnamecache_la_LIBADD = \ | |||
68 | $(top_builddir)/src/util/libgnunetutil.la \ | 68 | $(top_builddir)/src/util/libgnunetutil.la \ |
69 | $(GN_LIBINTL) | 69 | $(GN_LIBINTL) |
70 | libgnunetnamecache_la_LDFLAGS = \ | 70 | libgnunetnamecache_la_LDFLAGS = \ |
71 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 71 | $(GN_LIB_LDFLAGS) \ |
72 | -version-info 0:0:0 | 72 | -version-info 0:0:0 |
73 | 73 | ||
74 | 74 | ||
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am index 646effd9b..12d730f36 100644 --- a/src/namestore/Makefile.am +++ b/src/namestore/Makefile.am | |||
@@ -154,7 +154,7 @@ libgnunetnamestore_la_LIBADD = \ | |||
154 | $(top_builddir)/src/util/libgnunetutil.la \ | 154 | $(top_builddir)/src/util/libgnunetutil.la \ |
155 | $(GN_LIBINTL) | 155 | $(GN_LIBINTL) |
156 | libgnunetnamestore_la_LDFLAGS = \ | 156 | libgnunetnamestore_la_LDFLAGS = \ |
157 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 157 | $(GN_LIB_LDFLAGS) \ |
158 | -version-info 0:1:0 | 158 | -version-info 0:1:0 |
159 | 159 | ||
160 | 160 | ||
diff --git a/src/nat-auto/Makefile.am b/src/nat-auto/Makefile.am index 14f3f2330..e42ce9491 100644 --- a/src/nat-auto/Makefile.am +++ b/src/nat-auto/Makefile.am | |||
@@ -43,7 +43,7 @@ libgnunetnatauto_la_LIBADD = \ | |||
43 | $(top_builddir)/src/util/libgnunetutil.la \ | 43 | $(top_builddir)/src/util/libgnunetutil.la \ |
44 | $(GN_LIBINTL) @EXT_LIBS@ | 44 | $(GN_LIBINTL) @EXT_LIBS@ |
45 | libgnunetnatauto_la_LDFLAGS = \ | 45 | libgnunetnatauto_la_LDFLAGS = \ |
46 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 46 | $(GN_LIB_LDFLAGS) \ |
47 | -version-info 0:0:0 | 47 | -version-info 0:0:0 |
48 | 48 | ||
49 | gnunet_service_nat_auto_SOURCES = \ | 49 | gnunet_service_nat_auto_SOURCES = \ |
diff --git a/src/nat/Makefile.am b/src/nat/Makefile.am index db104d194..63a11f1fe 100644 --- a/src/nat/Makefile.am +++ b/src/nat/Makefile.am | |||
@@ -12,15 +12,11 @@ if LINUX | |||
12 | NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client | 12 | NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client |
13 | NATSERVER = gnunet-helper-nat-server.c | 13 | NATSERVER = gnunet-helper-nat-server.c |
14 | NATCLIENT = gnunet-helper-nat-client.c | 14 | NATCLIENT = gnunet-helper-nat-client.c |
15 | install-exec-hook: | ||
16 | $(top_srcdir)/src/nat/install-nat-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true | ||
17 | else | 15 | else |
18 | if XFREEBSD | 16 | if XFREEBSD |
19 | NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client | 17 | NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client |
20 | NATSERVER = gnunet-helper-nat-server.c | 18 | NATSERVER = gnunet-helper-nat-server.c |
21 | NATCLIENT = gnunet-helper-nat-client.c | 19 | NATCLIENT = gnunet-helper-nat-client.c |
22 | install-exec-hook: | ||
23 | $(top_srcdir)/src/nat/install-nat-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true | ||
24 | endif | 20 | endif |
25 | else | 21 | else |
26 | install-exec-hook: | 22 | install-exec-hook: |
@@ -53,7 +49,7 @@ if USE_COVERAGE | |||
53 | endif | 49 | endif |
54 | 50 | ||
55 | lib_LTLIBRARIES = \ | 51 | lib_LTLIBRARIES = \ |
56 | libgnunetnatnew.la | 52 | libgnunetnatnew.la |
57 | 53 | ||
58 | libgnunetnatnew_la_SOURCES = \ | 54 | libgnunetnatnew_la_SOURCES = \ |
59 | nat_api.c \ | 55 | nat_api.c \ |
@@ -61,9 +57,9 @@ libgnunetnatnew_la_SOURCES = \ | |||
61 | nat.h | 57 | nat.h |
62 | libgnunetnatnew_la_LIBADD = \ | 58 | libgnunetnatnew_la_LIBADD = \ |
63 | $(top_builddir)/src/util/libgnunetutil.la \ | 59 | $(top_builddir)/src/util/libgnunetutil.la \ |
64 | $(GN_LIBINTL) @EXT_LIBS@ | 60 | $(GN_LIBINTL) @EXT_LIBS@ |
65 | libgnunetnatnew_la_LDFLAGS = \ | 61 | libgnunetnatnew_la_LDFLAGS = \ |
66 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 62 | $(GN_LIB_LDFLAGS) \ |
67 | -version-info 2:0:0 | 63 | -version-info 2:0:0 |
68 | 64 | ||
69 | gnunet_service_nat_SOURCES = \ | 65 | gnunet_service_nat_SOURCES = \ |
@@ -94,25 +90,25 @@ endif | |||
94 | # test_nat.c | 90 | # test_nat.c |
95 | #test_nat_LDADD = \ | 91 | #test_nat_LDADD = \ |
96 | # libgnunetnat.la \ | 92 | # libgnunetnat.la \ |
97 | # $(top_builddir)/src/util/libgnunetutil.la | 93 | # $(top_builddir)/src/util/libgnunetutil.la |
98 | 94 | ||
99 | #test_nat_mini_SOURCES = \ | 95 | #test_nat_mini_SOURCES = \ |
100 | # test_nat_mini.c | 96 | # test_nat_mini.c |
101 | #test_nat_mini_LDADD = \ | 97 | #test_nat_mini_LDADD = \ |
102 | # libgnunetnat.la \ | 98 | # libgnunetnat.la \ |
103 | # $(top_builddir)/src/util/libgnunetutil.la | 99 | # $(top_builddir)/src/util/libgnunetutil.la |
104 | 100 | ||
105 | #test_nat_test_SOURCES = \ | 101 | #test_nat_test_SOURCES = \ |
106 | # test_nat_test.c | 102 | # test_nat_test.c |
107 | #test_nat_test_LDADD = \ | 103 | #test_nat_test_LDADD = \ |
108 | # libgnunetnat.la \ | 104 | # libgnunetnat.la \ |
109 | # $(top_builddir)/src/util/libgnunetutil.la | 105 | # $(top_builddir)/src/util/libgnunetutil.la |
110 | 106 | ||
111 | #test_stun_SOURCES = \ | 107 | #test_stun_SOURCES = \ |
112 | # test_stun.c | 108 | # test_stun.c |
113 | #test_stun_LDADD = \ | 109 | #test_stun_LDADD = \ |
114 | # libgnunetnat.la \ | 110 | # libgnunetnat.la \ |
115 | # $(top_builddir)/src/util/libgnunetutil.la | 111 | # $(top_builddir)/src/util/libgnunetutil.la |
116 | 112 | ||
117 | EXTRA_DIST = \ | 113 | EXTRA_DIST = \ |
118 | test_nat_data.conf \ | 114 | test_nat_data.conf \ |
diff --git a/src/nat/install-nat-helper.sh b/src/nat/install-nat-helper.sh deleted file mode 100755 index d5ee91fa3..000000000 --- a/src/nat/install-nat-helper.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # $1 - bindir | ||
3 | # $2 - sudo binary (optional) | ||
4 | $2 chown root:root $1/gnunet-helper-nat-server $1/gnunet-helper-nat-client || true | ||
5 | $2 chmod u+s $1/gnunet-helper-nat-server $1/gnunet-helper-nat-client || true | ||
diff --git a/src/nse/Makefile.am b/src/nse/Makefile.am index 3a79cdd97..85ae4d3be 100644 --- a/src/nse/Makefile.am +++ b/src/nse/Makefile.am | |||
@@ -29,7 +29,7 @@ libgnunetnse_la_LIBADD = \ | |||
29 | $(top_builddir)/src/util/libgnunetutil.la \ | 29 | $(top_builddir)/src/util/libgnunetutil.la \ |
30 | $(GN_LIBINTL) $(XLIB) | 30 | $(GN_LIBINTL) $(XLIB) |
31 | libgnunetnse_la_LDFLAGS = \ | 31 | libgnunetnse_la_LDFLAGS = \ |
32 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 32 | $(GN_LIB_LDFLAGS) \ |
33 | -version-info 0:0:0 | 33 | -version-info 0:0:0 |
34 | 34 | ||
35 | 35 | ||
diff --git a/src/peerinfo-tool/test_gnunet_peerinfo.py.in b/src/peerinfo-tool/test_gnunet_peerinfo.py.in index d07224b14..5d9daa930 100755 --- a/src/peerinfo-tool/test_gnunet_peerinfo.py.in +++ b/src/peerinfo-tool/test_gnunet_peerinfo.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -43,53 +43,94 @@ elif os.name == 'nt': | |||
43 | 43 | ||
44 | pinfo = pexpect() | 44 | pinfo = pexpect() |
45 | 45 | ||
46 | |||
47 | if os.name == "nt": | 46 | if os.name == "nt": |
48 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-peerinfo"), True) | 47 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-peerinfo"), True) |
49 | else: | 48 | else: |
50 | shutil.rmtree("/tmp/gnunet-test-peerinfo", True) | 49 | shutil.rmtree("/tmp/gnunet-test-peerinfo", True) |
51 | 50 | ||
52 | # create hostkey via testing lib # FIXME: The /tmp/ location needs to be adjusted to the TMP variable! | 51 | # create hostkey via testing lib # FIXME: The /tmp/ location needs to be adjusted to the TMP variable! |
53 | hkk = subprocess.Popen([gnunettesting, '-n', '1', '-c', 'test_gnunet_peerinfo_data.conf', '-k', '/tmp/gnunet-test-peerinfo/.hostkey']) | 52 | hkk = subprocess.Popen([ |
53 | gnunettesting, '-n', '1', '-c', 'test_gnunet_peerinfo_data.conf', '-k', | ||
54 | '/tmp/gnunet-test-peerinfo/.hostkey' | ||
55 | ]) | ||
54 | hkk.communicate() | 56 | hkk.communicate() |
55 | 57 | ||
56 | arm = subprocess.Popen([gnunetarm, '-sq', '-c', 'test_gnunet_peerinfo_data.conf']) | 58 | arm = subprocess.Popen([ |
59 | gnunetarm, '-sq', '-c', 'test_gnunet_peerinfo_data.conf' | ||
60 | ]) | ||
57 | arm.communicate() | 61 | arm.communicate() |
58 | 62 | ||
59 | try: | 63 | try: |
60 | pinfo.spawn(None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-s'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 64 | pinfo.spawn( |
65 | None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-s'], | ||
66 | stdout=subprocess.PIPE, | ||
67 | stderr=subprocess.STDOUT | ||
68 | ) | ||
61 | pinfo.expect("stdout", re.compile(r'I am peer `.*\'.\r?\n')) | 69 | pinfo.expect("stdout", re.compile(r'I am peer `.*\'.\r?\n')) |
62 | 70 | ||
63 | pinfo.spawn(None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-qs'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 71 | pinfo.spawn( |
64 | pinfo.expect("stdout", re.compile(r'....................................................\r?\n')) | 72 | None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-qs'], |
65 | 73 | stdout=subprocess.PIPE, | |
66 | pinfo.spawn(None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', 'invalid'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 74 | stderr=subprocess.STDOUT |
67 | pinfo.expect("stdout", re.compile(r'Invalid command line argument `invalid\'\r?\n')) | 75 | ) |
68 | 76 | pinfo.expect( | |
69 | arm = subprocess.Popen([gnunetarm, '-q', '-i', 'transport', '-c', 'test_gnunet_peerinfo_data.conf']) | 77 | "stdout", |
78 | re. | ||
79 | compile(r'....................................................\r?\n') | ||
80 | ) | ||
81 | |||
82 | pinfo.spawn( | ||
83 | None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', 'invalid'], | ||
84 | stdout=subprocess.PIPE, | ||
85 | stderr=subprocess.STDOUT | ||
86 | ) | ||
87 | pinfo.expect( | ||
88 | "stdout", re.compile(r'Invalid command line argument `invalid\'\r?\n') | ||
89 | ) | ||
90 | |||
91 | arm = subprocess.Popen([ | ||
92 | gnunetarm, '-q', '-i', 'transport', '-c', | ||
93 | 'test_gnunet_peerinfo_data.conf' | ||
94 | ]) | ||
70 | arm.communicate() | 95 | arm.communicate() |
71 | time.sleep(1) | 96 | time.sleep(1) |
72 | 97 | ||
73 | pinfo.spawn(None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 98 | pinfo.spawn( |
99 | None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf'], | ||
100 | stdout=subprocess.PIPE, | ||
101 | stderr=subprocess.STDOUT | ||
102 | ) | ||
74 | pinfo.expect("stdout", re.compile("Peer `.*'\r?\n")) | 103 | pinfo.expect("stdout", re.compile("Peer `.*'\r?\n")) |
75 | m = pinfo.expect("stdout", re.compile("\s.*:24357\r?\n")) | 104 | m = pinfo.expect("stdout", re.compile("\s.*:24357\r?\n")) |
76 | while len(m.group(0)) > 0: | 105 | while len(m.group(0)) > 0: |
77 | m = pinfo.expect("stdout", re.compile("(\s.*:24357\r?\n|\r?\n|)")) | 106 | m = pinfo.expect("stdout", re.compile("(\s.*:24357\r?\n|\r?\n|)")) |
78 | 107 | ||
79 | pinfo.spawn(None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-n'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 108 | pinfo.spawn( |
109 | None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', '-n'], | ||
110 | stdout=subprocess.PIPE, | ||
111 | stderr=subprocess.STDOUT | ||
112 | ) | ||
80 | pinfo.expect("stdout", re.compile("Peer `.*'\r?\n")) | 113 | pinfo.expect("stdout", re.compile("Peer `.*'\r?\n")) |
81 | m = pinfo.expect("stdout", re.compile("\s.*:24357\r?\n")) | 114 | m = pinfo.expect("stdout", re.compile("\s.*:24357\r?\n")) |
82 | while len(m.group(0)) > 0: | 115 | while len(m.group(0)) > 0: |
83 | m = pinfo.expect("stdout", re.compile("(\s.*:24357\r?\n|\r?\n|)")) | 116 | m = pinfo.expect("stdout", re.compile("(\s.*:24357\r?\n|\r?\n|)")) |
84 | 117 | ||
85 | pinfo.spawn(None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-qs'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 118 | pinfo.spawn( |
119 | None, [peerinfo, '-c', 'test_gnunet_peerinfo_data.conf', '-qs'], | ||
120 | stdout=subprocess.PIPE, | ||
121 | stderr=subprocess.STDOUT | ||
122 | ) | ||
86 | pid = pinfo.read("stdout") | 123 | pid = pinfo.read("stdout") |
87 | pid.strip() | 124 | pid.strip() |
88 | 125 | ||
89 | finally: | 126 | finally: |
90 | arm = subprocess.Popen([gnunetarm, '-eq', '-c', 'test_gnunet_peerinfo_data.conf']) | 127 | arm = subprocess.Popen([ |
128 | gnunetarm, '-eq', '-c', 'test_gnunet_peerinfo_data.conf' | ||
129 | ]) | ||
91 | arm.communicate() | 130 | arm.communicate() |
92 | if os.name == "nt": | 131 | if os.name == "nt": |
93 | shutil.rmtree(os.path.join(os.getenv("TEMP"), "gnunet-test-peerinfo"), True) | 132 | shutil.rmtree( |
133 | os.path.join(os.getenv("TEMP"), "gnunet-test-peerinfo"), True | ||
134 | ) | ||
94 | else: | 135 | else: |
95 | shutil.rmtree("/tmp/gnunet-test-peerinfo", True) | 136 | shutil.rmtree("/tmp/gnunet-test-peerinfo", True) |
diff --git a/src/peerinfo/Makefile.am b/src/peerinfo/Makefile.am index 7d1204100..831162366 100644 --- a/src/peerinfo/Makefile.am +++ b/src/peerinfo/Makefile.am | |||
@@ -27,7 +27,7 @@ libgnunetpeerinfo_la_LIBADD = \ | |||
27 | $(XLIB) \ | 27 | $(XLIB) \ |
28 | $(LTLIBINTL) | 28 | $(LTLIBINTL) |
29 | libgnunetpeerinfo_la_LDFLAGS = \ | 29 | libgnunetpeerinfo_la_LDFLAGS = \ |
30 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 30 | $(GN_LIB_LDFLAGS) \ |
31 | -version-info 0:0:0 | 31 | -version-info 0:0:0 |
32 | 32 | ||
33 | 33 | ||
diff --git a/src/reclaim-attribute/Makefile.am b/src/reclaim-attribute/Makefile.am index cbbcb37d6..490e77398 100644 --- a/src/reclaim-attribute/Makefile.am +++ b/src/reclaim-attribute/Makefile.am | |||
@@ -22,7 +22,7 @@ libgnunetreclaimattribute_la_LIBADD = \ | |||
22 | $(top_builddir)/src/util/libgnunetutil.la \ | 22 | $(top_builddir)/src/util/libgnunetutil.la \ |
23 | $(GN_LIBINTL) | 23 | $(GN_LIBINTL) |
24 | libgnunetreclaimattribute_la_LDFLAGS = \ | 24 | libgnunetreclaimattribute_la_LDFLAGS = \ |
25 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 25 | $(GN_LIB_LDFLAGS) \ |
26 | -version-info 0:0:0 | 26 | -version-info 0:0:0 |
27 | 27 | ||
28 | 28 | ||
diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am index 851b0d71e..51b9b9c5b 100644 --- a/src/reclaim/Makefile.am +++ b/src/reclaim/Makefile.am | |||
@@ -111,7 +111,7 @@ libgnunetreclaim_la_LIBADD = \ | |||
111 | $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \ | 111 | $(top_builddir)/src/reclaim-attribute/libgnunetreclaimattribute.la \ |
112 | $(GN_LIBINTL) $(XLIB) | 112 | $(GN_LIBINTL) $(XLIB) |
113 | libgnunetreclaim_la_LDFLAGS = \ | 113 | libgnunetreclaim_la_LDFLAGS = \ |
114 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 114 | $(GN_LIB_LDFLAGS) \ |
115 | -version-info 0:0:0 | 115 | -version-info 0:0:0 |
116 | 116 | ||
117 | gnunet_reclaim_SOURCES = \ | 117 | gnunet_reclaim_SOURCES = \ |
diff --git a/src/regex/Makefile.am b/src/regex/Makefile.am index ba5e0af00..2fd00dd09 100644 --- a/src/regex/Makefile.am +++ b/src/regex/Makefile.am | |||
@@ -45,7 +45,7 @@ libgnunetregexblock_la_LIBADD = \ | |||
45 | $(XLIB) \ | 45 | $(XLIB) \ |
46 | $(LTLIBINTL) | 46 | $(LTLIBINTL) |
47 | libgnunetregexblock_la_LDFLAGS = \ | 47 | libgnunetregexblock_la_LDFLAGS = \ |
48 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 48 | $(GN_LIB_LDFLAGS) \ |
49 | -version-info 1:0:0 | 49 | -version-info 1:0:0 |
50 | 50 | ||
51 | 51 | ||
diff --git a/src/rest/rest.conf b/src/rest/rest.conf index 2b690b5b3..0d6e33ada 100644 --- a/src/rest/rest.conf +++ b/src/rest/rest.conf | |||
@@ -9,3 +9,4 @@ REST_ALLOW_HEADERS=Authorization,Accept,Content-Type | |||
9 | REST_ECHO_ORIGIN_WEBEXT=YES | 9 | REST_ECHO_ORIGIN_WEBEXT=YES |
10 | REST_ALLOW_ORIGIN=http://localhost:4200 | 10 | REST_ALLOW_ORIGIN=http://localhost:4200 |
11 | REST_ALLOW_CREDENTIALS=true | 11 | REST_ALLOW_CREDENTIALS=true |
12 | RUN_PER_USER=YES | ||
diff --git a/src/revocation/Makefile.am b/src/revocation/Makefile.am index a6fff3524..5e48fb29f 100644 --- a/src/revocation/Makefile.am +++ b/src/revocation/Makefile.am | |||
@@ -50,7 +50,7 @@ libgnunetrevocation_la_LIBADD = \ | |||
50 | $(LIBGCRYPT_LIBS) \ | 50 | $(LIBGCRYPT_LIBS) \ |
51 | $(GN_LIBINTL) $(XLIB) -lgcrypt | 51 | $(GN_LIBINTL) $(XLIB) -lgcrypt |
52 | libgnunetrevocation_la_LDFLAGS = \ | 52 | libgnunetrevocation_la_LDFLAGS = \ |
53 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 53 | $(GN_LIB_LDFLAGS) \ |
54 | -version-info 0:0:0 | 54 | -version-info 0:0:0 |
55 | 55 | ||
56 | libexec_PROGRAMS = \ | 56 | libexec_PROGRAMS = \ |
diff --git a/src/revocation/test_local_revocation.py.in b/src/revocation/test_local_revocation.py.in index 4cc6119ca..d73d0a869 100644 --- a/src/revocation/test_local_revocation.py.in +++ b/src/revocation/test_local_revocation.py.in | |||
@@ -11,7 +11,7 @@ | |||
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | # Affero General Public License for more details. | 13 | # Affero General Public License for more details. |
14 | # | 14 | # |
15 | # You should have received a copy of the GNU Affero General Public License | 15 | # You should have received a copy of the GNU Affero General Public License |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | # | 17 | # |
@@ -39,7 +39,10 @@ elif os.name == 'nt': | |||
39 | TEST_CONFIGURATION = "test_revocation.conf" | 39 | TEST_CONFIGURATION = "test_revocation.conf" |
40 | TEST_REVOCATION_EGO = "revoc_test" | 40 | TEST_REVOCATION_EGO = "revoc_test" |
41 | 41 | ||
42 | get_clean = subprocess.Popen([config, '-c', TEST_CONFIGURATION, '-s', 'PATHS', '-o', 'GNUNET_HOME', '-f'], stdout=subprocess.PIPE) | 42 | get_clean = subprocess.Popen([ |
43 | config, '-c', TEST_CONFIGURATION, '-s', 'PATHS', '-o', 'GNUNET_HOME', '-f' | ||
44 | ], | ||
45 | stdout=subprocess.PIPE) | ||
43 | cleandir, x = get_clean.communicate() | 46 | cleandir, x = get_clean.communicate() |
44 | cleandir = cleandir.decode("utf-8") | 47 | cleandir = cleandir.decode("utf-8") |
45 | cleandir = cleandir.rstrip('\n').rstrip('\r') | 48 | cleandir = cleandir.rstrip('\n').rstrip('\r') |
@@ -55,10 +58,15 @@ try: | |||
55 | print("Creating an ego " + TEST_REVOCATION_EGO) | 58 | print("Creating an ego " + TEST_REVOCATION_EGO) |
56 | sys.stdout.flush() | 59 | sys.stdout.flush() |
57 | sys.stderr.flush() | 60 | sys.stderr.flush() |
58 | idc = subprocess.Popen([ident, '-C', TEST_REVOCATION_EGO, '-c', TEST_CONFIGURATION]) | 61 | idc = subprocess.Popen([ |
62 | ident, '-C', TEST_REVOCATION_EGO, '-c', TEST_CONFIGURATION | ||
63 | ]) | ||
59 | idc.communicate() | 64 | idc.communicate() |
60 | if idc.returncode != 0: | 65 | if idc.returncode != 0: |
61 | raise Exception("gnunet-identity failed to create an ego `" + TEST_REVOCATION_EGO + "'") | 66 | raise Exception( |
67 | "gnunet-identity failed to create an ego `" + TEST_REVOCATION_EGO + | ||
68 | "'" | ||
69 | ) | ||
62 | 70 | ||
63 | sys.stdout.flush() | 71 | sys.stdout.flush() |
64 | sys.stderr.flush() | 72 | sys.stderr.flush() |
@@ -72,11 +80,15 @@ try: | |||
72 | print("Testing key " + rev_key) | 80 | print("Testing key " + rev_key) |
73 | sys.stdout.flush() | 81 | sys.stdout.flush() |
74 | sys.stderr.flush() | 82 | sys.stderr.flush() |
75 | tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], stdout=subprocess.PIPE) | 83 | tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], |
84 | stdout=subprocess.PIPE) | ||
76 | output_not_revoked, x = tst.communicate() | 85 | output_not_revoked, x = tst.communicate() |
77 | output_not_revoked = output_not_revoked.decode("utf-8") | 86 | output_not_revoked = output_not_revoked.decode("utf-8") |
78 | if tst.returncode != 0: | 87 | if tst.returncode != 0: |
79 | raise Exception("gnunet-revocation failed to test a key - " + str(tst.returncode) + ": " + output_not_revoked) | 88 | raise Exception( |
89 | "gnunet-revocation failed to test a key - " + str(tst.returncode) + | ||
90 | ": " + output_not_revoked | ||
91 | ) | ||
80 | if 'valid' not in output_not_revoked: | 92 | if 'valid' not in output_not_revoked: |
81 | res = 1 | 93 | res = 1 |
82 | print("Key was not valid") | 94 | print("Key was not valid") |
@@ -86,7 +98,9 @@ try: | |||
86 | print("Revoking key " + rev_key) | 98 | print("Revoking key " + rev_key) |
87 | sys.stdout.flush() | 99 | sys.stdout.flush() |
88 | sys.stderr.flush() | 100 | sys.stderr.flush() |
89 | rev = subprocess.Popen([revoc, '-R', TEST_REVOCATION_EGO, '-p', '-c', TEST_CONFIGURATION]) | 101 | rev = subprocess.Popen([ |
102 | revoc, '-R', TEST_REVOCATION_EGO, '-p', '-c', TEST_CONFIGURATION | ||
103 | ]) | ||
90 | rev.communicate() | 104 | rev.communicate() |
91 | if rev.returncode != 0: | 105 | if rev.returncode != 0: |
92 | raise Exception("gnunet-revocation failed to revoke a key") | 106 | raise Exception("gnunet-revocation failed to revoke a key") |
@@ -94,7 +108,8 @@ try: | |||
94 | print("Testing revoked key " + rev_key) | 108 | print("Testing revoked key " + rev_key) |
95 | sys.stdout.flush() | 109 | sys.stdout.flush() |
96 | sys.stderr.flush() | 110 | sys.stderr.flush() |
97 | tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], stdout=subprocess.PIPE) | 111 | tst = subprocess.Popen([revoc, '-t', rev_key, '-c', TEST_CONFIGURATION], |
112 | stdout=subprocess.PIPE) | ||
98 | output_revoked, x = tst.communicate() | 113 | output_revoked, x = tst.communicate() |
99 | output_revoked = output_revoked.decode("utf-8") | 114 | output_revoked = output_revoked.decode("utf-8") |
100 | if tst.returncode != 0: | 115 | if tst.returncode != 0: |
diff --git a/src/rps/Makefile.am b/src/rps/Makefile.am index 0c739589f..b9de6b5e3 100644 --- a/src/rps/Makefile.am +++ b/src/rps/Makefile.am | |||
@@ -36,7 +36,7 @@ libgnunetrps_la_LIBADD = \ | |||
36 | $(top_builddir)/src/util/libgnunetutil.la \ | 36 | $(top_builddir)/src/util/libgnunetutil.la \ |
37 | $(GN_LIBINTL) $(XLIB) | 37 | $(GN_LIBINTL) $(XLIB) |
38 | libgnunetrps_la_LDFLAGS = \ | 38 | libgnunetrps_la_LDFLAGS = \ |
39 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 39 | $(GN_LIB_LDFLAGS) \ |
40 | -version-info 0:0:0 | 40 | -version-info 0:0:0 |
41 | # Fix 'created both with libtool and without' error: | 41 | # Fix 'created both with libtool and without' error: |
42 | libgnunetrps_la_CFLAGS = $(AM_CFLAGS) | 42 | libgnunetrps_la_CFLAGS = $(AM_CFLAGS) |
diff --git a/src/statistics/Makefile.am b/src/statistics/Makefile.am index bde35da2d..6d69d58d8 100644 --- a/src/statistics/Makefile.am +++ b/src/statistics/Makefile.am | |||
@@ -21,7 +21,7 @@ libgnunetstatistics_la_LIBADD = \ | |||
21 | $(top_builddir)/src/util/libgnunetutil.la \ | 21 | $(top_builddir)/src/util/libgnunetutil.la \ |
22 | $(GN_LIBINTL) $(XLIB) | 22 | $(GN_LIBINTL) $(XLIB) |
23 | libgnunetstatistics_la_LDFLAGS = \ | 23 | libgnunetstatistics_la_LDFLAGS = \ |
24 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 24 | $(GN_LIB_LDFLAGS) \ |
25 | -version-info 2:0:0 | 25 | -version-info 2:0:0 |
26 | 26 | ||
27 | libexec_PROGRAMS = \ | 27 | libexec_PROGRAMS = \ |
diff --git a/src/statistics/test_gnunet_statistics.py.in b/src/statistics/test_gnunet_statistics.py.in index b14dc9d9e..3a13c24f3 100644 --- a/src/statistics/test_gnunet_statistics.py.in +++ b/src/statistics/test_gnunet_statistics.py.in | |||
@@ -122,7 +122,9 @@ if len([x for x in stdo.splitlines() if re.search(b'42', x)]) != 1: | |||
122 | print("PASS") | 122 | print("PASS") |
123 | 123 | ||
124 | print("TEST: Set persistent value...", end='') | 124 | print("TEST: Set persistent value...", end='') |
125 | rc, stdo, stde = r_st(['-n', 'lasting', '-s', 'subsystem', '40', '-p'], nofail=True, want_stdo=False) | 125 | rc, stdo, stde = r_st(['-n', 'lasting', '-s', 'subsystem', '40', '-p'], |
126 | nofail=True, | ||
127 | want_stdo=False) | ||
126 | rc, stdo, stde = r_st([], nofail=True, want_stdo=True) | 128 | rc, stdo, stde = r_st([], nofail=True, want_stdo=True) |
127 | if len([x for x in stdo.splitlines() if re.search(b'40', x)]) != 1: | 129 | if len([x for x in stdo.splitlines() if re.search(b'40', x)]) != 1: |
128 | fail("FAIL: unexpected output:\n{}".format(stdo)) | 130 | fail("FAIL: unexpected output:\n{}".format(stdo)) |
@@ -137,7 +139,9 @@ if len([x for x in stdo.splitlines() if re.search(b'40', x)]) != 1: | |||
137 | print("PASS") | 139 | print("PASS") |
138 | 140 | ||
139 | print("TEST: Removing persistence...", end='') | 141 | print("TEST: Removing persistence...", end='') |
140 | rc, stdo, stde = r_st(['-n', 'lasting', '-s', 'subsystem', '40'], nofail=True, want_stdo=False) | 142 | rc, stdo, stde = r_st(['-n', 'lasting', '-s', 'subsystem', '40'], |
143 | nofail=True, | ||
144 | want_stdo=False) | ||
141 | rc, stdo, stde = r_st([], nofail=True, want_stdo=True) | 145 | rc, stdo, stde = r_st([], nofail=True, want_stdo=True) |
142 | if len([x for x in stdo.splitlines() if re.search(b'!', x)]) != 0: | 146 | if len([x for x in stdo.splitlines() if re.search(b'!', x)]) != 0: |
143 | fail("FAIL: unexpected output:\n{}".format(stdo)) | 147 | fail("FAIL: unexpected output:\n{}".format(stdo)) |
diff --git a/src/testbed/buildvars.py.in b/src/testbed/buildvars.py.in index e2f8ec27b..3b2f56118 100644 --- a/src/testbed/buildvars.py.in +++ b/src/testbed/buildvars.py.in | |||
@@ -16,7 +16,6 @@ | |||
16 | # | 16 | # |
17 | # SPDX-License-Identifier: AGPL3.0-or-later | 17 | # SPDX-License-Identifier: AGPL3.0-or-later |
18 | 18 | ||
19 | |||
20 | # file: testbed/buildvars.py | 19 | # file: testbed/buildvars.py |
21 | # brief: file for importing variables from build system into python | 20 | # brief: file for importing variables from build system into python |
22 | # author: Sree Harsha Totakura | 21 | # author: Sree Harsha Totakura |
diff --git a/src/topology/Makefile.am b/src/topology/Makefile.am index ae69ee8bc..8580d200c 100644 --- a/src/topology/Makefile.am +++ b/src/topology/Makefile.am | |||
@@ -21,7 +21,7 @@ libgnunetfriends_la_LIBADD = \ | |||
21 | $(top_builddir)/src/util/libgnunetutil.la \ | 21 | $(top_builddir)/src/util/libgnunetutil.la \ |
22 | $(GN_LIBINTL) $(XLIB) | 22 | $(GN_LIBINTL) $(XLIB) |
23 | libgnunetfriends_la_LDFLAGS = \ | 23 | libgnunetfriends_la_LDFLAGS = \ |
24 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 24 | $(GN_LIB_LDFLAGS) \ |
25 | -version-info 0:0:0 | 25 | -version-info 0:0:0 |
26 | 26 | ||
27 | 27 | ||
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 0f5b2e8be..d776e99e4 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -94,16 +94,6 @@ if LINUX | |||
94 | endif | 94 | endif |
95 | 95 | ||
96 | if LINUX | 96 | if LINUX |
97 | install-exec-hook: | ||
98 | $(top_srcdir)/src/transport/install-wlan-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true | ||
99 | if HAVE_LIBBLUETOOTH | ||
100 | $(top_srcdir)/src/transport/install-bluetooth-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true | ||
101 | endif | ||
102 | else | ||
103 | install-exec-hook: | ||
104 | endif | ||
105 | |||
106 | if LINUX | ||
107 | if HAVE_LIBBLUETOOTH | 97 | if HAVE_LIBBLUETOOTH |
108 | BT_BIN = gnunet-helper-transport-bluetooth | 98 | BT_BIN = gnunet-helper-transport-bluetooth |
109 | BT_PLUGIN_LA = libgnunet_plugin_transport_bluetooth.la | 99 | BT_PLUGIN_LA = libgnunet_plugin_transport_bluetooth.la |
@@ -195,7 +185,7 @@ libgnunettransport_la_LIBADD = \ | |||
195 | $(top_builddir)/src/util/libgnunetutil.la \ | 185 | $(top_builddir)/src/util/libgnunetutil.la \ |
196 | $(GN_LIBINTL) | 186 | $(GN_LIBINTL) |
197 | libgnunettransport_la_LDFLAGS = \ | 187 | libgnunettransport_la_LDFLAGS = \ |
198 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 188 | $(GN_LIB_LDFLAGS) \ |
199 | -version-info 4:0:2 | 189 | -version-info 4:0:2 |
200 | 190 | ||
201 | libgnunettransportapplication_la_SOURCES = \ | 191 | libgnunettransportapplication_la_SOURCES = \ |
@@ -204,7 +194,7 @@ libgnunettransportapplication_la_LIBADD = \ | |||
204 | $(top_builddir)/src/util/libgnunetutil.la \ | 194 | $(top_builddir)/src/util/libgnunetutil.la \ |
205 | $(LTLIBINTL) | 195 | $(LTLIBINTL) |
206 | libgnunettransportapplication_la_LDFLAGS = \ | 196 | libgnunettransportapplication_la_LDFLAGS = \ |
207 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 197 | $(GN_LIB_LDFLAGS) \ |
208 | -version-info 0:0:0 | 198 | -version-info 0:0:0 |
209 | 199 | ||
210 | 200 | ||
@@ -214,7 +204,7 @@ libgnunettransportcore_la_LIBADD = \ | |||
214 | $(top_builddir)/src/util/libgnunetutil.la \ | 204 | $(top_builddir)/src/util/libgnunetutil.la \ |
215 | $(GN_LIBINTL) | 205 | $(GN_LIBINTL) |
216 | libgnunettransportcore_la_LDFLAGS = \ | 206 | libgnunettransportcore_la_LDFLAGS = \ |
217 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 207 | $(GN_LIB_LDFLAGS) \ |
218 | -version-info 0:0:0 | 208 | -version-info 0:0:0 |
219 | 209 | ||
220 | libgnunettransportcommunicator_la_SOURCES = \ | 210 | libgnunettransportcommunicator_la_SOURCES = \ |
@@ -223,7 +213,7 @@ libgnunettransportcommunicator_la_LIBADD = \ | |||
223 | $(top_builddir)/src/util/libgnunetutil.la \ | 213 | $(top_builddir)/src/util/libgnunetutil.la \ |
224 | $(GN_LIBINTL) | 214 | $(GN_LIBINTL) |
225 | libgnunettransportcommunicator_la_LDFLAGS = \ | 215 | libgnunettransportcommunicator_la_LDFLAGS = \ |
226 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 216 | $(GN_LIB_LDFLAGS) \ |
227 | -version-info 0:0:0 | 217 | -version-info 0:0:0 |
228 | 218 | ||
229 | 219 | ||
@@ -233,7 +223,7 @@ libgnunettransportmonitor_la_LIBADD = \ | |||
233 | $(top_builddir)/src/util/libgnunetutil.la \ | 223 | $(top_builddir)/src/util/libgnunetutil.la \ |
234 | $(GN_LIBINTL) | 224 | $(GN_LIBINTL) |
235 | libgnunettransportmonitor_la_LDFLAGS = \ | 225 | libgnunettransportmonitor_la_LDFLAGS = \ |
236 | $(GN_LIB_LDFLAGS) $(WINFLAGS) \ | 226 | $(GN_LIB_LDFLAGS) \ |
237 | -version-info 0:0:0 | 227 | -version-info 0:0:0 |
238 | 228 | ||
239 | 229 | ||
diff --git a/src/transport/install-bluetooth-helper.sh b/src/transport/install-bluetooth-helper.sh deleted file mode 100755 index 5c40250fa..000000000 --- a/src/transport/install-bluetooth-helper.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # $1 - bindir | ||
3 | # $2 - sudo binary (optional) | ||
4 | $2 chown root:root $1/gnunet-helper-transport-bluetooth || true | ||
5 | $2 chmod u+s $1/gnunet-helper-transport-bluetooth || true | ||
diff --git a/src/transport/install-wlan-helper.sh b/src/transport/install-wlan-helper.sh deleted file mode 100755 index 0fa9c9806..000000000 --- a/src/transport/install-wlan-helper.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # $1 - bindir | ||
3 | # $2 - sudo binary (optional) | ||
4 | $2 chown root:root $1/gnunet-helper-transport-wlan || true | ||
5 | $2 chmod u+s $1/gnunet-helper-transport-wlan || true | ||
diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index 3ad9b1a54..407d8ba92 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am | |||
@@ -16,10 +16,6 @@ pkgcfg_DATA = \ | |||
16 | 16 | ||
17 | if LINUX | 17 | if LINUX |
18 | VPNBIN = gnunet-helper-vpn | 18 | VPNBIN = gnunet-helper-vpn |
19 | install-exec-hook: | ||
20 | $(top_srcdir)/src/vpn/install-vpn-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true | ||
21 | else | ||
22 | install-exec-hook: | ||
23 | endif | 19 | endif |
24 | 20 | ||
25 | 21 | ||
diff --git a/src/vpn/install-vpn-helper.sh b/src/vpn/install-vpn-helper.sh deleted file mode 100755 index 086dabb67..000000000 --- a/src/vpn/install-vpn-helper.sh +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # $1 - bindir | ||
3 | # $2 - sudo binary (optional) | ||
4 | $2 chown root:root $1/gnunet-helper-vpn || true | ||
5 | $2 chmod u+s $1/gnunet-helper-vpn || true | ||