diff --git a/src/allmydata/test/check_memory.py b/src/allmydata/test/check_memory.py
index 3ef32f9..fdce601 100644
a
|
b
|
class SystemFramework(pollmixin.PollMixin): |
184 | 184 | for i in range(self.numnodes): |
185 | 185 | nodedir = os.path.join(self.testdir, "node%d" % i) |
186 | 186 | os.mkdir(nodedir) |
187 | | f = open(os.path.join(nodedir, "introducer.furl"), "w") |
188 | | f.write(self.introducer_furl) |
189 | | f.close() |
| 187 | f = open(os.path.join(nodedir, "tahoe.cfg"), "w") |
| 188 | f.write("[client]\n" |
| 189 | "introducer.furl = %s\n" |
| 190 | "shares.happy = 1\n" |
| 191 | "[storage]\n" |
| 192 | % (self.introducer_furl,)) |
190 | 193 | # the only tests for which we want the internal nodes to actually |
191 | 194 | # retain shares are the ones where somebody's going to download |
192 | 195 | # them. |
… |
… |
class SystemFramework(pollmixin.PollMixin): |
197 | 200 | # for these tests, we tell the storage servers to pretend to |
198 | 201 | # accept shares, but really just throw them out, since we're |
199 | 202 | # only testing upload and not download. |
200 | | f = open(os.path.join(nodedir, "debug_no_storage"), "w") |
201 | | f.write("no_storage\n") |
202 | | f.close() |
| 203 | f.write("debug_discard = true\n") |
203 | 204 | if self.mode in ("receive",): |
204 | 205 | # for this mode, the client-under-test gets all the shares, |
205 | 206 | # so our internal nodes can refuse requests |
206 | | f = open(os.path.join(nodedir, "readonly_storage"), "w") |
207 | | f.write("\n") |
208 | | f.close() |
| 207 | f.write("readonly = true\n") |
| 208 | f.close() |
209 | 209 | c = self.add_service(client.Client(basedir=nodedir)) |
210 | 210 | self.nodes.append(c) |
211 | 211 | # the peers will start running, eventually they will connect to each |
… |
… |
this file are ignored. |
232 | 232 | clientdir = self.clientdir = os.path.join(self.testdir, u"client") |
233 | 233 | clientdir_str = clientdir.encode(get_filesystem_encoding()) |
234 | 234 | quiet = StringIO() |
235 | | create_node.create_node(clientdir, {}, out=quiet) |
| 235 | create_node.create_node({'basedir': clientdir}, out=quiet) |
236 | 236 | log.msg("DONE MAKING CLIENT") |
237 | | f = open(os.path.join(clientdir, "introducer.furl"), "w") |
238 | | f.write(self.introducer_furl + "\n") |
239 | | f.close() |
240 | | |
| 237 | # now replace tahoe.cfg |
241 | 238 | # set webport=0 and then ask the node what port it picked. |
242 | | f = open(os.path.join(clientdir, "webport"), "w") |
243 | | f.write("tcp:0:interface=127.0.0.1\n") |
244 | | f.close() |
| 239 | f = open(os.path.join(clientdir, "tahoe.cfg"), "w") |
| 240 | f.write("[node]\n" |
| 241 | "web.port = tcp:0:interface=127.0.0.1\n" |
| 242 | "[client]\n" |
| 243 | "introducer.furl = %s\n" |
| 244 | "shares.happy = 1\n" |
| 245 | "[storage]\n" |
| 246 | % (self.introducer_furl,)) |
245 | 247 | |
246 | 248 | if self.mode in ("upload-self", "receive"): |
247 | 249 | # accept and store shares, to trigger the memory consumption bugs |
248 | 250 | pass |
249 | 251 | else: |
250 | 252 | # don't accept any shares |
251 | | f = open(os.path.join(clientdir, "readonly_storage"), "w") |
252 | | f.write("true\n") |
253 | | f.close() |
| 253 | f.write("readonly = true\n") |
254 | 254 | ## also, if we do receive any shares, throw them away |
255 | | #f = open(os.path.join(clientdir, "debug_no_storage"), "w") |
256 | | #f.write("no_storage\n") |
257 | | #f.close() |
| 255 | #f.write("debug_discard = true") |
258 | 256 | if self.mode == "upload-self": |
259 | 257 | pass |
| 258 | f.close() |
260 | 259 | self.keepalive_file = os.path.join(clientdir, |
261 | 260 | "suicide_prevention_hotline") |
262 | 261 | # now start updating the mtime. |
… |
… |
this file are ignored. |
379 | 378 | if self.mode in ("upload", "upload-self"): |
380 | 379 | files[name] = self.create_data(name, size) |
381 | 380 | d = self.control_rref.callRemote("upload_from_file_to_uri", |
382 | | files[name], convergence="check-memory convergence string") |
| 381 | files[name].encode("utf-8"), |
| 382 | convergence="check-memory") |
383 | 383 | def _done(uri): |
384 | 384 | os.remove(files[name]) |
385 | 385 | del files[name] |
… |
… |
this file are ignored. |
403 | 403 | files[name] = self.create_data(name, size) |
404 | 404 | u = self.nodes[0].getServiceNamed("uploader") |
405 | 405 | d = self.nodes[0].debug_wait_for_client_connections(self.numnodes+1) |
406 | | d.addCallback(lambda res: u.upload(upload.FileName(files[name], convergence="check-memory convergence string"))) |
| 406 | d.addCallback(lambda res: |
| 407 | u.upload(upload.FileName(files[name], |
| 408 | convergence="check-memory"))) |
407 | 409 | d.addCallback(lambda results: results.uri) |
408 | 410 | else: |
409 | 411 | raise ValueError("unknown mode=%s" % self.mode) |