mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-19 15:59:57 +00:00
b9a9e06c1d
This applies the following for both WebUI and Daemon: 1. Raised minimal TLS version to TLSv1.2 2. Added specific cipher suite list 3. Added support for ECDSA auth keys 4. Added support for ECDHE key exchange algorithm We disabled the ability to perform TLS/SSL renegotiation and therefore will prevent the clients from renegotiating, which can be exploit for DoS attacks. New security tests now will be skipped when running `pydef` and `trial` testenvs. To run the test, use the testenv `security` or add the environment variable `SECURITY_TESTS` before running the tests. Also should only run when adding to the commit message the string `SECURITY_TEST`.
208 lines
5.1 KiB
INI
208 lines
5.1 KiB
INI
# Tox (http://tox.testrun.org/) is a tool for running tests in multiple virtualenvs.
|
|
# This configuration file will run the test suite on all supported python versions.
|
|
#
|
|
# Usage: `pip install tox` and then run `tox` from this directory.
|
|
|
|
[flake8]
|
|
max-line-length = 120
|
|
builtins = _,_n,__request__
|
|
exclude = .git,.tox,dist,build
|
|
ignore =
|
|
# A003 Class attribute is a python builtin.
|
|
A003,
|
|
# C813, C815, C816: PY3 missing trailing commas.
|
|
C813,C815,C816,
|
|
# W503 line break before binary operator.
|
|
W503,
|
|
|
|
[pycodestyle]
|
|
max-line-length = 120
|
|
|
|
[tox]
|
|
envlist = py27, flake8, docs
|
|
minversion=2.0
|
|
|
|
[testenv]
|
|
install_command = pip install --ignore-installed {opts} {packages}
|
|
passenv = DISPLAY PYTHONPATH
|
|
setenv = PYTHONPATH = {toxinidir}
|
|
sitepackages = True
|
|
deps =
|
|
twisted[tls]
|
|
service_identity
|
|
mako
|
|
chardet
|
|
pyopenssl
|
|
pyxdg
|
|
pytest
|
|
mock
|
|
slimit
|
|
pillow
|
|
whitelist_externals = pytest bash
|
|
commands = {envpython} setup.py test
|
|
|
|
[pytest]
|
|
# Hide logged warnings and errors in test output.
|
|
log_cli_level = CRITICAL
|
|
|
|
##############
|
|
# Unit tests
|
|
##############
|
|
|
|
[testenv:pydef]
|
|
commands =
|
|
python -c "import libtorrent as lt; print(lt.__version__)"
|
|
pytest -v --basetemp=_pytest_temp -s -m "not (todo or gtkui or security)" deluge/tests
|
|
|
|
[testenv:security]
|
|
setenv = SECURITY_TESTS = True
|
|
commands = pytest -v --basetemp=_pytest_temp -s -m "security" deluge/tests/
|
|
|
|
[testenv:pygtkui]
|
|
commands = pytest -v --basetemp=_pytest_temp -s -m "gtkui" deluge/tests
|
|
|
|
[testenv:todo]
|
|
commands = pytest -v --basetemp=_pytest_temp -s -m "todo" deluge/tests
|
|
|
|
[testenv:trial]
|
|
setenv = {[testenv]setenv}{:}{toxinidir}/deluge/tests
|
|
commands =
|
|
python -c "import libtorrent as lt; print lt.__version__"
|
|
python -m twisted.trial --reporter=deluge-reporter deluge.tests
|
|
|
|
[testenv:plugins]
|
|
setenv = PYTHONPATH = {toxinidir}{:}{toxinidir}/deluge/plugins
|
|
whitelist_externals = bash
|
|
commands =
|
|
python setup.py build_plugins --develop --install-dir={toxinidir}/deluge/plugins/
|
|
pytest -v --basetemp=_pytest_temp -s -m "not gtkui" deluge/plugins
|
|
|
|
[testenv:pluginsgtkui]
|
|
setenv = PYTHONPATH = {toxinidir}{:}{toxinidir}/deluge/plugins
|
|
commands =
|
|
python setup.py build_plugins --develop --install-dir={toxinidir}/deluge/plugins/
|
|
pytest -v --basetemp=_pytest_temp -s deluge/plugins
|
|
|
|
[testenv:py27]
|
|
deps =
|
|
{[testenv]deps}
|
|
py2-ipaddress
|
|
basepython = python2.7
|
|
commands = {[testenv:pydef]commands}
|
|
|
|
[testenv:py3]
|
|
basepython = python3
|
|
commands = {[testenv:pydef]commands}
|
|
|
|
###########################
|
|
# Code style verification
|
|
###########################
|
|
|
|
[testenv:flake8]
|
|
# Disable site packages to avoid using system flake8 which uses hardcoded python path which imports the wrong libraries.
|
|
sitepackages = False
|
|
deps =
|
|
{[testenv]deps}
|
|
flake8
|
|
flake8-quotes
|
|
flake8-isort
|
|
pep8-naming
|
|
commands =
|
|
flake8 --version
|
|
python -c 'import isort; print(isort.__version__)'
|
|
flake8
|
|
|
|
[testenv:flake8-complexity]
|
|
sitepackages = False
|
|
deps =
|
|
{[testenv:flake8]deps}
|
|
mccabe
|
|
commands = flake8 --exit-zero --max-complexity 15 deluge
|
|
|
|
|
|
[testenv:pylint]
|
|
# Disable site packages to avoid using system installed version
|
|
sitepackages = False
|
|
ignore_errors = True
|
|
deps =
|
|
{[testenv]deps}
|
|
pylint
|
|
commands =
|
|
pylint --version
|
|
pylint deluge
|
|
# Use python to enable use of wildcard paths with pylint.
|
|
python -m pylint *.py deluge/scripts/*.py
|
|
python -m pylint deluge/plugins/*/deluge/
|
|
|
|
|
|
######################
|
|
# Unit Test coverage
|
|
######################
|
|
|
|
[testcoveragebase]
|
|
deps =
|
|
{[testenv]deps}
|
|
pytest-cov
|
|
coverage
|
|
whitelist_externals =
|
|
{[testenv]whitelist_externals}
|
|
coverage
|
|
commands = coverage run --branch --source=deluge -m pytest -m "not todo" deluge/tests/
|
|
|
|
[testenv:testcoverage]
|
|
setenv = {[testenv]setenv}
|
|
deps = {[testcoveragebase]deps}
|
|
whitelist_externals = {[testcoveragebase]whitelist_externals}
|
|
commands =
|
|
{[testcoveragebase]commands}
|
|
coverage report
|
|
|
|
[testenv:testcoverage-html]
|
|
setenv = {[testenv]setenv}
|
|
deps = {[testcoveragebase]deps}
|
|
whitelist_externals = {[testcoveragebase]whitelist_externals}
|
|
commands =
|
|
{[testcoveragebase]commands}
|
|
coverage html -d docs/build/htmlcoverage
|
|
|
|
|
|
######################
|
|
# Docs generation
|
|
######################
|
|
|
|
# We do not have all dependencies on RTD and travis so we exclude the
|
|
# site packages (sitepackages=False) when building docs so that local
|
|
# tests have a similar environment.
|
|
|
|
[docsbase]
|
|
sitepackages = False
|
|
changedir = docs
|
|
deps =
|
|
{[testenv]deps}
|
|
sphinx
|
|
whitelist_externals =
|
|
{[testenv]whitelist_externals}
|
|
|
|
[testenv:docs]
|
|
sitepackages = {[docsbase]sitepackages}
|
|
deps = {[docsbase]deps}
|
|
commands =
|
|
python setup.py clean_docs
|
|
sphinx-apidoc --force -o docs/source/modules/ deluge deluge/plugins
|
|
sphinx-build -v -j auto -E -T -b html -d docs/build/doctrees docs/source docs/build/html
|
|
|
|
[testenv:docscoverage]
|
|
sitepackages = {[docsbase]sitepackages}
|
|
changedir = {[docsbase]changedir}
|
|
deps =
|
|
{[docsbase]deps}
|
|
coverage
|
|
pytest-cov
|
|
whitelist_externals =
|
|
{[docsbase]whitelist_externals}
|
|
mkdir
|
|
commands =
|
|
mkdir -p build/doccoverage
|
|
sphinx-build -W -b coverage -d build/doctrees source build/doccoverage
|
|
pytest --doctest-glob='*.rst'
|