Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
juga
sbws
Commits
fa99251d
Commit
fa99251d
authored
Jun 02, 2018
by
Matt Traudt
Committed by
Matt Traudt
Jun 02, 2018
Browse files
Smattering of integration test reorganization
parent
046ce48a
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
fa99251d
...
...
@@ -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
...
...
tests/integration/__
touch
__.py
→
tests/integration/__
init
__.py
View file @
fa99251d
File moved
tests/
testnets/reproducible
.tar
→
tests/
integration/net
.tar
View file @
fa99251d
No preview for this file type
tests/integration/util/__init__.py
0 → 100644
View file @
fa99251d
tests/integration/test_stem.py
→
tests/integration/
util/
test_stem.py
View file @
fa99251d
...
...
@@ -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.ini
View file @
fa99251d
[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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment