test9 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: Tue, 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/%TESTNUMBER -F name=daniel -F tool=curl -F file=@log/test%TESTNUMBER.txt
  28. </command>
  29. # We create this file before the command is invoked!
  30. <file name="log/test%TESTNUMBER.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. ^(Content-Type: multipart/form-data;|------------).*
  40. </strip>
  41. <protocol>
  42. POST /we/want/%TESTNUMBER HTTP/1.1
  43. Host: %HOSTIP:%HTTPPORT
  44. User-Agent: curl/%VERSION
  45. Accept: */*
  46. Content-Length: 407
  47. Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
  48. ------------------------------9ef8d6205763
  49. Content-Disposition: form-data; name="name"
  50. daniel
  51. ------------------------------9ef8d6205763
  52. Content-Disposition: form-data; name="tool"
  53. curl
  54. ------------------------------9ef8d6205763
  55. Content-Disposition: form-data; name="file"; filename="test9.txt"
  56. Content-Type: text/plain
  57. foo-
  58. This is a moo-
  59. bar
  60. ------------------------------9ef8d6205763--
  61. </protocol>
  62. </verify>
  63. </testcase>