test2009 2.5 KB

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