From ee17f35d43bf121f080e2a5bf64cf28553f19848 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 29 Aug 2024 09:53:28 +0200 Subject: [PATCH] test475: verify a 72K ASCII FTP upload Extended the test format and runtest.pl so that the verify/upload part can be marked using crlf newlines even when the client/file does not have it. Closes #14717 --- tests/FILEFORMAT.md | 5 ++++- tests/data/Makefile.am | 2 +- tests/data/test475 | 45 ++++++++++++++++++++++++++++++++++++++++++ tests/runtests.pl | 3 +++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 tests/data/test475 diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index d7e04d267f..a9ae97ff0b 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -692,8 +692,11 @@ content ### `` -### `` +### `` the contents of the upload data curl should have sent +`crlf=yes` forces *upload* newlines to become CRLF even if not written so in +the source file. + ### `` disable - disables the valgrind log check for this test diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 619a97d8f0..d572c6bf0f 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -77,7 +77,7 @@ test435 test436 test437 test438 test439 test440 test441 test442 test443 \ test444 test445 test446 test447 test448 test449 test450 test451 test452 \ test453 test454 test455 test456 test457 test458 test459 test460 test461 \ test462 test463 test467 test468 test469 test470 test471 test472 test473 \ -test474 \ +test474 test475 \ \ test490 test491 test492 test493 test494 test495 test496 test497 test498 \ test499 test500 test501 test502 test503 test504 test505 test506 test507 \ diff --git a/tests/data/test475 b/tests/data/test475 new file mode 100644 index 0000000000..b0e4c2ca4f --- /dev/null +++ b/tests/data/test475 @@ -0,0 +1,45 @@ + + + +FTP +EPSV +STOR +TYPE A + + + +# Client-side + + +ftp + + +FTP PASV upload ASCII file + + +%repeat[1750 x a line of text used for verifying this !%0a]% + + +"ftp://%HOSTIP:%FTPPORT/%TESTNUMBER;type=a" -T %LOGDIR/test%TESTNUMBER.txt + + + +# Verify data after the test has been "shot" + + +QUIT + + +%repeat[1750 x a line of text used for verifying this !%0a]% + + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE A +STOR %TESTNUMBER +QUIT + + + diff --git a/tests/runtests.pl b/tests/runtests.pl index c0c7188112..293d6d38ed 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1489,6 +1489,9 @@ sub singletest_check { eval $strip; } } + if($hash{'crlf'}) { + subnewlines(1, \$_) for @upload; + } $res = compare($runnerid, $testnum, $testname, "upload", \@out, \@upload); if ($res) { -- 2.47.3