test2005 2.0 KB

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