Imported Upstream version 7.59.0
[platform/upstream/curl.git] / tests / data / test2010
1 <testcase>
2 <info>
3 <keywords>
4 Metalink
5 HTTP
6 HTTP GET
7 </keywords>
8 </info>
9
10 #
11 # Server-side
12 <reply>
13 <data nocheck="yes">
14 HTTP/1.1 200 OK
15 Date: Thu, 21 Jun 2012 17:37:27 GMT
16 Server: test-server/fake
17 Content-Length: 41
18 Connection: close
19 Content-Type: text/html
20 Content-Disposition: filename=name2010; charset=funny; option=strange
21 Funny-head: yesyes
22
23 Contents delivered from an HTTP resource
24 </data>
25 </reply>
26
27 #
28 # Client-side
29 <client>
30 <features>
31 file
32 Metalink
33 </features>
34 <server>
35 http
36 </server>
37  <name>
38 Metalink local XML file, HTTP resource, using -o fname -i -D file
39  </name>
40 <command option="no-output,no-include">
41 --metalink file://%PWD/log/test2010.metalink -i -o log/outfile2010 -D log/heads2010
42 </command>
43 # local metalink file written before test command runs
44 <file name="log/test2010.metalink">
45 <?xml version="1.0" encoding="utf-8"?>
46 <metalink version="3.0" xmlns="http://www.metalinker.org/">
47  <files>
48   <file name="log/download2010">
49    <verification>
50     <hash type="md5">we-only-check-the-strongest-hash-provided</hash>
51     <hash type="sha256">19dcb4e2a99b9cd02c30b1ed6c55869b7ef8cda9f985648909c48a6dbb54356c</hash>
52    </verification>
53    <resources maxconnections="1">
54     <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2010</url>
55    </resources>
56   </file>
57  </files>
58 </metalink>
59 </file>
60 <postcheck>
61 perl %SRCDIR/libtest/notexists.pl log/2010 log/name2010 log/outfile2010
62 </postcheck>
63 </client>
64
65 #
66 # Verify data after the test has been "shot"
67 <verify>
68 <strip>
69 ^User-Agent:.*
70 </strip>
71 <protocol>
72 GET /2010 HTTP/1.1
73 Host: %HOSTIP:%HTTPPORT
74 Accept: */*
75
76 </protocol>
77 <file1 name="log/download2010">
78 Contents delivered from an HTTP resource
79 </file1>
80 <file2 name="log/heads2010">
81 HTTP/1.1 200 OK
82 Date: Thu, 21 Jun 2012 17:37:27 GMT
83 Server: test-server/fake
84 Content-Length: 41
85 Connection: close
86 Content-Type: text/html
87 Content-Disposition: filename=name2010; charset=funny; option=strange
88 Funny-head: yesyes
89
90 </file2>
91 <file3 name="log/stdout2010">
92 </file3>
93 <file4 name="log/stderr2010">
94 Metalink: parsing (file://%PWD/log/test2010.metalink) metalink/XML...
95 Metalink: parsing (file://%PWD/log/test2010.metalink) OK
96 Metalink: fetching (log/download2010) from (http://%HOSTIP:%HTTPPORT/2010)...
97 Metalink: fetching (log/download2010) from (http://%HOSTIP:%HTTPPORT/2010) OK
98 Metalink: validating (log/download2010)...
99 Metalink: validating (log/download2010) [sha-256] OK
100 </file4>
101 <stripfile4>
102 $_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
103 </stripfile4>
104 </verify>
105 </testcase>