test2009 2.5 KB

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