test: --libcurl fixes

The line endings broke when I saved the three recent patches (my fault,
not Colin's) to 'git am' them.

Adjusted the stripping of the test program for comparing to also exclude
the SSH key file name as that will differ and use a local path name.
This commit is contained in:
Daniel Stenberg
2012-02-23 23:13:42 +01:00
parent 21130dab4f
commit 1a7bba1975
8 changed files with 108 additions and 92 deletions

View File

@@ -37,16 +37,18 @@ http://%HOSTIP:%HTTPPORT/we/want/1400 --libcurl log/test1400.c
^User-Agent:.* ^User-Agent:.*
</strip> </strip>
<protocol> <protocol>
GET /we/want/1400 HTTP/1.1 GET /we/want/1400 HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4 User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT Host: %HOSTIP:%HTTPPORT
Accept: */* Accept: */*
</protocol> </protocol>
<stripfile> <stripfile>
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
<file name="log/test1400.c"> <file name="log/test1400.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********

View File

@@ -39,19 +39,21 @@ http://%HOSTIP:%HTTPPORT/we/want/1401 --libcurl log/test1401.c --basic -u fake:u
^User-Agent:.* ^User-Agent:.*
</strip> </strip>
<protocol> <protocol>
GET /we/want/1401 HTTP/1.1 GET /we/want/1401 HTTP/1.1
User-Agent: stripped User-Agent: stripped
Authorization: Basic ZmFrZTp1c2Vy Authorization: Basic ZmFrZTp1c2Vy
Host: %HOSTIP:%HTTPPORT Host: %HOSTIP:%HTTPPORT
Accept: */* Accept: */*
Cookie: chocolate=chip Cookie: chocolate=chip
X-Files: Mulder X-Files: Mulder
X-Men: cyclops, iceman X-Men: cyclops, iceman
</protocol> </protocol>
<stripfile> <stripfile>
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
<file name="log/test1401.c"> <file name="log/test1401.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********

View File

@@ -39,20 +39,22 @@ http://%HOSTIP:%HTTPPORT/we/want/1402 --libcurl log/test1402.c -d "foo=bar" -d "
^User-Agent:.* ^User-Agent:.*
</strip> </strip>
<protocol nonewline="yes"> <protocol nonewline="yes">
POST /we/want/1402 HTTP/1.1 POST /we/want/1402 HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4 User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT Host: %HOSTIP:%HTTPPORT
Accept: */* Accept: */*
Content-Length: 16 Content-Length: 16
Content-Type: application/x-www-form-urlencoded Content-Type: application/x-www-form-urlencoded
foo=bar&baz=quux foo=bar&baz=quux
</protocol> </protocol>
<stripfile> <stripfile>
# curl's default user-agent varies with version, libraries etc. # curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
<file name="log/test1402.c"> <file name="log/test1402.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********

View File

@@ -39,17 +39,19 @@ http://%HOSTIP:%HTTPPORT/we/want/1403 --libcurl log/test1403.c -G -d "foo=bar" -
^User-Agent:.* ^User-Agent:.*
</strip> </strip>
<protocol> <protocol>
GET /we/want/1403?foo=bar&baz=quux HTTP/1.1 GET /we/want/1403?foo=bar&baz=quux HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4 User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT Host: %HOSTIP:%HTTPPORT
Accept: */* Accept: */*
</protocol> </protocol>
<stripfile> <stripfile>
# curl's default user-agent varies with version, libraries etc. # curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
<file name="log/test1403.c"> <file name="log/test1403.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********

View File

@@ -44,47 +44,49 @@ dummy data
(^User-Agent:.*|-----+\w+) (^User-Agent:.*|-----+\w+)
</strip> </strip>
<protocol> <protocol>
POST /we/want/1404 HTTP/1.1 POST /we/want/1404 HTTP/1.1
User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4 User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Host: %HOSTIP:%HTTPPORT Host: %HOSTIP:%HTTPPORT
Accept: */* Accept: */*
Content-Length: 795 Content-Length: 795
Expect: 100-continue Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
------------------------------9ef8d6205763 ------------------------------9ef8d6205763
Content-Disposition: form-data; name="name" Content-Disposition: form-data; name="name"
value value
------------------------------9ef8d6205763 ------------------------------9ef8d6205763
Content-Disposition: form-data; name="file" Content-Disposition: form-data; name="file"
Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa
Content-Disposition: attachment; filename="test1404.txt" Content-Disposition: attachment; filename="test1404.txt"
Content-Type: text/plain Content-Type: text/plain
dummy data dummy data
------------------------------9ef8d6205763 ------------------------------9ef8d6205763
Content-Disposition: attachment; filename="test1404.txt" Content-Disposition: attachment; filename="test1404.txt"
Content-Type: magic/content Content-Type: magic/content
dummy data dummy data
------------------------------9ef8d6205763 ------------------------------9ef8d6205763
Content-Disposition: attachment; filename="test1404.txt" Content-Disposition: attachment; filename="test1404.txt"
Content-Type: text/plain Content-Type: text/plain
dummy data dummy data
------------------------------aaaaaaaaaaaa-- ------------------------------aaaaaaaaaaaa--
------------------------------9ef8d6205763-- ------------------------------9ef8d6205763--
</protocol> </protocol>
<stripfile> <stripfile>
# curl's default user-agent varies with version, libraries etc. # curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
<file name="log/test1404.c"> <file name="log/test1404.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********

View File

@@ -41,20 +41,20 @@ ftp://%HOSTIP:%FTPPORT/1405 -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FAIL" -Q
# Verify data after the test has been "shot" # Verify data after the test has been "shot"
<verify> <verify>
<protocol> <protocol>
USER anonymous USER anonymous
PASS ftp@example.com PASS ftp@example.com
PWD PWD
NOOP 1 NOOP 1
FAIL FAIL
EPSV EPSV
PASV PASV
TYPE I TYPE I
NOOP 2 NOOP 2
FAIL HARD FAIL HARD
SIZE 1405 SIZE 1405
RETR 1405 RETR 1405
NOOP 3 NOOP 3
QUIT QUIT
</protocol> </protocol>
<file name="log/test1405.c"> <file name="log/test1405.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********
@@ -126,8 +126,10 @@ int main(int argc, char *argv[])
<stripfile> <stripfile>
# curl's default user-agent varies with version, libraries etc. # curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
</verify> </verify>
</testcase> </testcase>

View File

@@ -37,20 +37,20 @@ smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 1406@foo --mail-rcpt 1406@foobar.examp
# Verify data after the test has been "shot" # Verify data after the test has been "shot"
<verify> <verify>
<protocol> <protocol>
EHLO user EHLO user
MAIL FROM:<1406@from> SIZE=34 MAIL FROM:<1406@from> SIZE=34
RCPT TO:<1406@foo> RCPT TO:<1406@foo>
RCPT TO:<1406@foobar.example> RCPT TO:<1406@foobar.example>
DATA DATA
QUIT QUIT
</protocol> </protocol>
<upload> <upload>
From: different From: different
To: another To: another
body body
. .
</upload> </upload>
<file name="log/test1406.c"> <file name="log/test1406.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********
@@ -112,8 +112,10 @@ int main(int argc, char *argv[])
<stripfile> <stripfile>
# curl's default user-agent varies with version, libraries etc. # curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
</verify> </verify>
</testcase> </testcase>

View File

@@ -34,10 +34,10 @@ pop3://%HOSTIP:%POP3PORT/1407 -l -u user:secret --libcurl log/test1407.c
# Verify data after the test has been "shot" # Verify data after the test has been "shot"
<verify> <verify>
<protocol> <protocol>
USER user USER user
PASS secret PASS secret
LIST 1407 LIST 1407
QUIT QUIT
</protocol> </protocol>
<file name="log/test1407.c"> <file name="log/test1407.c">
/********* Sample code generated by the curl command line tool ********** /********* Sample code generated by the curl command line tool **********
@@ -90,8 +90,10 @@ int main(int argc, char *argv[])
<stripfile> <stripfile>
# curl's default user-agent varies with version, libraries etc. # curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/ s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER varies with configuration - just ignore it # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/ $_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
</stripfile> </stripfile>
</verify> </verify>
</testcase> </testcase>