da046108e2
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 ']' ``` |
||
---|---|---|
.circleci | ||
.github | ||
docs | ||
integration | ||
misc | ||
newsfragments | ||
nix | ||
release-tools | ||
src/allmydata | ||
static | ||
.codecov.yml | ||
.coveragerc | ||
.gitignore | ||
.lgtm.yml | ||
.pre-commit-config.yaml | ||
COPYING.GPL | ||
COPYING.TGPPL.rst | ||
CREDITS | ||
docker-compose.yml | ||
Dockerfile | ||
Dockerfile.dev | ||
Makefile | ||
MANIFEST.in | ||
NEWS.rst | ||
pyinstaller.spec | ||
README.rst | ||
relnotes.txt | ||
setup.cfg | ||
setup.py | ||
Tahoe.home | ||
towncrier.pyproject.toml | ||
tox.ini | ||
ws_client.py |
Tahoe-LAFS
Tahoe-LAFS is a Free and Open decentralized cloud storage system. It distributes your data across multiple servers. Even if some of the servers fail or are taken over by an attacker, the entire file store continues to function correctly, preserving your privacy and security.
For full documentation, please see http://tahoe-lafs.readthedocs.io/en/latest/ .
INSTALLING
There are three ways to install Tahoe-LAFS.
using OS packages
Pre-packaged versions are available for several operating systems:
- Debian and Ubuntu users can
apt-get install tahoe-lafs
- NixOS, NetBSD (pkgsrc), ArchLinux, Slackware, and Gentoo have packages available, see OSPackages for details
- Mac and Windows installers are in development.
via pip
If you don't use an OS package, you'll need Python 2.7 and pip. You may also need a C compiler, and the development headers for python, libffi, and OpenSSL. On a Debian-like system, use apt-get install build-essential python-dev libffi-dev libssl-dev python-virtualenv
. On Windows, see docs/windows.rst.
Then, to install the most recent release, just run:
pip install tahoe-lafs
from source
To install from source (either so you can hack on it, or just to run pre-release code), you should create a virtualenv and install into that:
git clone https://github.com/tahoe-lafs/tahoe-lafs.git
cd tahoe-lafs
virtualenv --python=python2.7 venv
venv/bin/pip install --upgrade setuptools
venv/bin/pip install --editable .
venv/bin/tahoe --version
To run the unit test suite:
tox
You can pass arguments to trial
with an environment variable. For example, you can run the test suite on multiple cores to speed it up:
TAHOE_LAFS_TRIAL_ARGS="-j4" tox
For more detailed instructions, read docs/INSTALL.rst .
Once tahoe --version
works, see docs/running.rst to learn how to set up your first Tahoe-LAFS node.
LICENCE
Copyright 2006-2018 The Tahoe-LAFS Software Foundation
You may use this package under the GNU General Public License, version 2 or, at your option, any later version. You may use this package under the Transitive Grace Period Public Licence, version 1.0, or at your option, any later version. (You may choose to use this package under the terms of either licence, at your option.) See the file COPYING.GPL for the terms of the GNU General Public License, version 2. See the file COPYING.TGPPL for the terms of the Transitive Grace Period Public Licence, version 1.0.
See TGPPL.PDF for why the TGPPL exists, graphically illustrated on three slides.