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