2
0

test2012 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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: 46
  17. Connection: close
  18. Content-Type: text/html
  19. Content-Disposition: filename=name2012; charset=funny; option=strange
  20. Funny-head: yesyes
  21. Some contents 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, without hash
  36. </name>
  37. <command option="no-output,no-include">
  38. --metalink file://%PWD/log/test2012.metalink
  39. </command>
  40. # local metalink file written before test command runs
  41. <file name="log/test2012.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/download2012">
  46. <verification>
  47. </verification>
  48. <resources maxconnections="1">
  49. <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2012</url>
  50. </resources>
  51. </file>
  52. </files>
  53. </metalink>
  54. </file>
  55. <postcheck>
  56. perl %SRCDIR/libtest/notexists.pl log/2012 log/name2012
  57. </postcheck>
  58. </client>
  59. #
  60. # Verify data after the test has been "shot"
  61. <verify>
  62. <strip>
  63. ^User-Agent:.*
  64. </strip>
  65. <protocol>
  66. GET /2012 HTTP/1.1
  67. Host: %HOSTIP:%HTTPPORT
  68. Accept: */*
  69. </protocol>
  70. <file1 name="log/download2012">
  71. Some contents delivered from an HTTP resource
  72. </file1>
  73. <file2 name="log/stdout2012">
  74. </file2>
  75. <file3 name="log/stderr2012">
  76. Metalink: parsing (file://%PWD/log/test2012.metalink) metalink/XML...
  77. Metalink: parsing (file://%PWD/log/test2012.metalink) WARNING (digest missing)
  78. Metalink: fetching (log/download2012) from (http://%HOSTIP:%HTTPPORT/2012)...
  79. Metalink: fetching (log/download2012) from (http://%HOSTIP:%HTTPPORT/2012) OK
  80. Metalink: validating (log/download2012)...
  81. Metalink: validating (log/download2012) FAILED (digest missing)
  82. </file3>
  83. <stripfile3>
  84. $_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
  85. </stripfile3>
  86. </verify>
  87. </testcase>