test2012 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 %TESTNUMBER 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=name%TESTNUMBER; 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/test%TESTNUMBER.metalink
  39. </command>
  40. # local metalink file written before test command runs
  41. <file name="log/test%TESTNUMBER.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/download%TESTNUMBER">
  46. <verification>
  47. </verification>
  48. <resources maxconnections="1">
  49. <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/%TESTNUMBER</url>
  50. </resources>
  51. </file>
  52. </files>
  53. </metalink>
  54. </file>
  55. <postcheck>
  56. perl %SRCDIR/libtest/notexists.pl log/%TESTNUMBER log/name%TESTNUMBER
  57. </postcheck>
  58. </client>
  59. #
  60. # Verify data after the test has been "shot"
  61. <verify>
  62. <protocol>
  63. GET /%TESTNUMBER HTTP/1.1
  64. Host: %HOSTIP:%HTTPPORT
  65. User-Agent: curl/%VERSION
  66. Accept: */*
  67. </protocol>
  68. <file1 name="log/download%TESTNUMBER">
  69. Some contents delivered from an HTTP resource
  70. </file1>
  71. <file2 name="log/stdout%TESTNUMBER">
  72. </file2>
  73. <file3 name="log/stderr%TESTNUMBER" mode="text">
  74. Metalink: parsing (file://%PWD/log/test%TESTNUMBER.metalink) metalink/XML...
  75. Metalink: parsing (file://%PWD/log/test%TESTNUMBER.metalink) WARNING (digest missing)
  76. Metalink: fetching (log/download%TESTNUMBER) from (http://%HOSTIP:%HTTPPORT/%TESTNUMBER)...
  77. Metalink: fetching (log/download%TESTNUMBER) from (http://%HOSTIP:%HTTPPORT/%TESTNUMBER) OK
  78. Metalink: validating (log/download%TESTNUMBER)...
  79. Metalink: validating (log/download%TESTNUMBER) FAILED (digest missing)
  80. </file3>
  81. <stripfile3>
  82. $_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
  83. </stripfile3>
  84. </verify>
  85. </testcase>