Commit Graph

4055 Commits (9129a414e379d1fb717081a4690d5f1e79a458d9)

Author SHA1 Message Date
sebres c0e0cfb39d Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10 2016-09-01 16:23:13 +02:00
sebres 564b696530 Merge branch '_0.9/systemd-journal-path-gh-1408' 2016-09-01 16:18:53 +02:00
sebres 5f35b52b9a test cases extended
several test-case functionality cherry picked from 0.10 (SkipTest, with_tmpdir)
2016-09-01 16:17:06 +02:00
sebres 35b5fea038 backend "systemd" can be used as prefix now - `backend = systemd[...]` 2016-09-01 16:17:04 +02:00
sebres 7ed6cab120 jail configuration extended with new syntax to pass options to the backend (see gh-1408),
examples:
  - `backend = systemd[journalpath=/run/log/journal/machine-1]`
  - `backend = systemd[journalfiles="/run/log/journal/machine-1/system.journal, /run/log/journal/machine-1/user.journal"]`
  - `backend = systemd[journalflags=2]`
2016-09-01 16:17:02 +02:00
sebres 1c4733ef89 [systemd] added new constructor parameters like journalpath, journalfiles and journalflags for systemd backup
optimized FilterSystemd method `run`: better wait in idle (no busy-loop), better poll handling, the ban will executed anywhere (at least at 100th log-entry), also if we have never ending logging in this jail (e.g. extremely logging or too many failures)
systemd test cases extended
2016-08-24 20:55:06 +02:00
Serg G. Brester 0ab042fcce Merge pull request #1522 from sebres/fix-asterisk-log-prefix
filter.d/asterisk.conf: another part ` chan_sip.c:28468 handle_request_register:` (without `in`) in log prefix
2016-08-23 11:18:59 +02:00
sebres 4a1d720344 filter.d/asterisk.conf: another part ` chan_sip.c:28468 handle_request_register:` in log prefix 2016-08-22 14:10:50 +02:00
sebres 2c54f90469 sshd-filter: better universal regexp, that matches more complex different injects, using conditional expressions (on username and auth-info section), see new test cases also. 2016-08-19 10:19:12 +02:00
sebres a544c5abac sshd-filter: recognized "Failed publickey for" now (gh-1477) + improved regexp (not anchored now to recognize all "Failed anything for ... from <HOST>"
ChangeLog entry added
2016-08-18 21:38:55 +02:00
Yaroslav Halchenko 6c737454dd RF+ENH: 0.10/let know version when running tests and move arg parsing code into the module (#1516) 2016-08-18 10:14:03 -04:00
sebres af126eb308 simplify fail2ban-testcases: move some code pieces inclusive option parser from fail2ban-testcases to tests/utils.py (+ coverage) 2016-08-18 15:05:03 +02:00
sebres f7f618b15d Let know the version (and python), also in travis (no output if verbosity is 0) 2016-08-18 14:22:38 +02:00
Serg G. Brester 13a70e3bdb Merge pull request #1515 from sebres/_0.10/fix
0.10 fix sporadically test case assertion error in MonitorJournalFailures
2016-08-17 18:06:26 +02:00
sebres 18ebd9ac21 Merge branches 0.10-full and 0.10 2016-08-17 18:00:25 +02:00
sebres 9aca34d3b1 normalize name of the test cases: method and class name fixed for MonitorJournalFailures 2016-08-17 17:48:57 +02:00
sebres 4bb5f3492e Merge branch '_0.10/tests-verbosity' into _0.10/fix 2016-08-17 16:45:04 +02:00
sebres cd6b528542 new test-cases option "--verbosity" to set numeric level of verbosity during test cases;
travis uses same verbosity (2) running in python3 as from setup (python2)
2016-08-17 16:41:33 +02:00
sebres f91ec84bfb prevent theoretical time-related assertion errors for other filters, replace isFilled with waitFailTotal (known expected failure count) 2016-08-17 15:50:08 +02:00
sebres 67e4ac5c66 common monitor test case class, that unite some duplicate code 2016-08-17 13:45:50 +02:00
sebres 7b7d60c486 fixed sporadically test cases assertion error "AssertionError: 3 != 4" - because multi-threaded, occurred if getFailTicket() called after 3th failure (before 4th failure was monitored), so we will wait in new method waitFailTotal (instead of isFilled) for expected failure count... 2016-08-17 13:44:10 +02:00
Serg G. Brester e3f4ea7284 Update README.md
fixed coveralls url to the default branch
2016-08-16 10:43:01 +02:00
Serg G. Brester 9a30cfa77d Merge pull request #1510 from sebres/_0.10/optimize-setup-test-case
0.10/optimize setup test case
2016-08-16 10:16:42 +02:00
sebres 2b5c5103f4 safer multi-threaded execution inside (logging with lock inside LogCaptureTestCase logging handler);
additionally developer option `--log-direct` for fail2ban-testcases: disable lazy logging inside LogCaptureTestCase (default log-lazy is on)
2016-08-15 21:54:33 +02:00
sebres 5509ba37a2 Merge pull request #1512 from 'remotes/gh-upstream/0.9' into 0.10 2016-08-15 20:08:42 +02:00
Serg G. Brester f61aa3225c Merge pull request #1512 from sebres/_fix/datepattern-right-word-boundary
Fix ambiguous wrong recognized date pattern resp. its optional parts
2016-08-15 20:04:33 +02:00
sebres 9935cf19c1 description provided, ChangeLog entries added 2016-08-15 19:54:11 +02:00
sebres 0bdee2556f testAmbiguousDatePattern rewritten with DateDetector/DatePatternRegex directly (moved to misctestcase.py) 2016-08-15 19:35:11 +02:00
sebres 8e09be5fc8 test cases for boundaries for date-pattern extended (negative/positive, left/right) 2016-08-15 18:53:35 +02:00
sebres 7f55be3fad amend to b6bb2f88c1dbb111647269590d80d95f72c81c3e: datepattern right word boundary - prevents confusions if end of date-pattern (e.g. optional year part) misleadingly match not date values (see gh-1507)
test cases extended to check ambiguous "unbound" patterns in log lines (match/miss resp. positive/negative cases)
2016-08-15 16:51:55 +02:00
sebres 861fb8d463 Merge remote-tracking branch 'remotes/gh-upstream/0.10' into _0.10/optimize-setup-test-case 2016-08-15 13:53:44 +02:00
Serg G. Brester d75af2f900 travis: coverage python 3.5 (#1511) 2016-08-15 13:52:32 +02:00
sebres 6fcf8192f3 code review 2016-08-15 13:51:50 +02:00
sebres c3d1d51daf Merge remote-tracking branch 'remotes/gh-upstream/0.9' into 0.10 2016-08-15 13:00:20 +02:00
sebres c49fe12f70 fix fail2banregextestcase using setUpMyTime/tearDownMyTime: always use correct static time as base-time (using mock up MyTime), correct datetimes inside test 2016-08-15 12:57:39 +02:00
sebres 83029b89b9 amend to 2e530fcf72c9e9bae321b37b625728bf9f88f71b: setuptools compatibility fix - just to be sure if install_scripts will be incompatible tomorrow 2016-08-12 21:48:40 +02:00
sebres eb72660eee easy-fix: reset fail2ban link to python, if it targeted unavailable file 2016-08-12 21:32:18 +02:00
sebres 2e530fcf72 setuptools compatibility fix 2016-08-12 21:26:57 +02:00
sebres fcae05190f move common initializing functionality from fail2ban-testcases to tests/utils.py, to afford setting of default options by test execution from setup process. 2016-08-12 21:26:55 +02:00
sebres b2ee3b120e optimized logging using LogCaptureTestCase (new faster handler _MemHandler);
backwards compatibility for python 2.6 (SkipTest implemented), so options --fast and --no-network may be used now within python2.6 also;
2016-08-12 21:26:53 +02:00
sebres 461e9bab56 better handling of setup in test-cases (prevent execution of 2to3 twice, full logging in heavydebug, etc.) 2016-08-12 21:26:51 +02:00
sebres d71a525a85 Merge branch 'master' into 0.10 (resolve conflicts and cleaning tree points after back-porting gh-1508 0.10 -> 0.9) 2016-08-12 18:51:56 +02:00
sebres 42b5a10f5d Back-port pull request #1508 from sebres/_fix/python-executable-gh-1506 to master (0.10 -> 0.9) 2016-08-12 18:42:54 +02:00
sebres cb340db220 ChangeLog entry for gh-1508 2016-08-12 18:37:46 +02:00
sebres db30b7ce06 BF: prefer sys.argv[0] by retrieving of root resp. bin path: __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.) 2016-08-12 17:59:27 +02:00
sebres 6cdc1ce685 compatibility fix (virtualenv, running test cases in py3)
# Conflicts:
#	MANIFEST
2016-08-12 17:59:24 +02:00
sebres 38d53a72fd introduces new command "fail2ban-python", as automatically created symlink to python executable, where fail2ban currently installed (resp. its modules are located);
fixed pythonic filters and test scripts (running via "fail2ban-python" now);
fixed test case "testSetupInstallRoot" not for default python (also using direct call, out of virtualenv);

# Conflicts:
#	config/filter.d/ignorecommands/apache-fakegooglebot
#	fail2ban/tests/files/config/apache-auth/digest.py
#	fail2ban/tests/files/ignorecommand.py
#	fail2ban/tests/misctestcase.py
2016-08-12 17:58:37 +02:00
sebres a4cef8a893 Merge branch '_fix/python-executable-gh-1506' into 0.10 2016-08-12 17:50:54 +02:00
Serg G. Brester db24edba81 Update README.md
show status of builds (travis and coverage) from default branch (0.10)
2016-08-12 17:29:42 +02:00
sebres c8e7c1f7f4 BF: prefer sys.argv[0] by retrieving of root resp. bin path: __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.) 2016-08-12 16:48:11 +02:00