test163 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. </keywords>
  7. </info>
  8. # Server-side
  9. <reply>
  10. <data>
  11. HTTP/1.1 200 OK swsclose
  12. Date: Tue, 09 Nov 2010 14:49:00 GMT
  13. Server: test-server/fake
  14. Content-Length: 10
  15. blablabla
  16. </data>
  17. </reply>
  18. # Client-side
  19. <client>
  20. <features>
  21. Mime
  22. </features>
  23. <server>
  24. http
  25. </server>
  26. <name>
  27. HTTP multipart formpost with contents from a file
  28. </name>
  29. <command>
  30. http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=<%LOGDIR/field%TESTNUMBER" -F tool=curl
  31. </command>
  32. # We create this file before the command is invoked!
  33. <file name="%LOGDIR/field%TESTNUMBER">
  34. contents
  35. from
  36. a
  37. file
  38. newlinens?
  39. yes please
  40. [tab][CR] too
  41. </file>
  42. </client>
  43. # Verify data after the test has been "shot"
  44. <verify>
  45. <strip>
  46. ^(Content-Type: multipart/form-data;|------------).*
  47. </strip>
  48. <protocol>
  49. POST /we/want/%TESTNUMBER HTTP/1.1
  50. Host: %HOSTIP:%HTTPPORT
  51. User-Agent: curl/%VERSION
  52. Accept: */*
  53. Content-Length: 322
  54. Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac
  55. ------------------------------c2d1767eb6ac
  56. Content-Disposition: form-data; name="name"
  57. contents
  58. from
  59. a
  60. file
  61. newlinens?
  62. yes please
  63. [tab][CR] too
  64. ------------------------------c2d1767eb6ac
  65. Content-Disposition: form-data; name="tool"
  66. curl
  67. ------------------------------c2d1767eb6ac--
  68. </protocol>
  69. </verify>
  70. </testcase>