[icinga-checkins] icinga.org: icinga-core/mfriedrich/cgis: Rewrite 930_emptygroups.t

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


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

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

Rewrite 930_emptygroups.t

---

 t/930_emptygroups.t |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/t/930_emptygroups.t b/t/930_emptygroups.t
new file mode 100644
index 0000000..be7c3cd
--- /dev/null
+++ b/t/930_emptygroups.t
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+#
+# Check that empty host/service groups pass verfication.
+# Likely error on non-patched version:
+# "Error: Host 'r' specified in host group 'generic-pc' is not defined anywhere!"
+
+use warnings;
+use strict;
+use Test::More;
+use FindBin qw($Bin);
+use Icinga::Test qw ( run_cmd );
+
+chdir $Bin or die "Cannot chdir";
+
+my $topdir = "$Bin/..";
+my $icinga = "$topdir/base/icinga";
+my $etc = "$Bin/etc";
+
+plan tests => 1;
+
+my $output = run_cmd([$icinga, '-v', "$etc/icinga-empty-groups.cfg"]);
+if ($? == 0) {
+	pass("Icinga validated empty host/service-group successfully");
+} else {
+	$output =~ /^Error: .+$/g;
+	fail("Icinga validation failed:\n$output");
+}
+
+





More information about the icinga-checkins mailing list