[icinga-checkins] icinga.org: icinga-core/dev/cgis: Add notification tests

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


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

Author: Alexander Wirt <formorer at debian.org>
Date:   Fri Feb 24 22:34:34 2012 +0100

Add notification tests

---

 t/616cginotification.t |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/t/616cginotification.t b/t/616cginotification.t
new file mode 100644
index 0000000..0c8be1b
--- /dev/null
+++ b/t/616cginotification.t
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+# Checks for notifications.cgi
+# 
+
+use warnings;
+use strict;
+use Test::More;
+use Icinga::Test qw ( run_cgi );
+
+plan tests => 5;
+
+my $output = run_cgi('etc/cgi.cfg', 'GET', 'nodaemoncheck',
+    'notifications.cgi');
+like( $output, "/<input type='hidden' name='host' value='all'>/", "Host value set to all if nothing set" );
+
+$output = run_cgi('etc/cgi.cfg', 'GET', 'nodaemoncheck&host=all',
+    'notifications.cgi');
+like( $output, "/<input type='hidden' name='host' value='all'>/", "Host value set to all if host=all set" );
+
+$output = run_cgi('etc/cgi.cfg', 'GET', 'nodaemoncheck&host=hostA',
+    'notifications.cgi');
+like( $output, "/<input type='hidden' name='host' value='hostA'>/", "Host value set to host in query string" );
+
+$output = run_cgi('etc/cgi.cfg', 'GET', 'nodaemoncheck&contact=all',
+    'notifications.cgi');
+like( $output, "/<input type='hidden' name='contact' value='all'>/", "Contact value set to all from query string" );
+
+$output = run_cgi('etc/cgi.cfg', 'GET', 'nodaemoncheck&contact=fred',
+    'notifications.cgi');
+like( $output, "/<input type='hidden' name='contact' value='fred'>/", "Contact value set to fred from query string" );





More information about the icinga-checkins mailing list