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