test654 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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:49: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:49:00 GMT
  23. Server: test-server/fake swsclose
  24. Connection: close
  25. Content-Type: text/html
  26. hello
  27. HTTP/1.1 200 OK
  28. Date: Tue, 09 Nov 2010 14:49:00 GMT
  29. Server: test-server/fake swsclose
  30. Connection: close
  31. Content-Type: text/html
  32. hello
  33. </datacheck>
  34. </reply>
  35. # Client-side
  36. <client>
  37. <server>
  38. http
  39. </server>
  40. # tool is what to use instead of 'curl'
  41. <tool>
  42. lib%TESTNUMBER
  43. </tool>
  44. <name>
  45. HTTP duplicate easy handle with mime data
  46. </name>
  47. <command>
  48. http://%HOSTIP:%HTTPPORT/%TESTNUMBER
  49. </command>
  50. <file name="log/file%TESTNUMBER.txt">
  51. This is data from a file
  52. </file>
  53. </client>
  54. #
  55. # Verify data after the test has been "shot"
  56. <verify>
  57. <strippart>
  58. s/^--------------------------[a-z0-9]*/------------------------------/
  59. s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
  60. </strippart>
  61. # Note that the stripping above removes 12 bytes from every occurrence of the
  62. # boundary string and since 5 of them are in the body contents, we see
  63. # (5*12) == 60 bytes less
  64. <protocol>
  65. POST /%TESTNUMBER HTTP/1.1
  66. Host: %HOSTIP:%HTTPPORT
  67. Accept: */*
  68. Content-Length: 0
  69. POST /%TESTNUMBER HTTP/1.1
  70. Host: %HOSTIP:%HTTPPORT
  71. Accept: */*
  72. Transfer-Encoding: chunked
  73. Content-Type: multipart/form-data; boundary=----------------------------
  74. Expect: 100-continue
  75. %if hyper
  76. 1AF
  77. %else
  78. 1af
  79. %endif
  80. ------------------------------
  81. Content-Disposition: form-data; name="greeting"
  82. Content-Type: application/X-Greeting
  83. Content-Transfer-Encoding: base64
  84. X-Test-Number: %TESTNUMBER
  85. aGVsbG8=
  86. ------------------------------
  87. Content-Disposition: form-data; filename="file%TESTNUMBER.txt"
  88. Content-Type: text/plain
  89. This is data from a file
  90. ------------------------------
  91. Content-Disposition: form-data
  92. 1
  93. d
  94. 1
  95. u
  96. 1
  97. m
  98. 1
  99. m
  100. 1
  101. y
  102. 1
  103. 30
  104. --------------------------------
  105. 0
  106. </protocol>
  107. </verify>
  108. </testcase>