test2010 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 17:37:27 GMT
  15. Server: test-server/fake
  16. Content-Length: 41
  17. Connection: close
  18. Content-Type: text/html
  19. Content-Disposition: filename=name2010; charset=funny; option=strange
  20. Funny-head: yesyes
  21. Contents 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 -i -D file
  36. </name>
  37. <command option="no-output,no-include">
  38. --metalink file://%PWD/log/test2010.metalink -i -o log/outfile2010 -D log/heads2010
  39. </command>
  40. # local metalink file written before test command runs
  41. <file name="log/test2010.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/download2010">
  46. <verification>
  47. <hash type="md5">we-only-check-the-strongest-hash-provided</hash>
  48. <hash type="sha256">19dcb4e2a99b9cd02c30b1ed6c55869b7ef8cda9f985648909c48a6dbb54356c</hash>
  49. </verification>
  50. <resources maxconnections="1">
  51. <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2010</url>
  52. </resources>
  53. </file>
  54. </files>
  55. </metalink>
  56. </file>
  57. <postcheck>
  58. perl %SRCDIR/libtest/notexists.pl log/2010 log/name2010 log/outfile2010
  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 /2010 HTTP/1.1
  69. Host: %HOSTIP:%HTTPPORT
  70. Accept: */*
  71. </protocol>
  72. <file1 name="log/download2010">
  73. Contents delivered from an HTTP resource
  74. </file1>
  75. <file2 name="log/heads2010">
  76. HTTP/1.1 200 OK
  77. Date: Thu, 21 Jun 2012 17:37:27 GMT
  78. Server: test-server/fake
  79. Content-Length: 41
  80. Connection: close
  81. Content-Type: text/html
  82. Content-Disposition: filename=name2010; charset=funny; option=strange
  83. Funny-head: yesyes
  84. </file2>
  85. <file3 name="log/stdout2010">
  86. </file3>
  87. <file4 name="log/stderr2010">
  88. Metalink: parsing (file://%PWD/log/test2010.metalink) metalink/XML...
  89. Metalink: parsing (file://%PWD/log/test2010.metalink) OK
  90. Metalink: fetching (log/download2010) from (http://%HOSTIP:%HTTPPORT/2010)...
  91. Metalink: fetching (log/download2010) from (http://%HOSTIP:%HTTPPORT/2010) OK
  92. Metalink: validating (log/download2010)...
  93. Metalink: validating (log/download2010) [sha-256] OK
  94. </file4>
  95. <stripfile4>
  96. $_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
  97. </stripfile4>
  98. </verify>
  99. </testcase>