]> granicus.if.org Git - icinga2/commitdiff
Let all vm-tests output filesystem paths when they work with them
authorJohannes Meyer <johannes.meyer@netways.de>
Wed, 19 Feb 2014 14:33:10 +0000 (15:33 +0100)
committerJohannes Meyer <johannes.meyer@netways.de>
Thu, 20 Feb 2014 10:15:21 +0000 (11:15 +0100)
test/jenkins/external_commandpipe.test
test/jenkins/external_commands.test
test/jenkins/files/configs/notifications.conf
test/jenkins/livestatus_socket.test
test/jenkins/logfile.test
test/jenkins/pidfile.test
test/jenkins/statusdata.test

index f87f0e78efd9a7e56c48c14c564ee1150c817c4c..c2762550c26bb269122b35592484c707089d3c32 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
-if [ -e "/var/run/icinga2/cmd/icinga2.cmd" ];
+commandpipe_path="/var/run/icinga2/cmd/icinga2.cmd"
+
+if [ -e $commandpipe_path ];
 then
-    echo "[OK] Icinga2 commandpipe found"
+    echo "[OK] Icinga2 commandpipe found ($commandpipe_path)"
     exit 0
 else
-    echo "[FAIL] Icinga2 commandpipe not found"
+    echo "[FAIL] Icinga2 commandpipe not found ($commandpipe_path)"
     exit 1
 fi
index 87b9c0280cb18f1cf720fefc972de093ecebeb44..fe72c75fbe54d5bd255e68dcbe568c8df537dcbe 100755 (executable)
@@ -1159,51 +1159,51 @@ def test_servicegroup_commands():
 
 def main():
     failure = test_host_comments('localhost')
-    #failure &= test_host_comments('nsca-ng') # Cannot work without a hostcheck!
+    #failure |= test_host_comments('nsca-ng') # Cannot work without a hostcheck!
 
-    failure &= test_service_comments('localhost', 'disk')
-    failure &= test_service_comments('nsca-ng', 'PassiveService1')
+    failure |= test_service_comments('localhost', 'disk')
+    failure |= test_service_comments('nsca-ng', 'PassiveService1')
 
-    failure &= test_host_downtimes('localhost')
-    #failure &= test_host_downtimes('nsca-ng')
+    failure |= test_host_downtimes('localhost')
+    #failure |= test_host_downtimes('nsca-ng')
 
-    failure &= test_service_downtimes('localhost', 'disk')
-    failure &= test_service_downtimes('nsca-ng', 'PassiveService1')
+    failure |= test_service_downtimes('localhost', 'disk')
+    failure |= test_service_downtimes('nsca-ng', 'PassiveService1')
 
-    failure &= test_host_problem_acknowledgements('localhost')
-    failure &= test_remove_host_acknowledgements('localhost')
-    failure &= test_expiring_host_acknowledgements('localhost')
+    failure |= test_host_problem_acknowledgements('localhost')
+    failure |= test_remove_host_acknowledgements('localhost')
+    failure |= test_expiring_host_acknowledgements('localhost')
 
-    failure &= test_change_host_check_command('localhost', 'disk')
-    failure &= test_change_service_check_command('localhost', 'disk', 'ping4')
-    failure &= test_change_host_check_timeperiod('localhost', 'none')
-    failure &= test_change_service_check_timeperiod('localhost', 'disk', 'none')
-    failure &= test_change_host_max_check_attempts('localhost')
-    failure &= test_change_service_max_check_attempts('localhost', 'disk')
-    failure &= test_change_host_normal_check_interval('localhost')
-    failure &= test_change_service_normal_check_interval('localhost', 'disk')
-    failure &= test_change_host_retry_check_interval('localhost')
-    failure &= test_change_service_retry_check_interval('localhost', 'disk')
-    failure &= test_change_host_modified_attributes('localhost')
+    failure |= test_change_host_check_command('localhost', 'disk')
+    failure |= test_change_service_check_command('localhost', 'disk', 'ping4')
+    failure |= test_change_host_check_timeperiod('localhost', 'none')
+    failure |= test_change_service_check_timeperiod('localhost', 'disk', 'none')
+    failure |= test_change_host_max_check_attempts('localhost')
+    failure |= test_change_service_max_check_attempts('localhost', 'disk')
+    failure |= test_change_host_normal_check_interval('localhost')
+    failure |= test_change_service_normal_check_interval('localhost', 'disk')
+    failure |= test_change_host_retry_check_interval('localhost')
+    failure |= test_change_service_retry_check_interval('localhost', 'disk')
+    failure |= test_change_host_modified_attributes('localhost')
 
-    failure &= test_delay_service_notification('localhost', 'disk')
-    failure &= test_delay_host_notification('localhost')
+    failure |= test_delay_service_notification('localhost', 'disk')
+    failure |= test_delay_host_notification('localhost')
 
-    failure &= test_disabling_scheduling_host_checks('localhost')
-    failure &= test_disabling_scheduling_service_checks('localhost', 'disk')
+    failure |= test_disabling_scheduling_host_checks('localhost')
+    failure |= test_disabling_scheduling_service_checks('localhost', 'disk')
 
-    failure &= test_shutdown_restart_process()
+    failure |= test_shutdown_restart_process()
 
-    failure &= test_passive_host_checkresult_processing('localhost')
-    failure &= test_passive_svc_checkresult_processing('localhost', 'disk')
+    failure |= test_passive_host_checkresult_processing('localhost')
+    failure |= test_passive_svc_checkresult_processing('localhost', 'disk')
 
-    failure &= test_process_file('localhost')
+    failure |= test_process_file('localhost')
 
