1<testcase>
2<info>
3<keywords>
4Metalink
5HTTP
6HTTP GET
7</keywords>
8</info>
9
10#
11# Server-side
12<reply>
13<data nocheck="yes">
14HTTP/1.1 200 OK
15Date: Thu, 21 Jun 2012 15:23:48 GMT
16Server: test-server/fake
17Content-Length: 43
18Connection: close
19Content-Type: text/html
20Content-Disposition: filename=name2008; charset=funny; option=strange
21Funny-head: yesyes
22
23Some stuff delivered from an HTTP resource
24</data>
25</reply>
26
27#
28# Client-side
29<client>
30<features>
31file
32Metalink
33</features>
34<server>
35http
36</server>
37 <name>
38Metalink local XML file, HTTP resource, using -o fname -D file
39 </name>
40<command option="no-output,no-include">
41--metalink file://%PWD/log/test2008.metalink -o log/outfile2008 -D log/heads2008
42</command>
43# local metalink file written before test command runs
44<file name="log/test2008.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/download2008">
49   <verification>
50    <hash type="md5">we-only-check-the-strongest-hash-provided</hash>
51    <hash type="sha256">711b1b566b536c5baae9b36f2f5c1830a7c8ff126d1afa2febc5b59f8d0aab54</hash>
52   </verification>
53   <resources maxconnections="1">
54    <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2008</url>
55   </resources>
56  </file>
57 </files>
58</metalink>
59</file>
60<postcheck>
61perl %SRCDIR/libtest/notexists.pl log/2008 log/name2008 log/outfile2008
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>
72GET /2008 HTTP/1.1
73Host: %HOSTIP:%HTTPPORT
74Accept: */*
75
76</protocol>
77<file1 name="log/download2008">
78Some stuff delivered from an HTTP resource
79</file1>
80<file2 name="log/heads2008">
81HTTP/1.1 200 OK
82Date: Thu, 21 Jun 2012 15:23:48 GMT
83Server: test-server/fake
84Content-Length: 43
85Connection: close
86Content-Type: text/html
87Content-Disposition: filename=name2008; charset=funny; option=strange
88Funny-head: yesyes
89
90</file2>
91<file3 name="log/stdout2008">
92</file3>
93<file4 name="log/stderr2008">
94Metalink: parsing (file://%PWD/log/test2008.metalink) metalink/XML...
95Metalink: parsing (file://%PWD/log/test2008.metalink) OK
96Metalink: fetching (log/download2008) from (http://%HOSTIP:%HTTPPORT/2008)...
97Metalink: fetching (log/download2008) from (http://%HOSTIP:%HTTPPORT/2008) OK
98Metalink: validating (log/download2008)...
99Metalink: validating (log/download2008) [sha-256] OK
100</file4>
101<stripfile4>
102$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
103</stripfile4>
104</verify>
105</testcase>
106