From 5971d401d4fd184aedd3b439251a898ecdacb96e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 4 Dec 2011 23:10:12 +0100 Subject: test: verify the opensocket callback for FTP test 595: for passive FTP test 596: for active FTP --- tests/data/Makefile.am | 2 +- tests/data/test595 | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test596 | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/libtest/lib500.c | 3 +++ 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 tests/data/test595 create mode 100644 tests/data/test596 (limited to 'tests') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 75b3781aa..23e2a7ddd 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -48,7 +48,7 @@ test551 test552 test553 test554 test555 test556 test557 test560 test561 \ test562 test563 test564 test565 test566 test567 test568 test569 test570 \ test571 test572 test573 test574 test575 test576 test578 test579 test580 \ test581 test582 test583 test584 test585 test586 test587 test588 test590 \ -test591 test592 test593 test594 \ +test591 test592 test593 test594 test595 test596 \ test600 test601 test602 test603 test604 \ test605 test606 test607 test608 test609 test610 test611 test612 test613 \ test614 test615 test616 test617 test618 test619 test620 test621 test622 \ diff --git a/tests/data/test595 b/tests/data/test595 new file mode 100644 index 000000000..28ff9c1a1 --- /dev/null +++ b/tests/data/test595 @@ -0,0 +1,57 @@ +# +# This test is like 585 but uses passive FTP instead of HTTP +# + + + +FTP + + +# +# Server-side + + +moo + + +[OPEN] counter: 1 +[OPEN] counter: 2 +moo +[CLOSE] counter: 2 +[CLOSE] counter: 1 + + + +# Client-side + + +ftp + +# tool is what to use instead of 'curl' + +lib585 + + + +verify close callbacks with passive FTP + + +ftp://%HOSTIP:%FTPPORT/595 log/ip595 + + + +# +# Verify data after the test has been "shot" + + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE 595 +RETR 595 +QUIT + + + diff --git a/tests/data/test596 b/tests/data/test596 new file mode 100644 index 000000000..9703f0471 --- /dev/null +++ b/tests/data/test596 @@ -0,0 +1,57 @@ +# +# This test is like 585 but uses active FTP instead of HTTP +# + + + +FTP + + +# +# Server-side + + +moo + + +[OPEN] counter: 1 +[OPEN] counter: 2 +moo +[CLOSE] counter: 2 +[CLOSE] counter: 1 + + + +# Client-side + + +ftp + +# tool is what to use instead of 'curl' + +lib585 + + + +verify close callbacks with active FTP + + +ftp://%HOSTIP:%FTPPORT/596 log/ip596 activeftp + + + +# +# Verify data after the test has been "shot" + + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +SIZE 596 +RETR 596 +QUIT + + + diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c index 51680fc31..812fb0dd5 100644 --- a/tests/libtest/lib500.c +++ b/tests/libtest/lib500.c @@ -76,6 +76,9 @@ int test(char *URL) test_setopt(curl, CURLOPT_URL, URL); test_setopt(curl, CURLOPT_HEADER, 1L); + if(libtest_arg3 && !strcmp(libtest_arg3, "activeftp")) + test_setopt(curl, CURLOPT_FTPPORT, "-"); + setupcallbacks(curl); res = curl_easy_perform(curl); -- cgit v1.2.3