diff options
author | Steven Hiscocks <steven@hiscocks.me.uk> | 2013-04-01 19:06:13 +0100 |
---|---|---|
committer | Steven Hiscocks <steven@hiscocks.me.uk> | 2013-04-01 19:06:13 +0100 |
commit | a153653a2709dc032d814c9bacdbde50b1d0a171 (patch) | |
tree | 242e79f06438e94694c9c0e37b85b782b9af5880 | |
parent | e3bd2042ebcdf891eef7d04632b22ce82e1eeffd (diff) | |
download | fail2ban-a153653a2709dc032d814c9bacdbde50b1d0a171.tar.gz |
ENH+TST: Move fail2ban-* scripts to bin/
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | DEVELOP | 8 | ||||
-rw-r--r-- | MANIFEST | 8 | ||||
-rwxr-xr-x | bin/fail2ban-client (renamed from fail2ban-client) | 0 | ||||
-rwxr-xr-x | bin/fail2ban-regex (renamed from fail2ban-regex) | 0 | ||||
-rwxr-xr-x | bin/fail2ban-server (renamed from fail2ban-server) | 0 | ||||
-rwxr-xr-x | bin/fail2ban-testcases (renamed from fail2ban-testcases) | 5 | ||||
-rwxr-xr-x | fail2ban-testcases-all | 2 | ||||
-rwxr-xr-x | setup.py | 8 |
9 files changed, 19 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml index 773c5f0b..93082658 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,6 @@ install: - pip install pyinotify - if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then pip install -q coveralls; fi script: - - if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coverage run --rcfile=.travis_coveragerc fail2ban-testcases; else python ./fail2ban-testcases; fi + - if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coverage run --rcfile=.travis_coveragerc bin/fail2ban-testcases; else python bin/fail2ban-testcases; fi after_script: - if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coveralls; fi @@ -24,9 +24,9 @@ Request feature. You can find more details on the Fail2Ban wiki Testing ======= -Existing tests can be run by executing `fail2ban-testcases`. This has options -like --log-level that will probably be useful. `fail2ban-testcases --help` for -full options. +Existing tests can be run by executing `bin/fail2ban-testcases`. This has +options like --log-level that will probably be useful. +`bin/fail2ban-testcases --help` forfull options. Test cases should cover all usual cases, all exception cases and all inside / outside boundary conditions. @@ -39,7 +39,7 @@ Install the package python-coverage to visualise your test coverage. Run the following (note: on Debian-based systems, the script is called `python-coverage`): -coverage run fail2ban-testcases +coverage run bin/fail2ban-testcases coverage html Then look at htmlcov/index.html and see how much coverage your test cases @@ -5,10 +5,10 @@ THANKS COPYING DEVELOP doc/run-rootless.txt -fail2ban-client -fail2ban-server -fail2ban-testcases -fail2ban-regex +bin/fail2ban-client +bin/fail2ban-server +bin/fail2ban-testcases +bin/fail2ban-regex fail2ban/client/configreader.py fail2ban/client/configparserinc.py fail2ban/client/jailreader.py diff --git a/fail2ban-client b/bin/fail2ban-client index 8068d60f..8068d60f 100755 --- a/fail2ban-client +++ b/bin/fail2ban-client diff --git a/fail2ban-regex b/bin/fail2ban-regex index 6bff21de..6bff21de 100755 --- a/fail2ban-regex +++ b/bin/fail2ban-regex diff --git a/fail2ban-server b/bin/fail2ban-server index 3a1686d3..3a1686d3 100755 --- a/fail2ban-server +++ b/bin/fail2ban-server diff --git a/fail2ban-testcases b/bin/fail2ban-testcases index 45ba03ad..5faaa75e 100755 --- a/fail2ban-testcases +++ b/bin/fail2ban-testcases @@ -27,6 +27,11 @@ __license__ = "GPL" import unittest, logging, sys, time, os +# Check if local fail2ban module exists, and use if it exists by +# modifying the path. This is such that tests can be used in dev +# environment. +if os.path.exists("fail2ban/__init__.py"): + sys.path.insert(0, ".") from fail2ban.version import version from fail2ban.tests import banmanagertestcase from fail2ban.tests import clientreadertestcase diff --git a/fail2ban-testcases-all b/fail2ban-testcases-all index fd33dce4..6b399337 100755 --- a/fail2ban-testcases-all +++ b/fail2ban-testcases-all @@ -9,7 +9,7 @@ for python in /usr/{,local/}bin/python2.[0-9]{,.*}{,-dbg} do [ -e "$python" ] || continue echo "Testing using $python" - $python ./fail2ban-testcases "$@" || failed+=" $python" + $python bin/fail2ban-testcases "$@" || failed+=" $python" done if [ ! -z "$failed" ]; then @@ -47,10 +47,10 @@ setup( license = "GPL", platforms = "Posix", scripts = [ - 'fail2ban-client', - 'fail2ban-server', - 'fail2ban-regex', - 'fail2ban-testcases', + 'bin/fail2ban-client', + 'bin/fail2ban-server', + 'bin/fail2ban-regex', + 'bin/fail2ban-testcases', ], packages = [ 'fail2ban', |