test668 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. HTTP MIME POST
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 200 OK
  14. Date: Tue, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake swsclose
  16. Connection: close
  17. Content-Type: text/html
  18. hello
  19. </data>
  20. <datacheck>
  21. HTTP/1.1 200 OK
  22. Date: Tue, 09 Nov 2010 14:49:00 GMT
  23. Server: test-server/fake swsclose
  24. Connection: close
  25. Content-Type: text/html
  26. hello
  27. </datacheck>
  28. </reply>
  29. # Client-side
  30. <client>
  31. <server>
  32. http
  33. </server>
  34. # tool is what to use instead of 'curl'
  35. <tool>
  36. lib%TESTNUMBER
  37. </tool>
  38. <name>
  39. HTTP mimepost early end of data detection
  40. </name>
  41. <command>
  42. http://%HOSTIP:%HTTPPORT/%TESTNUMBER
  43. </command>
  44. <file name="log/file%TESTNUMBER.txt">
  45. This is data from a file
  46. </file>
  47. </client>
  48. #
  49. # Verify data after the test has been "shot"
  50. <verify>
  51. <strippart>
  52. s/^--------------------------[a-z0-9]*/------------------------------/
  53. s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
  54. </strippart>
  55. # Note that the stripping above removes 12 bytes from every occurrence of the
  56. # boundary string and since 5 of them are in the body contents, we see
  57. # (5*12) == 60 bytes less
  58. <protocol>
  59. POST /%TESTNUMBER HTTP/1.1
  60. Host: %HOSTIP:%HTTPPORT
  61. Accept: */*
  62. Transfer-Encoding: chunked
  63. Content-Type: multipart/form-data; boundary=----------------------------
  64. Expect: 100-continue
  65. %if hyper
  66. C1
  67. %else
  68. c1
  69. %endif
  70. ------------------------------
  71. Content-Disposition: form-data; name="field1"
  72. dummy
  73. ------------------------------
  74. Content-Disposition: form-data; name="field2"
  75. 5
  76. dummy
  77. 91
  78. ------------------------------
  79. Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt"
  80. Content-Type: text/plain
  81. 49
  82. This is data from a file
  83. --------------------------------
  84. 0
  85. </protocol>
  86. </verify>
  87. </testcase>