tests: added --remote-time tests for remaining protocols that support it

This commit is contained in:
Dan Fandrich 2017-04-29 10:16:06 +02:00
Родитель 2ce86d8509
Коммит 584142892f
5 изменённых файлов: 134 добавлений и 0 удалений

Просмотреть файл

@ -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 \

52
tests/data/test1444 Normal file
Просмотреть файл

@ -0,0 +1,52 @@
<testcase>
<info>
<keywords>
FTP
EPSV
RETR
--remote-time
</keywords>
</info>
# Server-side
<reply>
<data>
file data
</data>
<mdtm>
213 20090213233130
</mdtm>
</reply>
# Client-side
<client>
<server>
ftp
</server>
<name>
FTP with --remote-time
</name>
<command>
ftp://%HOSTIP:%FTPPORT/1444 --remote-time
</command>
# 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.
<postcheck>
perl -e 'exit((stat("log/curl1444.out"))[9] != 1234567890)'
</postcheck>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
MDTM 1444
EPSV
TYPE I
SIZE 1444
RETR 1444
QUIT
</protocol>
</verify>
</testcase>

35
tests/data/test1445 Normal file
Просмотреть файл

@ -0,0 +1,35 @@
<testcase>
<info>
<keywords>
FILE
--remote-time
</keywords>
</info>
<reply>
</reply>
# Client-side
<client>
<server>
file
</server>
<precheck>
perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test1445.dir
</precheck>
<name>
file:// with --remote-time
</name>
<command>
file://localhost/%PWD/log/test1445.dir/plainfile.txt --remote-time
</command>
<postcheck>
perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test1445.dir && \
perl -e 'exit((stat("log/curl1445.out"))[9] != 946728000)'
</postcheck>
</client>
# Verify data after the test has been "shot"
<verify>
</verify>
</testcase>

42
tests/data/test1446 Normal file
Просмотреть файл

@ -0,0 +1,42 @@
<testcase>
<info>
<keywords>
SFTP
--remote-time
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<precheck>
perl %SRCDIR/libtest/test613.pl prepare %PWD/log/test1446.dir
</precheck>
<name>
SFTP with --remote-time
</name>
<command>
--key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/log/test1446.dir/rofile.txt --insecure --remote-time
</command>
<postcheck>
perl %SRCDIR/libtest/test613.pl postprocess %PWD/log/test1446.dir && \
perl -e 'exit((stat("log/curl1446.out"))[9] != 978264000)'
</postcheck>
</client>
#
# Verify data after the test has been "shot"
<verify>
<valgrind>
disable
</valgrind>
</verify>
</testcase>

Просмотреть файл

@ -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";