test166 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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: Thu, 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. <server>
  21. http
  22. </server>
  23. <name>
  24. HTTP formpost a file with spaces in name
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/166 -F "name=@log/fie ld 166"
  28. </command>
  29. # We create this file before the command is invoked!
  30. <file name="log/fie ld 166">
  31. data inside the file
  32. </file>
  33. </client>
  34. # Verify data after the test has been "shot"
  35. <verify>
  36. <strip>
  37. ^(User-Agent:|Content-Type: multipart/form-data;|------------).*
  38. </strip>
  39. <protocol>
  40. POST /we/want/166 HTTP/1.1
  41. User-Agent: curl/7.12.0-CVS (i686-pc-linux-gnu) libcurl/7.12.0-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.2.0 libidn/0.4.3
  42. Host: %HOSTIP:%HTTPPORT
  43. Accept: */*
  44. Content-Length: 223
  45. Expect: 100-continue
  46. Content-Type: multipart/form-data; boundary=----------------------------b0b3d6d23991
  47. ------------------------------b0b3d6d23991
  48. Content-Disposition: form-data; name="name"; filename="fie ld 166"
  49. Content-Type: application/octet-stream
  50. data inside the file
  51. ------------------------------b0b3d6d23991--
  52. </protocol>
  53. </verify>
  54. </testcase>