test554 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. </keywords>
  7. </info>
  8. #
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 200 OK
  13. Date: Thu, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake swsclose
  15. Connection: close
  16. Content-Type: text/html
  17. hello
  18. </data>
  19. </reply>
  20. # Client-side
  21. <client>
  22. <server>
  23. http
  24. </server>
  25. # tool is what to use instead of 'curl'
  26. <tool>
  27. lib554
  28. </tool>
  29. <name>
  30. HTTP multi-part formpost using read callback for the file part
  31. </name>
  32. <command>
  33. http://%HOSTIP:%HTTPPORT/554
  34. </command>
  35. </client>
  36. #
  37. # Verify data after the test has been "shot"
  38. <verify>
  39. <strippart>
  40. s/^--------------------------[a-z0-9]*/------------------------------/
  41. s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
  42. </strippart>
  43. # Note that the stripping above removes 12 bytes from every occurance of the
  44. # boundary string and since 5 of them are in the body contents, we see
  45. # (5*12) == 60 bytes less
  46. <protocol>
  47. POST /554 HTTP/1.1
  48. Host: %HOSTIP:%HTTPPORT
  49. Accept: */*
  50. Content-Length: 718
  51. Expect: 100-continue
  52. Content-Type: multipart/form-data; boundary=----------------------------
  53. ------------------------------
  54. Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
  55. this is what we post to the silly web server
  56. ------------------------------
  57. Content-Disposition: form-data; name="callbackdata"
  58. this is what we post to the silly web server
  59. ------------------------------
  60. Content-Disposition: form-data; name="filename"
  61. postit2.c
  62. ------------------------------
  63. Content-Disposition: form-data; name="submit"
  64. send
  65. ------------------------------
  66. Content-Disposition: form-data; name="somename"; filename="somefile.txt"
  67. Content-Type: text/plain
  68. blah blah
  69. --------------------------------
  70. </protocol>
  71. </verify>
  72. </testcase>