test554 1.7 KB

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