Commit Graph

384 Commits

Author SHA1 Message Date
meejah
2928a480ff RSA key-size is not configurable, it's 2048bits 2022-02-16 21:46:24 -07:00
Itamar Turner-Trauring
f7cb4d5c92 Hook up the new FoolscapStorageServer, and fix enough bugs, such that almost all
end-to-end and integration tests pass.
2021-12-02 10:07:14 -05:00
Jean-Paul Calderone
0611af6b0b Stop passing even a dummy value for control tub into Nodes 2021-10-15 13:10:18 -04:00
Jean-Paul Calderone
e0312eae57 stop creating a control tub for client nodes 2021-10-15 12:02:24 -04:00
Itamar Turner-Trauring
9baedc97db Auth token needs to be bytes, apparently. 2021-05-11 11:09:59 -04:00
Jason R. Coombs
1b46f981c6 Remove AccountURLChecker, the code that relies on it, associated tests, and docs. 2021-04-17 17:01:15 -04:00
Itamar Turner-Trauring
2b9e1996ec Fix Python 2 regression. 2021-03-05 10:34:56 -05:00
Itamar Turner-Trauring
f2970f1b16 Port to Python 3. 2021-03-05 10:19:24 -05:00
Itamar Turner-Trauring
2c3353f2fa More tests passing on Python 3. 2021-03-03 14:42:55 -05:00
Itamar Turner-Trauring
7b1bfadd21 Rip out FTP. 2021-01-06 13:39:52 -05:00
Itamar Turner-Trauring
26297c296d
Merge branch 'master' into 3552.test_system-python-3 2020-12-17 09:42:34 -05:00
Jean-Paul Calderone
4b1c6a2815 Remove these reactor parameters 2020-12-14 17:42:30 -05:00
Itamar Turner-Trauring
98330d7186 Merge remote-tracking branch 'origin/master' into 3552.test_system-python-3 2020-12-11 13:24:04 -05:00
Itamar Turner-Trauring
36bf9224e6 More progress on Python 3, unbreak Python 2. 2020-12-10 10:52:07 -05:00
Itamar Turner-Trauring
1adb40cf3b Some more progress towards Python 3. 2020-12-09 12:52:53 -05:00
Jean-Paul Calderone
d7ec5a19be Don't implement the stats gatherer or support configuring or talking to one 2020-12-09 10:34:16 -05:00
Jean-Paul Calderone
d7f005badd
Merge branch 'master' into 3520.test_client-no-mock 2020-12-05 12:55:25 -05:00
Jean-Paul Calderone
15d0207f89
Merge pull request #897 from tahoe-lafs/3504.private-introducer-furl
Deprecate tahoe.cfg [client]introducer.furl

Fixes: ticket:3504
2020-12-04 09:44:19 -05:00
Jean-Paul Calderone
a0d46c6f09 Merge remote-tracking branch 'origin/master' into 3504.private-introducer-furl 2020-12-02 09:22:09 -05:00
Itamar Turner-Trauring
27102c0d89 Merge remote-tracking branch 'origin/master' into 3514.test-introducer-python-3 2020-11-30 16:47:21 -05:00
Jean-Paul Calderone
152c04e48c
Merge pull request #902 from tahoe-lafs/3512.localized-tempdir
Per-node web temp directory

Fixes: ticket:3512
2020-11-25 18:18:36 -05:00
Jean-Paul Calderone
1a5efa5ec9 Just let the test use the real SFTPServer service 2020-11-24 14:05:00 -05:00
Jean-Paul Calderone
c694e8c7e2 Delete allmydata.version_checks and related functionality
It is not Tahoe-LAFS' job to manage package installation in this way.
Instead, we can declare our dependencies in setup.py and rely on installation
management tools and packagers to create a suitable execution environment.

Making this statement in the past required going much further out on a limb
than it does today.  This code has served its purpose and can now be retired.
2020-11-23 15:10:18 -05:00
Itamar Turner-Trauring
8029a1befc First passing test on Python 3. 2020-11-19 11:45:32 -05:00
Jean-Paul Calderone
46955202e2 Hook into Twisted Web to control where request bodies are written 2020-11-18 15:47:06 -05:00
Jean-Paul Calderone
e0f69dcfcf Get the path manipulation into _Config too 2020-11-14 09:26:07 -05:00
Jean-Paul Calderone
bef5ccd0ca Move the introducer config reading code into _Config 2020-11-14 09:12:14 -05:00
Itamar Turner-Trauring
6264cf15b1 Fix some failing tests. 2020-10-30 14:08:09 -04:00
Itamar Turner-Trauring
bcb6822171 Merge branch '3485.backported-configparser-for-py-2' into 3479.test-node-python-3 2020-10-27 14:06:35 -04:00
Itamar Turner-Trauring
4a54377208 Some more fixes. 2020-10-26 16:48:18 -04:00
Itamar Turner-Trauring
4dc1adc817 Some progress towards passing Python 2 tests. 2020-10-26 16:37:00 -04:00
Itamar Turner-Trauring
375ed5096c Config parsing now always returns Unicode. 2020-10-26 12:12:49 -04:00
Itamar Turner-Trauring
f50fd8e474 Switch to new configparser backport. 2020-10-26 12:12:46 -04:00
Itamar Turner-Trauring
51d472e221 More progress towards passing tests on Python 3. 2020-10-16 11:13:11 -04:00
Itamar Turner-Trauring
f689d59a40 More passing tests on Python 3. 2020-10-16 10:55:33 -04:00
Itamar Turner-Trauring
bcd7cdf86f Some passing tests on Python 3. 2020-10-16 10:47:49 -04:00
Ross Patterson
da046108e2 feat(py3): Fix section name unicode type clash
Before this change, there was an error in the tests in python 3.  I couldn't find any
clues from the history as to why explicit byte-string literals were used here.  This
change addresses the error under Python 3 and doesn't cause any regressions under Python
2 in the test suite.  This changes two tests from failures to passing under Python 3 and
increases coverage a bit:

