From 584142892f7d5fb3100f3c0ef8e479d472b8c3c7 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sat, 29 Apr 2017 10:16:06 +0200 Subject: tests: added --remote-time tests for remaining protocols that support it --- tests/data/Makefile.inc | 1 + tests/data/test1444 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test1445 | 35 ++++++++++++++++++++++++++++++++ tests/data/test1446 | 42 ++++++++++++++++++++++++++++++++++++++ tests/libtest/test613.pl | 4 ++++ 5 files changed, 134 insertions(+) create mode 100644 tests/data/test1444 create mode 100644 tests/data/test1445 create mode 100644 tests/data/test1446 (limited to 'tests') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 5cf4f562a..9e573f6aa 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -154,6 +154,7 @@ test1416 test1417 test1418 test1419 test1420 test1421 test1422 test1423 \ test1424 \ test1428 test1429 test1430 test1431 test1432 test1433 test1434 test1435 \ test1436 test1437 test1438 test1439 test1440 test1441 test1442 test1443 \ +test1444 test1445 test1446 \ \ test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \ test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \ diff --git a/tests/data/test1444 b/tests/data/test1444 new file mode 100644 index 000000000..7eec21b99 --- /dev/null +++ b/tests/data/test1444 @@ -0,0 +1,52 @@ + + + +FTP +EPSV +RETR +--remote-time + + +# Server-side + + +file data + + +213 20090213233130 + + + +# Client-side + + +ftp + + +FTP with --remote-time + + +ftp://%HOSTIP:%FTPPORT/1444 --remote-time + +# Verify the mtime of the file. The mtime is specifically chosen to be an even +# number so that it can be represented exactly on a FAT filesystem. + +perl -e 'exit((stat("log/curl1444.out"))[9] != 1234567890)' + + + +# Verify data after the test has been "shot" + + +USER anonymous +PASS ftp@example.com +PWD +MDTM 1444 +EPSV +TYPE I +SIZE 1444 +RETR 1444 +QUIT + + + diff --git a/tests/data/test1445 b/tests/data/test1445 new file mode 100644 index 000000000..f60483dcd --- /dev/null +++ b/tests/data/test1445 @@ -0,0 +1,35 @@ + + + +FILE +--remote-time + + + + + + +# Client-side + + +file + + +perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test1445.dir + + +file:// with --remote-time + + +file://localhost/%PWD/log/test1445.dir/plainfile.txt --remote-time + + +perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test1445.dir && \ +perl -e 'exit((stat("log/curl1445.out"))[9] != 946728000)' + + + +# Verify data after the test has been "shot" + + + diff --git a/tests/data/test1446 b/tests/data/test1446 new file mode 100644 index 000000000..7d5ec9fc2 --- /dev/null +++ b/tests/data/test1446 @@ -0,0 +1,42 @@ + + + +SFTP +--remote-time + + + +# +# Server-side + + + +# +# Client-side + + +sftp + + +perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test1446.dir + + +SFTP with --remote-time + + +--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/test1446.dir/rofile.txt --insecure --remote-time + + +perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test1446.dir && \ +perl -e 'exit((stat("log/curl1446.out"))[9] != 978264000)' + + + +# +# Verify data after the test has been "shot" + + +disable + + + diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index b4caaae07..03d09cb5b 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -30,6 +30,8 @@ if ($ARGV[0] eq "prepare") binmode FILE; print FILE "Test file to support curl test suite\n"; close(FILE); + # The mtime is specifically chosen to be an even number so that it can be + # represented exactly on a FAT filesystem. utime time, timegm(0,0,12,1,0,100), "plainfile.txt"; chmod 0666, "plainfile.txt"; @@ -37,6 +39,8 @@ if ($ARGV[0] eq "prepare") binmode FILE; print FILE "Read-only test file to support curl test suite\n"; close(FILE); + # The mtime is specifically chosen to be an even number so that it can be + # represented exactly on a FAT filesystem. utime time, timegm(0,0,12,31,11,100), "rofile.txt"; chmod 0444, "rofile.txt"; -- cgit v1.2.3