Commit fa99251d authored by Matt Traudt's avatar Matt Traudt Committed by Matt Traudt
Browse files

Smattering of integration test reorganization

parent 046ce48a
......@@ -27,9 +27,10 @@ and
- `scripts/maint/` scripts for **maint**aining sbws and doing administrative
things like regenerating the website or updating the AUTHORS file.
- `scripts/tools/` misc. scripts for users of sbws.
- `tests/testnets/` scripts and code for running mini Tor networks locally and
performing integration tests with them.
- `tests/` unit tests executed with `pytest` or `tox`.
performing tests with them.
- `tests/unit/` simple little tests that don't require Tor to be running
- `tests/integration/` more complex tests and/or tests that require Tor to be running
- `tests/testnets/` scripts and code for running mini Tor networks locally
## Boring things
......
......@@ -2,7 +2,7 @@ import sbws.util.stem as stem_utils
from stem.descriptor.router_status_entry import RouterStatusEntryV3
def test_foo(persistent_launch_tor):
def test_launch_and_okay(persistent_launch_tor):
cont = persistent_launch_tor
assert stem_utils.is_controller_okay(cont)
assert stem_utils.is_bootstrapped(cont)
......@@ -25,3 +25,15 @@ def test_get_relay_from_nick(persistent_launch_tor):
assert isinstance(relay, RouterStatusEntryV3)
assert relay.fingerprint == 'AA45C13025C037F056E734169891878ED0880231'
assert relay.nickname == 'auth1'
def test_get_relay_from_bad_nick(persistent_launch_tor):
cont = persistent_launch_tor
relay = stem_utils.fp_or_nick_to_relay(cont, 'notarelaynick')
assert relay is None
def test_get_relay_from_bad_fp(persistent_launch_tor):
cont = persistent_launch_tor
relay = stem_utils.fp_or_nick_to_relay(cont, 'A'*40)
assert relay is None
[tox]
skip_missing_interpreters = True
envlist = clean, lint, py34, py35, py36, stats, integration
envlist = clean, lint, py34, py35, py36, integration, stats
[travis]
python =
......@@ -20,19 +20,15 @@ commands=
ignore_errors = True
deps = .[test]
whitelist_externals =
rm
tar
time
bash
sleep
changedir = {toxinidir}/tests/testnets
time
commands =
rm -vrf reproducible
tar vxf reproducible.tar
bash ./reproducible/start.sh
time bash -c "python3 ./reproducible/wait.py ./reproducible/{auth,relay,exit}*"
coverage run --rcfile={toxinidir}/.coveragerc --source=sbws -m pytest -s {toxinidir}/tests/integration -vv
bash ./reproducible/stop.sh
tar -C {envtmpdir} -vxf {toxinidir}/tests/integration/net.tar
bash {envtmpdir}/net/start.sh
time bash -c "python3 {envtmpdir}/net/wait.py {envtmpdir}/net/{auth,relay,exit}*"
coverage run -a --rcfile={toxinidir}/.coveragerc --source=sbws -m pytest -s {toxinidir}/tests/integration -vv
bash {envtmpdir}/net/stop.sh
[testenv:lint]
skip_install = True
......@@ -56,7 +52,7 @@ install_command =
pip install --process-dependency-links {opts} {packages}
deps = .[test]
commands =
coverage run --rcfile={toxinidir}/.coveragerc --source=sbws -m pytest -s {toxinidir}/tests/unit -vv
coverage run -a --rcfile={toxinidir}/.coveragerc --source=sbws -m pytest -s {toxinidir}/tests/unit -vv
passenv =
TRAVIS
TRAVIS_JOB_ID
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment