test2008 2.5 KB

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