2
0

test9 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. HTTP file upload
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.0 200 OK swsclose
  13. Date: Thu, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake
  15. blablabla
  16. </data>
  17. </reply>
  18. # Client-side
  19. <client>
  20. <server>
  21. http
  22. </server>
  23. <name>
  24. HTTP RFC1867-type formposting
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/9 -F name=daniel -F tool=curl -F file=@log/test9.txt
  28. </command>
  29. # We create this file before the command is invoked!
  30. <file name="log/test9.txt">
  31. foo-
  32. This is a moo-
  33. bar
  34. </file>
  35. </client>
  36. # Verify data after the test has been "shot"
  37. <verify>
  38. <strip>
  39. ^(User-Agent:|Content-Type: multipart/form-data;|------------).*
  40. </strip>
  41. <protocol>
  42. POST /we/want/9 HTTP/1.1
  43. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  44. Host: %HOSTIP:%HTTPPORT
  45. Accept: */*
  46. Content-Length: 407
  47. Expect: 100-continue
  48. Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
  49. ------------------------------9ef8d6205763
  50. Content-Disposition: form-data; name="name"
  51. daniel
  52. ------------------------------9ef8d6205763
  53. Content-Disposition: form-data; name="tool"
  54. curl
  55. ------------------------------9ef8d6205763
  56. Content-Disposition: form-data; name="file"; filename="test9.txt"
  57. Content-Type: text/plain
  58. foo-
  59. This is a moo-
  60. bar
  61. ------------------------------9ef8d6205763--
  62. </protocol>
  63. </verify>
  64. </testcase>