1<testcase> 2<info> 3<keywords> 4Metalink 5HTTP 6HTTP GET 7-J 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 16:27:17 GMT 17Server: test-server/fake 18Content-Length: 46 19Connection: close 20Content-Type: text/html 21Content-Disposition: filename=name2009; charset=funny; option=strange 22Funny-head: yesyes 23 24Some contents 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 -J -D file 40 </name> 41<command option="no-output,no-include"> 42--metalink file://%PWD/log/test2009.metalink -J -o log/outfile2009 -D log/heads2009 43</command> 44# local metalink file written before test command runs 45<file name="log/test2009.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/download2009"> 50 <verification> 51 <hash type="md5">we-only-check-the-strongest-hash-provided</hash> 52 <hash type="sha256">e4c5b83384ba7d5f8e201d61747a14f29baacd7dfadce0fbd56661db4bba72b2</hash> 53 </verification> 54 <resources maxconnections="1"> 55 <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2009</url> 56 </resources> 57 </file> 58 </files> 59</metalink> 60</file> 61<postcheck> 62perl %SRCDIR/libtest/notexists.pl log/2009 log/name2009 log/outfile2009 63</postcheck> 64</client> 65 66# 67# Verify data after the test has been "shot" 68<verify> 69<strip> 70^User-Agent:.* 71</strip> 72<protocol> 73GET /2009 HTTP/1.1 74Host: %HOSTIP:%HTTPPORT 75Accept: */* 76 77</protocol> 78<file1 name="log/download2009"> 79Some contents delivered from an HTTP resource 80</file1> 81<file2 name="log/heads2009"> 82HTTP/1.1 200 OK 83Date: Thu, 21 Jun 2012 16:27:17 GMT 84Server: test-server/fake 85Content-Length: 46 86Connection: close 87Content-Type: text/html 88Content-Disposition: filename=name2009; charset=funny; option=strange 89Funny-head: yesyes 90 91</file2> 92<file3 name="log/stdout2009"> 93</file3> 94<file4 name="log/stderr2009"> 95Metalink: parsing (file://%PWD/log/test2009.metalink) metalink/XML... 96Metalink: parsing (file://%PWD/log/test2009.metalink) OK 97Metalink: fetching (log/download2009) from (http://%HOSTIP:%HTTPPORT/2009)... 98Metalink: fetching (log/download2009) from (http://%HOSTIP:%HTTPPORT/2009) OK 99Metalink: validating (log/download2009)... 100Metalink: validating (log/download2009) [sha-256] OK 101</file4> 102<stripfile4> 103$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i)) 104</stripfile4> 105</verify> 106</testcase> 107