Skip to content

Commit

Permalink
test: verify the opensocket callback for FTP
Browse files Browse the repository at this point in the history
test 595: for passive FTP
test 596: for active FTP
  • Loading branch information
bagder committed Dec 4, 2011
1 parent 62d3652 commit 5971d40
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
57 changes: 57 additions & 0 deletions tests/data/test595
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# This test is like 585 but uses passive FTP instead of HTTP
#
<testcase>
<info>
<keywords>
FTP
</keywords>
</info>
#
# Server-side
<reply>
<data>
moo
</data>
<datacheck>
[OPEN] counter: 1
[OPEN] counter: 2
moo
[CLOSE] counter: 2
[CLOSE] counter: 1
</datacheck>
</reply>

# Client-side
<client>
<server>
ftp
</server>
# tool is what to use instead of 'curl'
<tool>
lib585
</tool>

<name>
verify close callbacks with passive FTP
</name>
<command>
ftp://%HOSTIP:%FTPPORT/595 log/ip595
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 595
RETR 595
QUIT
</protocol>
</verify>
</testcase>
57 changes: 57 additions & 0 deletions tests/data/test596
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# This test is like 585 but uses active FTP instead of HTTP
#
<testcase>
<info>
<keywords>
FTP
</keywords>
</info>
#
# Server-side
<reply>
<data>
moo
</data>
<datacheck>
[OPEN] counter: 1
[OPEN] counter: 2
moo
[CLOSE] counter: 2
[CLOSE] counter: 1
</datacheck>
</reply>

# Client-side
<client>
<server>
ftp
</server>
# tool is what to use instead of 'curl'
<tool>
lib585
</tool>

<name>
verify close callbacks with active FTP
</name>
<command>
ftp://%HOSTIP:%FTPPORT/596 log/ip596 activeftp
</command>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
EPSV
TYPE I
SIZE 596
RETR 596
QUIT
</protocol>
</verify>
</testcase>
3 changes: 3 additions & 0 deletions tests/libtest/lib500.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5971d40

Please sign in to comment.