mirror of https://github.com/fail2ban/fail2ban
ENH+TST: Move fail2ban-* scripts to bin/
parent
e3bd2042eb
commit
a153653a27
|
@ -9,6 +9,6 @@ install:
|
||||||
- pip install pyinotify
|
- pip install pyinotify
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then pip install -q coveralls; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then pip install -q coveralls; fi
|
||||||
script:
|
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:
|
after_script:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coveralls; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coveralls; fi
|
||||||
|
|
8
DEVELOP
8
DEVELOP
|
@ -24,9 +24,9 @@ Request feature. You can find more details on the Fail2Ban wiki
|
||||||
Testing
|
Testing
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Existing tests can be run by executing `fail2ban-testcases`. This has options
|
Existing tests can be run by executing `bin/fail2ban-testcases`. This has
|
||||||
like --log-level that will probably be useful. `fail2ban-testcases --help` for
|
options like --log-level that will probably be useful.
|
||||||
full options.
|
`bin/fail2ban-testcases --help` forfull options.
|
||||||
|
|
||||||
Test cases should cover all usual cases, all exception cases and all inside
|
Test cases should cover all usual cases, all exception cases and all inside
|
||||||
/ outside boundary conditions.
|
/ 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
|
following (note: on Debian-based systems, the script is called
|
||||||
`python-coverage`):
|
`python-coverage`):
|
||||||
|
|
||||||
coverage run fail2ban-testcases
|
coverage run bin/fail2ban-testcases
|
||||||
coverage html
|
coverage html
|
||||||
|
|
||||||
Then look at htmlcov/index.html and see how much coverage your test cases
|
Then look at htmlcov/index.html and see how much coverage your test cases
|
||||||
|
|
8
MANIFEST
8
MANIFEST
|
@ -5,10 +5,10 @@ THANKS
|
||||||
COPYING
|
COPYING
|
||||||
DEVELOP
|
DEVELOP
|
||||||
doc/run-rootless.txt
|
doc/run-rootless.txt
|
||||||
fail2ban-client
|
bin/fail2ban-client
|
||||||
fail2ban-server
|
bin/fail2ban-server
|
||||||
fail2ban-testcases
|
bin/fail2ban-testcases
|
||||||
fail2ban-regex
|
bin/fail2ban-regex
|
||||||
fail2ban/client/configreader.py
|
fail2ban/client/configreader.py
|
||||||
fail2ban/client/configparserinc.py
|
fail2ban/client/configparserinc.py
|
||||||
fail2ban/client/jailreader.py
|
fail2ban/client/jailreader.py
|
||||||
|
|
|
@ -27,6 +27,11 @@ __license__ = "GPL"
|
||||||
|
|
||||||
import unittest, logging, sys, time, os
|
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.version import version
|
||||||
from fail2ban.tests import banmanagertestcase
|
from fail2ban.tests import banmanagertestcase
|
||||||
from fail2ban.tests import clientreadertestcase
|
from fail2ban.tests import clientreadertestcase
|
|
@ -9,7 +9,7 @@ for python in /usr/{,local/}bin/python2.[0-9]{,.*}{,-dbg}
|
||||||
do
|
do
|
||||||
[ -e "$python" ] || continue
|
[ -e "$python" ] || continue
|
||||||
echo "Testing using $python"
|
echo "Testing using $python"
|
||||||
$python ./fail2ban-testcases "$@" || failed+=" $python"
|
$python bin/fail2ban-testcases "$@" || failed+=" $python"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -z "$failed" ]; then
|
if [ ! -z "$failed" ]; then
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -47,10 +47,10 @@ setup(
|
||||||
license = "GPL",
|
license = "GPL",
|
||||||
platforms = "Posix",
|
platforms = "Posix",
|
||||||
scripts = [
|
scripts = [
|
||||||
'fail2ban-client',
|
'bin/fail2ban-client',
|
||||||
'fail2ban-server',
|
'bin/fail2ban-server',
|
||||||
'fail2ban-regex',
|
'bin/fail2ban-regex',
|
||||||
'fail2ban-testcases',
|
'bin/fail2ban-testcases',
|
||||||
],
|
],
|
||||||
packages = [
|
packages = [
|
||||||
'fail2ban',
|
'fail2ban',
|
||||||
|
|
Loading…
Reference in New Issue