test654 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. <features>
  38. Mime
  39. </features>
  40. <server>
  41. http
  42. </server>
  43. # tool is what to use instead of 'curl'
  44. <tool>
  45. lib%TESTNUMBER
  46. </tool>
  47. <name>
  48. HTTP duplicate easy handle with mime data
  49. </name>
  50. <command>
  51. http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
  52. </command>
  53. <file name="%LOGDIR/file%TESTNUMBER.txt">
  54. This is data from a file
  55. </file>
  56. </client>
  57. #
  58. # Verify data after the test has been "shot"
  59. <verify>
  60. <strippart>
  61. s/^--------------------------[A-Za-z0-9]*/------------------------------/
  62. s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
  63. </strippart>
  64. # Note that the stripping above removes 12 bytes from every occurrence of the
  65. # boundary string and since 5 of them are in the body contents, we see
  66. # (5*12) == 60 bytes less
  67. <protocol>
  68. POST /%TESTNUMBER HTTP/1.1
  69. Host: %HOSTIP:%HTTPPORT
  70. Accept: */*
  71. Content-Length: 0
  72. POST /%TESTNUMBER HTTP/1.1
  73. Host: %HOSTIP:%HTTPPORT
  74. Accept: */*
  75. Transfer-Encoding: chunked
  76. Content-Type: multipart/form-data; boundary=----------------------------
  77. Expect: 100-continue
  78. %if hyper
  79. 1C1
  80. %else
  81. 1c1
  82. %endif
  83. ------------------------------
  84. Content-Disposition: form-data; name="greeting"
  85. Content-Type: application/X-Greeting
  86. Content-Transfer-Encoding: base64
  87. X-Test-Number: %TESTNUMBER
  88. aGVsbG8=
  89. ------------------------------
  90. Content-Disposition: form-data; filename="file%TESTNUMBER.txt"
  91. Content-Type: text/plain
  92. This is data from a file
  93. ------------------------------
  94. Content-Disposition: form-data
  95. 1
  96. d
  97. 1
  98. u
  99. 1
  100. m
  101. 1
  102. m
  103. 1
  104. y
  105. 1
  106. 36
  107. --------------------------------
  108. 0
  109. </protocol>
  110. </verify>
  111. </testcase>