[icinga-checkins] icinga.org: icinga-core/mfriedrich/cgis: Rewrite 920-nocontactgroup.t

git at icinga.org git at icinga.org
Sat Feb 25 15:48:05 CET 2012


Module: icinga-core
Branch: mfriedrich/cgis
Commit: bfb1f76a72e9ae6c3415521f4c6adf3e0a4edf4e
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=bfb1f76a72e9ae6c3415521f4c6adf3e0a4edf4e

Author: Alexander Wirt <formorer at debian.org>
Date:   Sat Feb 25 10:54:03 2012 +0100

Rewrite 920-nocontactgroup.t

---

 t/920-nocontactgroup.t |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/t/920-nocontactgroup.t b/t/920-nocontactgroup.t
new file mode 100644
index 0000000..eaccf0c
--- /dev/null
+++ b/t/920-nocontactgroup.t
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+# 
+# Check that no contactgroup gives the correct message
+
+use warnings;
+use strict;
+use Icinga::Test qw ( run_cmd );
+use Test::More;
+use FindBin qw($Bin);
+
+my $etc = "$Bin/etc";
+my $topdir = "$Bin/..";
+my $icinga = "$topdir/base/icinga";
+
+plan tests => 2;
+
+# icinga run without existing contactgroup should raise an exeception
+
+my $output = run_cmd([$icinga, '-v', "$etc/icinga-no-contactgroup.cfg"]);
+isnt($?, 0, "And get return code error" );
+like( $output, "/Error: Could not find any contactgroup matching 'nonexistantone'/", "Correct error for no contactgroup" );





More information about the icinga-checkins mailing list