bind9/bin/tests/system/cds/checktime.pl
Evan Hunt 097cbec3c4 fix cds test
- use $PERL instead of perl
- use $DIFF instead of cmp for windows portability; cmp doesn't
  handle CR characters properly
2019-01-25 00:44:11 -08:00

25 lines
812 B
Perl

#!/usr/bin/perl
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://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) < 3;