]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Tweak timestamp checking in the cds system test
authorMichał Kępień <michal@isc.org>
Thu, 8 Mar 2018 14:40:18 +0000 (15:40 +0100)
committerEvan Hunt <each@isc.org>
Thu, 8 Mar 2018 18:57:30 +0000 (13:57 -0500)
Given the characteristics of the three timestamps involved in file
modification time checks in the cds system test (each one is an hour
apart from the next), reduce the resolution of these checks to 1 minute.
This will prevent intermittent false negatives caused by exceeding the
currently allowed difference of 9 seconds between file modification
times without making the test moot.

Also note that by using abs(), checkmtime.pl allows the cds system test
to pass when the modification time of the checked file is less than an
hour (or two hours for the second check) in the past.  This should never
happen, so remove abs() from the condition checked by checkmtime.pl.

bin/tests/system/cds/checkmtime.pl

index aba2105c0328d77d3c4a8b310f2b307373976db8..a65938c4327b2b4c113ffbb149ca75ec4b798aaf 100644 (file)
@@ -13,4 +13,4 @@ my $target = shift;
 my $file = shift;
 my $mtime = time - (stat $file)[9];
 die "bad mtime $mtime"
-       unless abs($mtime - $target) < 10;
+       unless ($mtime - $target >= 0 && $mtime - $target < 60);