mirror of
https://github.com/curl/curl.git
synced 2026-07-24 22:27:17 +03:00
test613.pl: integrate mtime check for test 1445, 1446
Move check logic from postchecks to `test613.pl`. To make these test data files XML-compliant. Also to avoid POSIX/bash-shellisms in postcheck. Closes #19766
This commit is contained in:
parent
6d156bc05f
commit
2d2d70b6e5
3 changed files with 10 additions and 10 deletions
|
|
@ -3,7 +3,6 @@
|
|||
<keywords>
|
||||
FILE
|
||||
--remote-time
|
||||
notxml
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
|
|
@ -29,8 +28,7 @@ file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.dir/plainfile.txt --remote-tim
|
|||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<postcheck>
|
||||
%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \
|
||||
%PERL -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 946728000)'
|
||||
%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %LOGDIR/curl%TESTNUMBER.out 946728000
|
||||
</postcheck>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -3,16 +3,13 @@
|
|||
<keywords>
|
||||
SFTP
|
||||
--remote-time
|
||||
notxml
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
|
|
@ -29,12 +26,10 @@ SFTP with --remote-time
|
|||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<postcheck>
|
||||
%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir && \
|
||||
%PERL -e 'exit((stat("%LOGDIR/curl%TESTNUMBER.out"))[9] != 978264000)'
|
||||
%PERL %SRCDIR/libtest/test613.pl postprocess %PWD/%LOGDIR/test%TESTNUMBER.dir %LOGDIR/curl%TESTNUMBER.out 978264000
|
||||
</postcheck>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ if($ARGV[0] eq "prepare") {
|
|||
}
|
||||
elsif($ARGV[0] eq "postprocess") {
|
||||
my $dirname = $ARGV[1];
|
||||
my $logfile = $ARGV[2];
|
||||
|
||||
# Clean up the test directory
|
||||
if($^O eq 'cygwin') {
|
||||
|
|
@ -97,6 +96,14 @@ elsif($ARGV[0] eq "postprocess") {
|
|||
|
||||
rmdir $dirname || die "$!";
|
||||
|
||||
if($#ARGV >= 3) { # Verify mtime if requested
|
||||
my $checkfile = $ARGV[2];
|
||||
my $expected_mtime = int($ARGV[3]);
|
||||
my $mtime = (stat($checkfile))[9];
|
||||
exit ($mtime != $expected_mtime);
|
||||
}
|
||||
|
||||
my $logfile = $ARGV[2];
|
||||
if($logfile && -s $logfile) {
|
||||
# Process the directory file to remove all information that
|
||||
# could be inconsistent from one test run to the next (e.g.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue