From: Brian Warner Date: Tue, 21 Apr 2015 18:26:16 +0000 (-0700) Subject: finish removing control-port upload/download functions X-Git-Tag: allmydata-tahoe-1.10.1a1~37 X-Git-Url: https://git.rkrishnan.org/reliability?a=commitdiff_plain;h=edcdaa27999297efab5d3962f45f394651eaba02;p=tahoe-lafs%2Ftahoe-lafs.git finish removing control-port upload/download functions --- diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index a8dbdfeb..d0f5b187 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -2629,25 +2629,6 @@ class RIControlClient(RemoteInterface): storage servers. """ - def upload_from_file_to_uri(filename=str, - convergence=ChoiceOf(None, - StringConstraint(2**20))): - """Upload a file to the grid. This accepts a filename (which must be - absolute) that points to a file on the node's local disk. The node will - read the contents of this file, upload it to the grid, then return the - URI at which it was uploaded. If convergence is None then a random - encryption key will be used, else the plaintext will be hashed, then - that hash will be mixed together with the "convergence" string to form - the encryption key. - """ - return URI - - def download_from_uri_to_file(uri=URI, filename=str): - """Download a file from the grid, placing it on the node's local disk - at the given filename (which must be absolute[?]). Returns the - absolute filename where the file was written.""" - return str - # debug stuff def get_memory_usage(): diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index 3b23b2f6..4ffbb29c 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -16,7 +16,7 @@ from allmydata.immutable.filenode import ImmutableFileNode from allmydata.util import idlib, mathutil from allmydata.util import log, base32 from allmydata.util.verlib import NormalizedVersion -from allmydata.util.encodingutil import quote_output, unicode_to_argv, get_filesystem_encoding +from allmydata.util.encodingutil import quote_output, unicode_to_argv from allmydata.util.fileutil import abspath_expanduser_unicode from allmydata.util.consumer import MemoryConsumer, download_to_data from allmydata.scripts import runner @@ -1399,18 +1399,7 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase): d.addCallback(self._test_control2, control_furl_file) return d def _test_control2(self, rref, filename): - d = rref.callRemote("upload_from_file_to_uri", - filename.encode(get_filesystem_encoding()), convergence=None) - downfile = os.path.join(self.basedir, "control.downfile").encode(get_filesystem_encoding()) - d.addCallback(lambda uri: - rref.callRemote("download_from_uri_to_file", - uri, downfile)) - def _check(res): - self.failUnlessEqual(res, downfile) - data = open(downfile, "r").read() - expected_data = open(filename, "r").read() - self.failUnlessEqual(data, expected_data) - d.addCallback(_check) + d = defer.succeed(None) d.addCallback(lambda res: rref.callRemote("speed_test", 1, 200, False)) if sys.platform in ("linux2", "linux3"): d.addCallback(lambda res: rref.callRemote("get_memory_usage"))