From: Viktor Szakats Date: Sun, 30 Nov 2025 00:45:57 +0000 (+0100) Subject: test613.pl: integrate mtime check for test 1445, 1446 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d2d70b6e568f229d140264361a219851de1fd56;p=thirdparty%2Fcurl.git 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 --- diff --git a/tests/data/test1445 b/tests/data/test1445 index 705162be2d..08c12c9647 100644 --- a/tests/data/test1445 +++ b/tests/data/test1445 @@ -3,7 +3,6 @@ FILE --remote-time -notxml @@ -29,8 +28,7 @@ file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.dir/plainfile.txt --remote-tim # Verify data after the test has been "shot" -%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 diff --git a/tests/data/test1446 b/tests/data/test1446 index 448eefbc1f..aa87ce11e1 100644 --- a/tests/data/test1446 +++ b/tests/data/test1446 @@ -3,16 +3,13 @@ SFTP --remote-time -notxml -# # Server-side -# # Client-side @@ -29,12 +26,10 @@ SFTP with --remote-time -# # Verify data after the test has been "shot" -%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 diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index 88c0e49682..3cccb6ed7f 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -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.