```diff
--- ../../.tox/make-test-py3-all-old.log	2020-10-04 21:42:22.931028265 -0700
+++ ../../.tox/make-test-py3-all-new.log	2020-10-04 21:49:19.164127097 -0700
@@ -313,7 +313,7 @@
 ####-##-##T##:##:##-###0 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 20.3.0 (/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/bin/python 3.6.12) starting up.
 ####-##-##T##:##:##-###0 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: mock.mock.MagicMock.
 ####-##-##T##:##:##-###0 [twisted.scripts._twistd_unix.UnixAppLogger#info] Server Shut Down.
-                                         [FAIL]
+                                           [OK]
 allmydata.test
   cli
     test_status ...                                                     [ERROR]
@@ -1191,7 +1191,7 @@
     test_disabled_but_helper ...                                         [FAIL]
     test_disabled_but_storage ...                                        [FAIL]
   Configuration
-    test_create_client_invalid_config ...                                [FAIL]
+    test_create_client_invalid_config ...                                  [OK]
     test_read_invalid_config ...                                           [OK]
   IntroducerNotListening
     test_port_none_introducer ...                                        [FAIL]
@@ -2024,18 +2024,6 @@
 ===============================================================================
 [FAIL]
 Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/mock/mock.py", line 1369, in patched
-    return func(*newargs, **newkeywargs)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/cli/test_start.py", line 265, in test_run_invalid_config
-    output,
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 494, in assertIn
-    % (containee, container))
-twisted.trial.unittest.FailTest: 'invalid section' not in '\nUnknown error\nTraceback (most recent call last):\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/cli/test_start.py", line 232, in cwr\n    fn()\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/scripts/run_common.py", line 155, in start\n    d = service_factory()\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/scripts/run_common.py", line 136, in <lambda>\n    u"client": lambda: maybeDeferred(namedAny("allmydata.client.create_client"), self.basedir),\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred\n    result = f(*args, **kw)\n--- <exception caught here> ---\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/client.py", line 243, in create_client\n    config = read_config(basedir, u"client.port")\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/client.py", line 219, in read_config\n    _valid_config=_valid_config(),\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/node.py", line 192, in read_config\n    configutil.validate_config(config_fname, parser, _valid_config)\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/util/configutil.py", line 72, in validate_config\n    if not valid_config.is_valid_section(section):\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/util/configutil.py", line 113, in is_valid_section\n    self._is_valid_section(section_name)\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/util/configutil.py", line 141, in <lambda>\n    return lambda *a, **kw: f(*a, **kw) or g(*a, **kw)\n  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/client.py", line 72, in _is_valid_section\n    section_name.startswith(b"storageserver.plugins.") or\nbuiltins.TypeError: startswith first arg must be str or a tuple of str, not bytes\n'
-
-allmydata.test.cli.test_start.RunTests.test_run_invalid_config
-===============================================================================
-[FAIL]
-Traceback (most recent call last):
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/trial/_asynctest.py", line 75, in _eb
     raise self.failureException(output)
 twisted.trial.unittest.FailTest:
@@ -2222,34 +2210,6 @@
     result = result.throwExceptionIntoGenerator(g)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
     return g.throw(self.type, self.value, self.tb)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_node.py", line 741, in test_create_client_invalid_config
-    yield client.create_client(self.basedir)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 355, in __exit__
-    self._expectedName, reason.getTraceback()),
-twisted.trial.unittest.FailTest: builtins.TypeError raised instead of UnknownConfigError:
- Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/internet/defer.py", line 1529, in _cancellableInlineCallbacks
-    _inlineCallbacks(None, g, status)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
-    result = result.throwExceptionIntoGenerator(g)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
-    return g.throw(self.type, self.value, self.tb)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_node.py", line 741, in test_create_client_invalid_config
-    yield client.create_client(self.basedir)
---- <exception caught here> ---
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_node.py", line 741, in test_create_client_invalid_config
-    yield client.create_client(self.basedir)
-builtins.TypeError: startswith first arg must be str or a tuple of str, not bytes
-
-
-allmydata.test.test_node.Configuration.test_create_client_invalid_config
-===============================================================================
-[FAIL]
-Traceback (most recent call last):
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
-    result = result.throwExceptionIntoGenerator(g)
-  File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
-    return g.throw(self.type, self.value, self.tb)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/src/allmydata/test/test_node.py", line 704, in test_port_none_introducer
     yield create_introducer(basedir)
   File "/home/rpatterson/src/work/sfu/tahoe-lafs/.tox/py36-coverage/lib/python3.6/site-packages/twisted/trial/_synctest.py", line 355, in __exit__
@@ -8717,7 +8677,7 @@
 -------------------------------------------------------------------------------
 Ran 1300 tests in ###.###s

-FAILED (skips=42, expectedFailures=1, failures=35, errors=531, successes=707)
+FAILED (skips=42, expectedFailures=1, failures=33, errors=531, successes=709)

 Unknown error
 Traceback (most recent call last):
@@ -8806,7 +8766,7 @@
 src/allmydata/scripts/create_node.py                   302     98    114     10    66%   224-229, 235, 257-260, 262-265, 268-269, 289-292, 295-298, 329, 339, 347-380, 391-445, 461-477, 223->224, 234->235, 256->257, 261->262, 266->277, 267->268, 288->289, 294->295, 328->329, 338->339
 src/allmydata/scripts/debug.py                         719    638    202      0     9%   14, 31-32, 35-49, 52-60, 63-142, 146-154, 157-164, 168-217, 220-304, 307-401, 407, 417, 437-465, 468-485, 488-602, 606, 609-611, 637-648, 653-656, 659, 683-689, 692-810, 813-842, 845-848, 851-865, 869, 888, 891-940, 946, 949-950, 957, 960-961, 967-972, 984-985, 999-1000, 1003-1004, 1020-1021, 1025-1031, 1046-1050
 src/allmydata/scripts/default_nodedir.py                15      5      6      2    57%   10-14, 9->10, 16->exit
-src/allmydata/scripts/run_common.py                    135     18     24      6    85%   37, 41-46, 59-60, 149, 158, 192-193, 216-220, 226-227, 55->62, 135->exit, 135->exit, 148->149, 191->192, 225->226
+src/allmydata/scripts/run_common.py                    135     17     24      5    86%   37, 41-46, 59-60, 158, 192-193, 216-220, 226-227, 55->62, 135->exit, 135->exit, 191->192, 225->226
 src/allmydata/scripts/runner.py                        138     49     42      5    61%   84-85, 91, 97-99, 150, 153-160, 174-181, 188-192, 202-232, 237-252, 255, 31->36, 149->150, 151->153, 185->188, 254->255
 src/allmydata/scripts/slow_operation.py                 69     56     22      0    14%   15-44, 47-52, 55-61, 64-83
 src/allmydata/scripts/stats_gatherer.py                 44     16     12      3    59%   8, 30, 75-79, 84-93, 7->8, 29->30, 74->75
@@ -8893,7 +8853,7 @@
 src/allmydata/windows/fixups.py                        133    133     54      0     0%   1-237
 src/allmydata/windows/registry.py                       42     42     12      0     0%   1-77
 ------------------------------------------------------------------------------------------------
-TOTAL                                                27477  11782   8244    605    54%
+TOTAL                                                27477  11781   8244    604    54%

 18 files skipped due to complete coverage.
 + '[' '!' -z 1 ']'
```
2020-10-04 21:50:09 -07:00
Itamar Turner-Trauring
7d8320b843 Python 3 fixes. 2020-09-16 11:13:23 -04:00
Itamar Turner-Trauring
a758f32edf Try to make test_storage import on Python 3. 2020-08-26 10:53:02 -04:00
Maciej Fijalkowski
93c474c39b make test_util pass under both pythons 2020-07-29 09:00:50 +02:00
Jean-Paul Calderone
ef73e18f3d
Remove the greater part of the implementation 2020-02-13 10:43:50 -05:00
Jean-Paul Calderone
a55719cdc4 Raise UnknownConfigError when a server is configured with an unknown storage plugin 2019-10-16 19:56:29 -04:00
Jean-Paul Calderone
8c1f536ba4 Merge remote-tracking branch 'origin/master' into integration/storage-economics 2019-10-04 12:02:00 -04:00
meejah
9050fdcea6 explicitly save refs to webish and operations (instead of using Service methods) 2019-08-24 12:31:08 -06:00
Jean-Paul Calderone
9940beaae1 Thread a _Config all the way down 2019-08-19 16:09:26 -04:00
Jean-Paul Calderone
a47463e032 Pass _Config instead of a smaller dict to get_client_resource 2019-08-19 11:21:03 -04:00
Jean-Paul Calderone
21d735ece9 whitespace more conforming to PEP8 2019-08-03 06:39:31 -04:00
Jean-Paul Calderone
d69de15664 implement the feature
improve the test slightly, too, to verify the configuration supplied to the
plugin is as expected.
2019-08-03 06:39:31 -04:00
Jean-Paul Calderone
9842447a07 Don't start or announce anonymous access if config says not to 2019-08-03 06:39:31 -04:00
Jean-Paul Calderone
853cf62530 Allow [storage]anonymous through the validator
And provide a helpful accessor for reading it
2019-08-03 06:39:31 -04:00