test258 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. HTTP replaced headers
  7. HTTP proxy
  8. HTTP proxy Digest auth
  9. --proxy-anyauth
  10. </keywords>
  11. </info>
  12. # Server-side
  13. <reply>
  14. # The stupid test server doesn't response anything at all until the full
  15. # request has been sent, and then of course the full POST has already been
  16. # sent!
  17. <data>
  18. HTTP/1.1 407 no, tell me who you are first swsclose
  19. Date: Tue, 09 Nov 2010 14:49:00 GMT
  20. Server: test-server/fake
  21. Proxy-Authenticate: Digest realm="many secrets", nonce="911"
  22. Proxy-Connection: close
  23. Content-Length: 0
  24. </data>
  25. <data1000>
  26. HTTP/1.1 200 A OK
  27. Server: Microsoft-IIS/6.0
  28. Content-Type: text/html; charset=iso-8859-1
  29. Content-Length: 3
  30. ok
  31. </data1000>
  32. <datacheck>
  33. HTTP/1.1 407 no, tell me who you are first swsclose
  34. Date: Tue, 09 Nov 2010 14:49:00 GMT
  35. Server: test-server/fake
  36. Proxy-Authenticate: Digest realm="many secrets", nonce="911"
  37. Proxy-Connection: close
  38. Content-Length: 0
  39. HTTP/1.1 200 A OK
  40. Server: Microsoft-IIS/6.0
  41. Content-Type: text/html; charset=iso-8859-1
  42. Content-Length: 3
  43. ok
  44. </datacheck>
  45. </reply>
  46. # Client-side
  47. <client>
  48. <server>
  49. http
  50. </server>
  51. <features>
  52. !SSPI
  53. crypto
  54. proxy
  55. </features>
  56. <name>
  57. HTTP POST multipart without Expect: header using proxy anyauth (Digest)
  58. </name>
  59. <command>
  60. -x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/%TESTNUMBER -F name=daniel -F tool=curl -F file=@log/test%TESTNUMBER.txt -H "Expect:" -U uuuser:pppassword --proxy-anyauth
  61. </command>
  62. # We create this file before the command is invoked!
  63. <file name="log/test%TESTNUMBER.txt">
  64. foo-
  65. This is a moo-
  66. bar
  67. </file>
  68. </client>
  69. # Verify data after the test has been "shot"
  70. <verify>
  71. <strip>
  72. ^(Content-Type: multipart/form-data;|------).*
  73. </strip>
  74. <protocol>
  75. POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1
  76. Host: remotehost:54321
  77. User-Agent: curl/%VERSION
  78. Accept: */*
  79. Proxy-Connection: Keep-Alive
  80. Content-Length: 409
  81. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  82. ------------------------------7c633d5c27ce
  83. Content-Disposition: form-data; name="name"
  84. daniel
  85. ------------------------------7c633d5c27ce
  86. Content-Disposition: form-data; name="tool"
  87. curl
  88. ------------------------------7c633d5c27ce
  89. Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"
  90. Content-Type: text/plain
  91. foo-
  92. This is a moo-
  93. bar
  94. ------------------------------7c633d5c27ce--
  95. POST http://remotehost:54321/we/want/%TESTNUMBER HTTP/1.1
  96. Host: remotehost:54321
  97. Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/%TESTNUMBER", response="2501654ca391f0b5c8c12a1da77e34cd"
  98. User-Agent: curl/%VERSION
  99. Accept: */*
  100. Proxy-Connection: Keep-Alive
  101. Content-Length: 409
  102. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  103. ------------------------------7c633d5c27ce
  104. Content-Disposition: form-data; name="name"
  105. daniel
  106. ------------------------------7c633d5c27ce
  107. Content-Disposition: form-data; name="tool"
  108. curl
  109. ------------------------------7c633d5c27ce
  110. Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"
  111. Content-Type: text/plain
  112. foo-
  113. This is a moo-
  114. bar
  115. ------------------------------7c633d5c27ce--
  116. </protocol>
  117. </verify>
  118. </testcase>