test668 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. HTTP MIME POST
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 200 OK
  14. Date: Tue, 09 Nov 2010 14:4f:00 GMT
  15. Server: test-server/fake swsclose
  16. Connection: close
  17. Content-Type: text/html
  18. hello
  19. </data>
  20. <datacheck>
  21. HTTP/1.1 200 OK
  22. Date: Tue, 09 Nov 2010 14:4f:00 GMT
  23. Server: test-server/fake swsclose
  24. Connection: close
  25. Content-Type: text/html
  26. hello
  27. </datacheck>
  28. </reply>
  29. # Client-side
  30. <client>
  31. <features>
  32. Mime
  33. </features>
  34. <server>
  35. http
  36. </server>
  37. # tool is what to use instead of 'curl'
  38. <tool>
  39. lib%TESTNUMBER
  40. </tool>
  41. <name>
  42. HTTP mimepost early end of data detection
  43. </name>
  44. <command>
  45. http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
  46. </command>
  47. <file name="%LOGDIR/file%TESTNUMBER.txt">
  48. This is data from a file
  49. </file>
  50. </client>
  51. #
  52. # Verify data after the test has been "shot"
  53. <verify>
  54. <strippart>
  55. s/^--------------------------[A-Za-z0-9]*/------------------------------/
  56. s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
  57. </strippart>
  58. # Note that the stripping above removes 12 bytes from every occurrence of the
  59. # boundary string and since 5 of them are in the body contents, we see
  60. # (5*12) == 60 bytes less
  61. <protocol>
  62. POST /%TESTNUMBER HTTP/1.1
  63. Host: %HOSTIP:%HTTPPORT
  64. Accept: */*
  65. Transfer-Encoding: chunked
  66. Content-Type: multipart/form-data; boundary=----------------------------
  67. Expect: 100-continue
  68. %if hyper
  69. CD
  70. %else
  71. cd
  72. %endif
  73. ------------------------------
  74. Content-Disposition: form-data; name="field1"
  75. dummy
  76. ------------------------------
  77. Content-Disposition: form-data; name="field2"
  78. 5
  79. dummy
  80. 97
  81. ------------------------------
  82. Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt"
  83. Content-Type: text/plain
  84. %if hyper
  85. 4F
  86. %else
  87. 4f
  88. %endif
  89. This is data from a file
  90. --------------------------------
  91. 0
  92. </protocol>
  93. </verify>
  94. </testcase>