• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: Wed, 20 Jun 2012 14:49:00 GMT
16Server: test-server/fake
17Content-Length: 46
18Connection: close
19Content-Type: text/html
20Content-Disposition: filename=name2012; charset=funny; option=strange
21Funny-head: yesyes
22
23Some contents delivered from an HTTP resource
24</data>
25</reply>
26
27#
28# Client-side
29<client>
30<server>
31http
32</server>
33<features>
34file
35Metalink
36</features>
37 <name>
38Metalink local XML file, HTTP resource, without hash
39 </name>
40<command option="no-output,no-include">
41--metalink file://%PWD/log/test2012.metalink
42</command>
43# local metalink file written before test command runs
44<file name="log/test2012.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/download2012">
49   <verification>
50   </verification>
51   <resources maxconnections="1">
52    <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2012</url>
53   </resources>
54  </file>
55 </files>
56</metalink>
57</file>
58<postcheck>
59perl %SRCDIR/libtest/notexists.pl log/2012 log/name2012
60</postcheck>
61</client>
62
63#
64# Verify data after the test has been "shot"
65<verify>
66<strip>
67^User-Agent:.*
68</strip>
69<protocol>
70GET /2012 HTTP/1.1
71Host: %HOSTIP:%HTTPPORT
72Accept: */*
73
74</protocol>
75<file1 name="log/download2012">
76Some contents delivered from an HTTP resource
77</file1>
78<file2 name="log/stdout2012">
79</file2>
80<file3 name="log/stderr2012">
81Metalink: parsing (file://%PWD/log/test2012.metalink) metalink/XML...
82Metalink: parsing (file://%PWD/log/test2012.metalink) WARNING (digest missing)
83Metalink: fetching (log/download2012) from (http://%HOSTIP:%HTTPPORT/2012)...
84Metalink: fetching (log/download2012) from (http://%HOSTIP:%HTTPPORT/2012) OK
85Metalink: validating (log/download2012)...
86Metalink: validating (log/download2012) FAILED (digest missing)
87</file3>
88<stripfile3>
89$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
90</stripfile3>
91</verify>
92</testcase>
93