test2008 2.5 KB

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