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
 | 
			
		||||
  - 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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								DEVELOP
								
								
								
								
							
							
						
						
									
										8
									
								
								DEVELOP
								
								
								
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								MANIFEST
								
								
								
								
							
							
						
						
									
										8
									
								
								MANIFEST
								
								
								
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue