diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2012-11-06 14:26:15 -0500 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2012-11-06 21:45:55 -0500 |
commit | 39172a99c55375ef21488ecd3cd8cbbcb98e87dc (patch) | |
tree | 8a7cb68010ed2289d5e1f513ad4948c2f3cb2d59 | |
parent | ef2ea965c8b2a028270629b907039167bf4c3f13 (diff) | |
download | fail2ban-39172a99c55375ef21488ecd3cd8cbbcb98e87dc.tar.gz |
BF: added a little shell script to excercise tests against all available Python versions
also report Python version inside fail2ban-testcases
-rw-r--r-- | .travis.yml | 4 | ||||
-rwxr-xr-x | fail2ban-testcases | 3 | ||||
-rwxr-xr-x | fail2ban-testcases-all | 18 |
3 files changed, 22 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index 4c552d04..c70b749b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,6 @@ env: - PYTHON=python PYSUF='' # - PYTHON=python3 PYSUF=3 : python3-numpy not currently available install: - - sudo apt-get install $PYTHON-all $PYTHON-pyinotify $PYTHON-gamin + - sudo apt-get install $PYTHON-all $PYTHON-all-dbg $PYTHON-pyinotify $PYTHON-gamin script: - - set -e; for p in `pyversions -s`; do echo "I: $p"; $p ./fail2ban-testcases; done + - ./failban-testcases-all diff --git a/fail2ban-testcases b/fail2ban-testcases index cc616c0e..58ad7887 100755 --- a/fail2ban-testcases +++ b/fail2ban-testcases @@ -100,7 +100,8 @@ logSys.addHandler(stdout) # Let know the version # if not opts.log_level or opts.log_level != 'fatal': - print "Fail2ban " + version + " test suite. Please wait..." + print "Fail2ban %s test suite. Python %s. Please wait..." \ + % (version, str(sys.version).replace('\n', '')) # diff --git a/fail2ban-testcases-all b/fail2ban-testcases-all new file mode 100755 index 00000000..8d4157ea --- /dev/null +++ b/fail2ban-testcases-all @@ -0,0 +1,18 @@ +#!/bin/bash +# Simple helper script to exercise unittests using all available +# (under /usr/bin and /usr/local/bin python2.*) + +set -eu + +failed= +for python in /usr/{,local/}bin/python2.[0-9]{,.*}{,-dbg} +do + [ -e "$python" ] || continue + echo "Testing using $python" + $python ./fail2ban-testcases || failed+=" $python" +done + +if [ ! -z "$failed" ]; then + echo "E: Failed with $failed" + exit 1 +fi |