Skip to content

Commit a153653

Browse files
committedApr 1, 2013
ENH+TST: Move fail2ban-* scripts to bin/
1 parent e3bd204 commit a153653

9 files changed

+19
-14
lines changed
 

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ install:
99
- pip install pyinotify
1010
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then pip install -q coveralls; fi
1111
script:
12-
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coverage run --rcfile=.travis_coveragerc fail2ban-testcases; else python ./fail2ban-testcases; fi
12+
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coverage run --rcfile=.travis_coveragerc bin/fail2ban-testcases; else python bin/fail2ban-testcases; fi
1313
after_script:
1414
- if [[ $TRAVIS_PYTHON_VERSION == 2.[6-7] ]]; then coveralls; fi

‎DEVELOP

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Request feature. You can find more details on the Fail2Ban wiki
2424
Testing
2525
=======
2626

27-
Existing tests can be run by executing `fail2ban-testcases`. This has options
28-
like --log-level that will probably be useful. `fail2ban-testcases --help` for
29-
full options.
27+
Existing tests can be run by executing `bin/fail2ban-testcases`. This has
28+
options like --log-level that will probably be useful.
29+
`bin/fail2ban-testcases --help` forfull options.
3030

3131
Test cases should cover all usual cases, all exception cases and all inside
3232
/ outside boundary conditions.
@@ -39,7 +39,7 @@ Install the package python-coverage to visualise your test coverage. Run the
3939
following (note: on Debian-based systems, the script is called
4040
`python-coverage`):
4141

42-
coverage run fail2ban-testcases
42+
coverage run bin/fail2ban-testcases
4343
coverage html
4444

4545
Then look at htmlcov/index.html and see how much coverage your test cases

‎MANIFEST

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ THANKS
55
COPYING
66
DEVELOP
77
doc/run-rootless.txt
8-
fail2ban-client
9-
fail2ban-server
10-
fail2ban-testcases
11-
fail2ban-regex
8+
bin/fail2ban-client
9+
bin/fail2ban-server
10+
bin/fail2ban-testcases
11+
bin/fail2ban-regex
1212
fail2ban/client/configreader.py
1313
fail2ban/client/configparserinc.py
1414
fail2ban/client/jailreader.py
File renamed without changes.

‎fail2ban-regex ‎bin/fail2ban-regex

File renamed without changes.
File renamed without changes.

‎fail2ban-testcases ‎bin/fail2ban-testcases

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ __license__ = "GPL"
2727

2828
import unittest, logging, sys, time, os
2929

30+
# Check if local fail2ban module exists, and use if it exists by
31+
# modifying the path. This is such that tests can be used in dev
32+
# environment.
33+
if os.path.exists("fail2ban/__init__.py"):
34+
sys.path.insert(0, ".")
3035
from fail2ban.version import version
3136
from fail2ban.tests import banmanagertestcase
3237
from fail2ban.tests import clientreadertestcase

‎fail2ban-testcases-all

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for python in /usr/{,local/}bin/python2.[0-9]{,.*}{,-dbg}
99
do
1010
[ -e "$python" ] || continue
1111
echo "Testing using $python"
12-
$python ./fail2ban-testcases "$@" || failed+=" $python"
12+
$python bin/fail2ban-testcases "$@" || failed+=" $python"
1313
done
1414

1515
if [ ! -z "$failed" ]; then

‎setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
license = "GPL",
4848
platforms = "Posix",
4949
scripts = [
50-
'fail2ban-client',
51-
'fail2ban-server',
52-
'fail2ban-regex',
53-
'fail2ban-testcases',
50+
'bin/fail2ban-client',
51+
'bin/fail2ban-server',
52+
'bin/fail2ban-regex',
53+
'bin/fail2ban-testcases',
5454
],
5555
packages = [
5656
'fail2ban',

0 commit comments

Comments
 (0)
Please sign in to comment.