~ubuntu-branches/ubuntu/saucy/curl/saucy-201307251546

« back to all changes in this revision

Viewing changes to tests/data/test1406

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-03-23 16:24:51 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: package-import@ubuntu.com-20120323162451-z4gstlabjkgnrh7h
Tags: upstream-7.25.0
ImportĀ upstreamĀ versionĀ 7.25.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<testcase>
 
2
# Based on test802
 
3
# N.B. --libcurl output not sufficient to deal with uploaded files.
 
4
<info>
 
5
<keywords>
 
6
SMTP
 
7
--libcurl
 
8
</keywords>
 
9
</info>
 
10
 
 
11
#
 
12
# Server-side
 
13
<reply>
 
14
</reply>
 
15
 
 
16
#
 
17
# Client-side
 
18
<client>
 
19
<server>
 
20
smtp
 
21
</server>
 
22
 <name>
 
23
SMTP
 
24
 </name>
 
25
<file name="log/test1406.eml">
 
26
From: different
 
27
To: another
 
28
 
 
29
body
 
30
</file>
 
31
 <command>
 
32
smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 1406@foo --mail-rcpt 1406@foobar.example --mail-from 1406@from -T log/test1406.eml --libcurl log/test1406.c
 
33
</command>
 
34
</client>
 
35
 
 
36
#
 
37
# Verify data after the test has been "shot"
 
38
<verify>
 
39
<protocol>
 
40
EHLO user
 
41
MAIL FROM:<1406@from> SIZE=34
 
42
RCPT TO:<1406@foo>
 
43
RCPT TO:<1406@foobar.example>
 
44
DATA
 
45
QUIT
 
46
</protocol>
 
47
<upload>
 
48
From: different
 
49
To: another
 
50
 
 
51
body
 
52
 
 
53
.
 
54
</upload>
 
55
<file name="log/test1406.c" mode="text">
 
56
/********* Sample code generated by the curl command line tool **********
 
57
 * All curl_easy_setopt() options are documented at:
 
58
 * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
 
59
 ************************************************************************/
 
60
#include <curl/curl.h>
 
61
 
 
62
int main(int argc, char *argv[])
 
63
{
 
64
  CURLcode ret;
 
65
  CURL *hnd;
 
66
  struct curl_slist *slist1;
 
67
 
 
68
  slist1 = NULL;
 
69
  slist1 = curl_slist_append(slist1, "1406@foo");
 
70
  slist1 = curl_slist_append(slist1, "1406@foobar.example");
 
71
 
 
72
  hnd = curl_easy_init();
 
73
  curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)34);
 
74
  curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/user");
 
75
  curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
 
76
  curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
 
77
  curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
 
78
  curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
 
79
  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
 
80
  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
 
81
  curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, "1406@from");
 
82
  curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, slist1);
 
83
 
 
84
  /* Here is a list of options the curl code used that cannot get generated
 
85
     as source easily. You may select to either not use them or implement
 
86
     them yourself.
 
87
 
 
88
  CURLOPT_WRITEDATA set to a objectpointer
 
89
  CURLOPT_WRITEFUNCTION set to a functionpointer
 
90
  CURLOPT_READDATA set to a objectpointer
 
91
  CURLOPT_READFUNCTION set to a functionpointer
 
92
  CURLOPT_SEEKDATA set to a objectpointer
 
93
  CURLOPT_SEEKFUNCTION set to a functionpointer
 
94
  CURLOPT_ERRORBUFFER set to a objectpointer
 
95
  CURLOPT_STDERR set to a objectpointer
 
96
  CURLOPT_DEBUGFUNCTION set to a functionpointer
 
97
  CURLOPT_DEBUGDATA set to a objectpointer
 
98
 
 
99
  */
 
100
 
 
101
  ret = curl_easy_perform(hnd);
 
102
 
 
103
  curl_easy_cleanup(hnd);
 
104
  hnd = NULL;
 
105
  curl_slist_free_all(slist1);
 
106
  slist1 = NULL;
 
107
 
 
108
  return (int)ret;
 
109
}
 
110
/**** End of sample code ****/
 
111
</file>
 
112
<stripfile>
 
113
# curl's default user-agent varies with version, libraries etc.
 
114
s/(USERAGENT, \")[^\"]+/${1}stripped/
 
115
# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
 
116
# ignore them
 
117
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
 
118
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
 
119
</stripfile>
 
120
</verify>
 
121
</testcase>