Changeset 84dfb36 in trunk
- Timestamp:
- 2021-10-26T00:57:23Z (3 years ago)
- Branches:
- master
- Children:
- 2336cae7, 28cc3ca, dd29efc, f02f14a
- Parents:
- 211640a (diff), ad216e0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Jean-Paul Calderone <exarkun@…> (2021-10-26 00:57:23)
- git-committer:
- GitHub <noreply@…> (2021-10-26 00:57:23)
- Files:
-
- 1 added
- 4 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified .gitignore ¶
r211640a r84dfb36 31 31 /src/allmydata/test/plugins/dropin.cache 32 32 /_trial_temp* 33 /_test_memory/34 33 /tmp* 35 34 /*.patch -
TabularUnified Makefile ¶
r211640a r84dfb36 143 143 144 144 145 # The check-speed and check-grid targets are disabled, since they depend upon146 # the pre-located $(TAHOE) executable that was removed when we switched to147 # tox. They will eventually be resurrected as dedicated tox environments.148 149 # The check-speed target uses a pre-established client node to run a canned150 # set of performance tests against a test network that is also151 # pre-established (probably on a remote machine). Provide it with the path to152 # a local directory where this client node has been created (and populated153 # with the necessary FURLs of the test network). This target will start that154 # client with the current code and then run the tests. Afterwards it will155 # stop the client.156 #157 # The 'sleep 5' is in there to give the new client a chance to connect to its158 # storageservers, since check_speed.py has no good way of doing that itself.159 160 ##.PHONY: check-speed161 ##check-speed: .built162 ## if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi163 ## @echo "stopping any leftover client code"164 ## -$(TAHOE) stop $(TESTCLIENTDIR)165 ## $(TAHOE) start $(TESTCLIENTDIR)166 ## sleep 5167 ## $(TAHOE) @src/allmydata/test/check_speed.py $(TESTCLIENTDIR)168 ## $(TAHOE) stop $(TESTCLIENTDIR)169 170 145 # The check-grid target also uses a pre-established client node, along with a 171 146 # long-term directory that contains some well-known files. See the docstring … … 196 171 .PHONY: clean 197 172 clean: 198 rm -rf build _trial_temp _test_memory.built173 rm -rf build _trial_temp .built 199 174 rm -f `find src *.egg -name '*.so' -or -name '*.pyc'` 200 175 rm -rf support dist 201 176 rm -rf `ls -d *.egg | grep -vEe"setuptools-|setuptools_darcs-|darcsver-"` 202 177 rm -rf *.pyc 203 rm -f bin/tahoe bin/tahoe.pyscript204 178 rm -f *.pkg 205 179 -
TabularUnified src/allmydata/client.py ¶
r211640a r84dfb36 41 41 from allmydata.immutable.upload import Uploader 42 42 from allmydata.immutable.offloaded import Helper 43 from allmydata.control import ControlServer44 43 from allmydata.introducer.client import IntroducerClient 45 44 from allmydata.util import ( … … 284 283 foolscap_connection_handlers, i2p_provider, tor_provider, 285 284 ) 286 control_tub = node.create_control_tub()287 285 288 286 introducer_clients = create_introducer_clients(config, main_tub, _introducer_factory) … … 295 293 config, 296 294 main_tub, 297 control_tub,298 295 i2p_provider, 299 296 tor_provider, … … 632 629 } 633 630 634 def __init__(self, config, main_tub, control_tub,i2p_provider, tor_provider, introducer_clients,631 def __init__(self, config, main_tub, i2p_provider, tor_provider, introducer_clients, 635 632 storage_farm_broker): 636 633 """ 637 634 Use :func:`allmydata.client.create_client` to instantiate one of these. 638 635 """ 639 node.Node.__init__(self, config, main_tub, control_tub,i2p_provider, tor_provider)636 node.Node.__init__(self, config, main_tub, i2p_provider, tor_provider) 640 637 641 638 self.started_timestamp = time.time() … … 649 646 self.init_secrets() 650 647 self.init_node_key() 651 self.init_control()652 648 self._key_generator = KeyGenerator() 653 649 key_gen_furl = config.get_config("client", "key_generator.furl", None) … … 986 982 return self.history 987 983 988 def init_control(self):989 c = ControlServer()990 c.setServiceParent(self)991 control_url = self.control_tub.registerReference(c)992 self.config.write_private_config("control.furl", control_url + "\n")993 994 984 def init_helper(self): 995 985 self.helper = Helper(self.config.get_config_path("helper"), -
TabularUnified src/allmydata/introducer/server.py ¶
r211640a r84dfb36 40 40 from allmydata.node import create_node_dir 41 41 from allmydata.node import create_connection_handlers 42 from allmydata.node import create_control_tub43 42 from allmydata.node import create_tub_options 44 43 from allmydata.node import create_main_tub … … 89 88 foolscap_connection_handlers, i2p_provider, tor_provider, 90 89 ) 91 control_tub = create_control_tub()92 90 93 91 node = _IntroducerNode( 94 92 config, 95 93 main_tub, 96 control_tub,97 94 i2p_provider, 98 95 tor_provider, … … 106 103 NODETYPE = "introducer" 107 104 108 def __init__(self, config, main_tub, control_tub,i2p_provider, tor_provider):109 node.Node.__init__(self, config, main_tub, control_tub,i2p_provider, tor_provider)105 def __init__(self, config, main_tub, i2p_provider, tor_provider): 106 node.Node.__init__(self, config, main_tub, i2p_provider, tor_provider) 110 107 self.init_introducer() 111 108 webport = self.get_config("node", "web.port", None) -
TabularUnified src/allmydata/node.py ¶
r211640a r84dfb36 920 920 921 921 922 def create_control_tub():923 """924 Creates a Foolscap Tub for use by the control port. This is a925 localhost-only ephemeral Tub, with no control over the listening926 port or location927 """928 control_tub = Tub()929 portnum = iputil.listenOnUnused(control_tub)930 log.msg("Control Tub location set to 127.0.0.1:%s" % (portnum,))931 return control_tub932 933 934 922 class Node(service.MultiService): 935 923 """ … … 939 927 CERTFILE = "node.pem" 940 928 941 def __init__(self, config, main_tub, control_tub,i2p_provider, tor_provider):929 def __init__(self, config, main_tub, i2p_provider, tor_provider): 942 930 """ 943 931 Initialize the node with the given configuration. Its base directory … … 967 955 else: 968 956 self.nodeid = self.short_nodeid = None 969 970 self.control_tub = control_tub971 if self.control_tub is not None:972 self.control_tub.setServiceParent(self)973 957 974 958 self.log("Node constructed. " + __full_version__) -
TabularUnified src/allmydata/test/no_network.py ¶
r211640a r84dfb36 18 18 # This should be useful for tests which want to examine and/or manipulate the 19 19 # uploaded shares, checker/verifier/repairer tests, etc. The clients have no 20 # Tubs, so it is not useful for tests that involve a Helper or the 21 # control.furl . 20 # Tubs, so it is not useful for tests that involve a Helper. 22 21 23 22 from future.utils import PY2 … … 252 251 config, 253 252 main_tub=None, 254 control_tub=None,255 253 i2p_provider=None, 256 254 tor_provider=None, … … 275 273 def init_introducer_client(self): 276 274 pass 277 def create_control_tub(self):278 pass279 275 def create_log_tub(self): 280 276 pass … … 285 281 def stopService(self): 286 282 return service.MultiService.stopService(self) 287 def init_control(self):288 pass289 283 def init_helper(self): 290 284 pass -
TabularUnified src/allmydata/test/test_system.py ¶
r211640a r84dfb36 13 13 14 14 from past.builtins import chr as byteschr, long 15 from six import ensure_text , ensure_str15 from six import ensure_text 16 16 17 17 import os, re, sys, time, json … … 781 781 d.addCallback(self.log, "did _check_publish_private") 782 782 d.addCallback(self._test_web) 783 d.addCallback(self._test_control)784 783 d.addCallback(self._test_cli) 785 784 # P now has four top-level children: … … 1344 1343 self.failUnlessEqual(len(matching), 10) 1345 1344 1346 def _test_control(self, res):1347 # exercise the remote-control-the-client foolscap interfaces in1348 # allmydata.control (mostly used for performance tests)1349 c0 = self.clients[0]1350 control_furl_file = c0.config.get_private_path("control.furl")1351 control_furl = ensure_str(open(control_furl_file, "r").read().strip())1352 # it doesn't really matter which Tub we use to connect to the client,1353 # so let's just use our IntroducerNode's1354 d = self.introducer.tub.getReference(control_furl)1355 d.addCallback(self._test_control2, control_furl_file)1356 return d1357 def _test_control2(self, rref, filename):1358 d = defer.succeed(None)1359 d.addCallback(lambda res: rref.callRemote("speed_test", 1, 200, False))1360 if sys.platform in ("linux2", "linux3"):1361 d.addCallback(lambda res: rref.callRemote("get_memory_usage"))1362 d.addCallback(lambda res: rref.callRemote("measure_peer_response_time"))1363 return d1364 1365 1345 def _test_cli(self, res): 1366 1346 # run various CLI commands (in a thread, since they use blocking -
TabularUnified src/allmydata/test/web/test_introducer.py ¶
r211640a r84dfb36 212 212 main_tub.listenOn(b"tcp:0") 213 213 main_tub.setLocation(b"tcp:127.0.0.1:1") 214 introducer_node = _IntroducerNode(config, main_tub, None, None , None)214 introducer_node = _IntroducerNode(config, main_tub, None, None) 215 215 216 216 introducer_service = introducer_node.getServiceNamed("introducer") -
TabularUnified tox.ini ¶
r211640a r84dfb36 207 207 python misc/build_helpers/run-deprecations.py --package allmydata --warnings={env:TAHOE_LAFS_WARNINGS_LOG:_trial_temp/deprecation-warnings.log} trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors} {posargs:allmydata} 208 208 209 [testenv:checkmemory]210 commands =211 rm -rf _test_memory212 python src/allmydata/test/check_memory.py upload213 python src/allmydata/test/check_memory.py upload-self214 python src/allmydata/test/check_memory.py upload-POST215 python src/allmydata/test/check_memory.py download216 python src/allmydata/test/check_memory.py download-GET217 python src/allmydata/test/check_memory.py download-GET-slow218 python src/allmydata/test/check_memory.py receive219 220 209 # Use 'tox -e docs' to check formatting and cross-references in docs .rst 221 210 # files. The published docs are built by code run over at readthedocs.org,
Note: See TracChangeset
for help on using the changeset viewer.