bind9/bin/tests/system/cds/checktime.pl
Mark Andrews 4db847e80e Increase the amount of time allowed for signing to occur in
On slow systems we have seen this take 9 seconds.  Increased the
allowance from 3 seconds to 10 seconds to reduce the probabilty of
a false negative from the system test.
2022-07-05 12:36:36 +00:00

27 lines
852 B
Perl

#!/usr/bin/perl
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
use strict;
use warnings;
my $target = shift;
my $notbefore;
my $inception;
while (<>) {
$notbefore = $1 if m{^.* must not be signed before \d+ [(](\d+)[)]};
$inception = $1 if m{^.* inception time \d+ [(](\d+)[)]};
}
die "missing notbefore time" unless $notbefore;
die "missing inception time" unless $inception;
my $delta = $inception - $notbefore;
die "bad inception time $delta" unless abs($delta - $target) <= 10;