lausser / check_logfiles

A plugin (monitoring-plugin, not nagios-plugin, see also http://is.gd/PP1330) which scans logfiles for patterns.
https://omd.consol.de/docs/plugins/check_logfiles/
GNU General Public License v2.0
46 stars 27 forks source link

Some tests in test suite do fail #73

Open hpreusse opened 2 years ago

hpreusse commented 2 years ago

I downloaded version 4.1.1 and run the test suite. Most of the tests run OK, but some fail. Here is the test summary, full log is attached.

Test Summary Report

040wevtutilfilt.t    (Wstat: 512 (exited 2) Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
041wevtutil.t        (Wstat: 512 (exited 2) Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
041wevtutilps.t      (Wstat: 512 (exited 2) Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
100flooddetect.t     (Wstat: 256 (exited 1) Tests: 3 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 36 tests but ran 3.
Files=69, Tests=693, 1790 wallclock secs ( 0.45 usr  0.30 sys + 24.40 cusr 11.76 csys = 36.91 CPU)
Result: FAIL
Failed 4/69 test programs. 1/693 subtests failed.

test_suite.zip

hpreusse commented 1 year ago

A few tests specific to Windows are executed on Linux and fail there, due to missing perl modules. Please exclude them, when running on Linux.

Can't locate Win32/EventLog.pm in @INC (you may need to install the Win32::EventLog module) (@INC contains: ../plugins-scripts /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl .) at ../plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm line 222.
BEGIN failed--compilation aborted at ../plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm line 222.
Compilation failed in require at 040wevtutilfilt.t line 13.
BEGIN failed--compilation aborted at 040wevtutilfilt.t line 13.
040wevtutilfilt.t ...... 
Can't locate Win32/EventLog.pm in @INC (you may need to install the Win32::EventLog module) (@INC contains: ../plugins-scripts /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl .) at ../plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm line 222.
BEGIN failed--compilation aborted at ../plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm line 222.
Compilation failed in require at 041wevtutil.t line 13.
BEGIN failed--compilation aborted at 041wevtutil.t line 13.
041wevtutil.t .......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate Win32/EventLog.pm in @INC (you may need to install the Win32::EventLog module) (@INC contains: ../plugins-scripts /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl .) at ../plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm line 222.
BEGIN failed--compilation aborted at ../plugins-scripts/Nagios/CheckLogfiles/Search/Eventlog.pm line 222.
Compilation failed in require at 041wevtutilps.t line 13.
BEGIN failed--compilation aborted at 041wevtutilps.t line 13.
041wevtutilps.t ........ 

Patch for this is straightforward: delay loading of Windows specific Perl Modules: patch.txt

xavierba commented 1 year ago

@hpreusse you may want to submit this as a PR. I confirm your patch works for me too, thanks.

I do also see some failing tests: