test71 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. config file
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 200 OK swsclose
  13. Date: Thu, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake
  15. Content-Length: 11
  16. blablabla
  17. </data>
  18. </reply>
  19. # Client-side
  20. <client>
  21. <server>
  22. http
  23. </server>
  24. <name>
  25. HTTP and -F upload in config file
  26. </name>
  27. <stdin>
  28. -F name=daniel
  29. -F tool=curl
  30. -F file=@log/test71.txt
  31. user-agent = ""
  32. </stdin>
  33. <command>
  34. http://%HOSTIP:%HTTPPORT/we/want/71 -K -
  35. </command>
  36. # We create this file before the command is invoked!
  37. <file name="log/test71.txt">
  38. foo-
  39. This is a moo-
  40. bar
  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/71 HTTP/1.1
  50. Host: %HOSTIP:%HTTPPORT
  51. Accept: */*
  52. Content-Length: 408
  53. Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
  54. ------------------------------9ef8d6205763
  55. Content-Disposition: form-data; name="name"
  56. daniel
  57. ------------------------------9ef8d6205763
  58. Content-Disposition: form-data; name="tool"
  59. curl
  60. ------------------------------9ef8d6205763
  61. Content-Disposition: form-data; name="file"; filename="test71.txt"
  62. Content-Type: text/plain
  63. foo-
  64. This is a moo-
  65. bar
  66. ------------------------------9ef8d6205763--
  67. </protocol>
  68. </verify>
  69. </testcase>