]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix cds test
authorEvan Hunt <each@isc.org>
Wed, 23 Jan 2019 00:23:49 +0000 (16:23 -0800)
committerEvan Hunt <each@isc.org>
Fri, 25 Jan 2019 19:24:09 +0000 (11:24 -0800)
- use $PERL instead of perl
- use $DIFF instead of cmp for windows portability; cmp doesn't
  handle CR characters properly

bin/tests/system/cds/checktime.pl
bin/tests/system/cds/setup.sh
bin/tests/system/cds/tests.sh

index d26dbf12690c389609adc7c4428a1e9b9b46acd7..947f0f4f028aca5ae1cc463b90dfa842d29a0594 100644 (file)
@@ -9,13 +9,17 @@
 # See the COPYRIGHT file distributed with this work for additional
 # information regarding copyright ownership.
 
-$target = shift;
+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+)[)]$};
+       $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;
+die "bad inception time $delta" unless abs($delta - $target) < 3;
index 2f022dae01751b5a275168efe5dd0eec0c486b2a..157bea17e313a21aa065459d53c35aeed6350c99 100644 (file)
@@ -40,7 +40,7 @@ id2=$id2
 EOF
 
 tac() {
-       perl -e 'print reverse <>' "$@"
+       $PERL -e 'print reverse <>' "$@"
 }
 
 convert() {
index 43368a4c5d2515390f86be035b0342bae1321fd1..35b864e72b63930ab6846c07490ab0560aa1833c 100644 (file)
@@ -51,7 +51,7 @@ check_stderr() {
 }
 
 check_stdout() {
-       cmp out.$n "${out:-empty}" >/dev/null && return
+       $DIFF out.$n "${out:-empty}" >/dev/null && return
        echo_d "stdout did not match '$out'"
        (       echo "wanted"
                cat "$out"
@@ -127,10 +127,10 @@ name='in-place backup correct modification time'
 testcase 0 $PERL checkmtime.pl 7200 DS.inplace.bak
 
 name='in-place correct output'
-testcase 0 cmp DS.1 DS.inplace
+testcase 0 $DIFF DS.1 DS.inplace
 
 name='in-place backup unmodified'
-testcase 0 cmp DS.1 DS.inplace.bak
+testcase 0 $DIFF DS.1 DS.inplace.bak
 
 name='one mangled DS'
 err='found RRSIG by key'