]> granicus.if.org Git - icinga2/commitdiff
Add check to the statusdata test for regular file updates
authorJohannes Meyer <johannes.meyer@netways.de>
Tue, 10 Dec 2013 11:37:51 +0000 (12:37 +0100)
committerJohannes Meyer <johannes.meyer@netways.de>
Mon, 16 Dec 2013 14:37:38 +0000 (15:37 +0100)
refs #5223

test/jenkins/statusdata.test

index 6599795a7304ea446a91acb32f834afd4f3bee6e..00b2000a94a45056a2d96bf5f8e21e4b88a2eab2 100755 (executable)
@@ -30,8 +30,22 @@ echo "Icinga2 status.dat found"
 if [ -f /var/cache/icinga2/objects.cache ];
 then
     echo "Icinga2 objects.cache found"
-    exit 0
 else
     echo "Icinga2 objects.cache not found"
     exit 1
 fi
+
+status_time=$(stat --format="%Y" /var/cache/icinga2/status.dat)
+
+now=$(date +"%s")
+sleep $(((15 + 5) - ($now - $status_time)))
+
+new_status_time=$(stat --format="%Y" /var/cache/icinga2/status.dat)
+
+if [ $new_status_time -eq $status_time ];
+then
+    echo "Icinga2 status.dat is not being updated"
+    exit 1
+else
+    echo "Icinga2 status.dat is being updated"
+fi