From: Johannes Meyer Date: Tue, 10 Dec 2013 11:37:51 +0000 (+0100) Subject: Add check to the statusdata test for regular file updates X-Git-Tag: v0.0.6~24^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5dc65a7528ac5d66c8734a6bf85ac7ee0cda4f8;p=icinga2 Add check to the statusdata test for regular file updates refs #5223 --- diff --git a/test/jenkins/statusdata.test b/test/jenkins/statusdata.test index 6599795a7..00b2000a9 100755 --- a/test/jenkins/statusdata.test +++ b/test/jenkins/statusdata.test @@ -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