-    failure &= test_custom_host_notifications('localhost')
-    failure &= test_custom_svc_notifications('localhost', 'disk')
+    failure |= test_custom_host_notifications('localhost')
+    failure |= test_custom_svc_notifications('localhost', 'disk')
 
-    failure &= test_hostgroup_commands()
-    failure &= test_servicegroup_commands()
+    failure |= test_hostgroup_commands()
+    failure |= test_servicegroup_commands()
 
     return 1 if failure else 0
 
index 9fbde3f8daf05206c94f524dbcbfc62abddbef82..1c6a0ae5a99f34973762b1e670cb6cb7acee649d 100644 (file)
@@ -18,7 +18,7 @@ template Notification "mail-notification" {
                               NotificationFilterDowntimeRemoved),
 
   notification_period = "24x7",
-  notifications_interval = 10
+  notification_interval = 10
 }
 
 /**
index 8fa103309fc859b47871100ac2e5d6a1436780fd..ebb69729bf028a3c21db87434184837ba0fac7b6 100755 (executable)
@@ -1,17 +1,19 @@
 #!/bin/sh
 
-if [ ! -e /var/run/icinga2/cmd/livestatus ];
+livestatus_path="/var/run/icinga2/cmd/livestatus"
+
+if [ ! -e $livestatus_path ];
 then
     sudo icinga2-enable-feature livestatus 1> /dev/null
     sudo service icinga2 restart 1> /dev/null
     sleep 1
 
-    if [ ! -e /var/run/icinga2/cmd/livestatus ];
+    if [ ! -e $livestatus_path ];
     then
-        echo "[FAIL] Icinga2 Livestatus socket not found"
+        echo "[FAIL] Icinga2 Livestatus socket not found ($livestatus_path)"
         exit 1
     fi
 fi
 
-echo "[OK] Icinga2 Livestatus socket found"
+echo "[OK] Icinga2 Livestatus socket found ($livestatus_path)"
 exit 0
index 94200d60fbadbe2558d045e7d7227538616e3194..1644b2aa5d07b722b98854ef41583d31d532ca62 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
-if sudo test -f /var/log/icinga2/icinga2.log;
+logfile_path="/var/log/icinga2/icinga2.log"
+
+if sudo test -f $logfile_path;
 then
-    echo "[OK] Icinga2 log file found"
+    echo "[OK] Icinga2 log file found ($logfile_path)"
     exit 0
 else
-    echo "[FAIL] Icinga2 log file not found"
+    echo "[FAIL] Icinga2 log file not found ($logfile_path)"
     exit 1
 fi
index b50055e28944a01db878aa7d6ba503102ff0f51a..9d6cfc890f620a131d20e638e3520f70e80d7aaa 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
-if [ -f /var/run/icinga2/icinga2.pid ];
+pidfile_path="/var/run/icinga2/icinga2.pid"
+
+if [ -f $pidfile_path ];
 then
-    echo "[OK] Icinga2 pidfile found"
+    echo "[OK] Icinga2 pidfile found ($pidfile_path)"
     exit 0
 else
-    echo "[FAIL] Icinga2 pidfile not found"
+    echo "[FAIL] Icinga2 pidfile not found ($pidfile_path)"
     exit 1
 fi
index c8c4ab909b88d7a15691206dca95d373ca397d67..e1a43de26e7b9652810903ec81db62f04780d9f4 100755 (executable)
@@ -1,6 +1,9 @@
-#!/bin/sh
+#!/bin/bash
 
-if [ ! -f /var/cache/icinga2/status.dat ];
+statusdata_path="/var/cache/icinga2/status.dat"
+objectscache_path="/var/cache/icinga2/objects.cache"
+
+if [ ! -f $statusdata_path ];
 then
     sudo icinga2-enable-feature statusdata 1> /dev/null
     sudo service icinga2 restart 1> /dev/null
@@ -10,7 +13,7 @@ then
     do
         sleep 15
 
-        if [ -f /var/cache/icinga2/status.dat ];
+        if [ -f $statusdata_path ];
         then
             break
         fi
@@ -20,32 +23,32 @@ then
 
     if [ $n -eq 3 ];
     then
-        echo "[FAIL] Icinga2 status.dat not found"
+        echo "[FAIL] Icinga2 status.dat not found ($statusdata_path)"
         exit 1
     fi
 fi
 
-echo "[OK] Icinga2 status.dat found"
+echo "[OK] Icinga2 status.dat found ($statusdata_path)"
 
-if [ -f /var/cache/icinga2/objects.cache ];
+if [ -f $objectscache_path ];
 then
-    echo "[OK] Icinga2 objects.cache found"
+    echo "[OK] Icinga2 objects.cache found ($objectscache_path)"
 else
-    echo "[FAIL] Icinga2 objects.cache not found"
+    echo "[FAIL] Icinga2 objects.cache not found ($objectscache_path)"
     exit 1
 fi
 
-status_time=$(stat --format="%Y" /var/cache/icinga2/status.dat)
+status_time=$(stat --format="%Y" $statusdata_path)
 
 now=$(date +"%s")
 sleep $(((15 + 5) - ($now - $status_time)))
 
-new_status_time=$(stat --format="%Y" /var/cache/icinga2/status.dat)
+new_status_time=$(stat --format="%Y" $statusdata_path)
 
 if [ $new_status_time -eq $status_time ];
 then
-    echo "[FAIL] Icinga2 status.dat is not being updated"
+    echo "[FAIL] Icinga2 status.dat is not being updated (Last update: $(date -r $statusdata_path '+%x %X'))"
     exit 1
 else
-    echo "[OK] Icinga2 status.dat is being updated"
+    echo "[OK] Icinga2 status.dat is being updated (Last update: $(date -r $statusdata_path '+%x %X'))"
 fi