~ubuntu-branches/ubuntu/saucy/nagios3/saucy-proposed

« back to all changes in this revision

Viewing changes to t/705nagiostats.t

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2009-08-16 14:14:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090816141423-efjzq1r3jekwd7l7
Tags: 3.2.0-1
* New upstream release (Closes: #542957)
  - Timeperiods should work as expected now (Closes: #539882)
  - Recovery notifications fixed (Closes: #543657)
* Update standards version 
  - Add README.source
* Manpage errors fixed (Closes: #540554)
* Split up the webfrontend into its own package (Closes: #479338, #485466)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
3
# Checks nagiostats
 
4
 
 
5
use warnings;
 
6
use strict;
 
7
use Test::More;
 
8
use FindBin qw($Bin);
 
9
 
 
10
chdir $Bin or die "Cannot chdir";
 
11
 
 
12
my $topdir = "$Bin/..";
 
13
my $nagiostats = "$topdir/base/nagiostats";
 
14
my $etc = "$Bin/etc";
 
15
 
 
16
plan tests => 5;
 
17
 
 
18
my $output = `$nagiostats -c "$etc/nagios-does-not-exit.cfg"`;
 
19
isnt( $?, 0, "Bad return code with no config file" );
 
20
like( $output, "/Error processing config file/", "No config file" );
 
21
 
 
22
$output = `$nagiostats -c "$etc/nagios-no-status.cfg"`;
 
23
isnt( $?, 0, "Bad return code with no status file" );
 
24
like( $output, "/Error reading status file 'var/status.dat.no.such.file': No such file or directory/", "No config file" );
 
25
 
 
26
$output = `$nagiostats -c "$etc/nagios-no-status.cfg" -m NUMHSTUP`;
 
27
isnt( $?, 0, "Bad return code with no status file in MRTG mode" );
 
28