Commit 097cbec3 authored by Evan Hunt's avatar Evan Hunt

fix cds test

- use $PERL instead of perl
- use $DIFF instead of cmp for windows portability; cmp doesn't
  handle CR characters properly
parent e6f2c2f5
...@@ -9,13 +9,17 @@ ...@@ -9,13 +9,17 @@
# See the COPYRIGHT file distributed with this work for additional # See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership. # information regarding copyright ownership.
$target = shift; use strict;
use warnings;
my $target = shift;
my $notbefore;
my $inception;
while (<>) { while (<>) {
$notbefore = $1 if m{^.* must not be signed before \d+ [(](\d+)[)]$}; $notbefore = $1 if m{^.* must not be signed before \d+ [(](\d+)[)]};
$inception = $1 if m{^.* inception time \d+ [(](\d+)[)]$}; $inception = $1 if m{^.* inception time \d+ [(](\d+)[)]};
} }
die "missing notbefore time" unless $notbefore; die "missing notbefore time" unless $notbefore;
die "missing inception time" unless $inception; die "missing inception time" unless $inception;
my $delta = $inception - $notbefore; my $delta = $inception - $notbefore;
die "bad inception time $delta" die "bad inception time $delta" unless abs($delta - $target) < 3;
unless abs($delta - $target) < 3;
...@@ -38,7 +38,7 @@ id2=$id2 ...@@ -38,7 +38,7 @@ id2=$id2
EOF EOF
tac() { tac() {
perl -e 'print reverse <>' "$@" $PERL -e 'print reverse <>' "$@"
} }
convert() { convert() {
......
...@@ -51,7 +51,7 @@ check_stderr() { ...@@ -51,7 +51,7 @@ check_stderr() {
} }
check_stdout() { 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_d "stdout did not match '$out'"
( echo "wanted" ( echo "wanted"
cat "$out" cat "$out"
...@@ -127,10 +127,10 @@ name='in-place backup correct modification time' ...@@ -127,10 +127,10 @@ name='in-place backup correct modification time'
testcase 0 $PERL checkmtime.pl 7200 DS.inplace.bak testcase 0 $PERL checkmtime.pl 7200 DS.inplace.bak
name='in-place correct output' name='in-place correct output'
testcase 0 cmp DS.1 DS.inplace testcase 0 $DIFF DS.1 DS.inplace
name='in-place backup unmodified' 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' name='one mangled DS'
err='found RRSIG by key' err='found RRSIG by key'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment