test506 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. cookies
  7. shared cookies
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data1>
  13. HTTP/1.1 200 OK
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Content-Type: text/html
  17. Set-Cookie: test1=one; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
  18. Set-Cookie: test2=two; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
  19. Set-Cookie: test3=three; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
  20. Content-Length: 29
  21. run 1: set cookie 1, 2 and 3
  22. </data1>
  23. <data2>
  24. HTTP/1.1 200 OK
  25. Date: Thu, 09 Nov 2010 14:49:01 GMT
  26. Server: test-server/fake
  27. Content-Type: text/html
  28. Set-Cookie: test4=four; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
  29. Set-Cookie: test5=five; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
  30. Content-Length: 26
  31. run 2: set cookie 4 and 5
  32. </data2>
  33. <data3>
  34. HTTP/1.1 200 OK
  35. Date: Thu, 09 Nov 2010 14:49:02 GMT
  36. Server: test-server/fake
  37. Content-Type: text/html
  38. Funny-head: yesyes
  39. Set-Cookie: test4=overwritten4; domain=host.foo.com; expires=Sat May 5 GMT 11:56:27 2035
  40. Set-Cookie: test1=overwritten1; domain=foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
  41. Content-Type: text/html
  42. Content-Length: 32
  43. run 3: overwrite cookie 1 and 4
  44. </data3>
  45. </reply>
  46. # Client-side
  47. <client>
  48. <server>
  49. http
  50. </server>
  51. <name>
  52. HTTP with shared cookie list (and dns cache)
  53. </name>
  54. # Explicitly set the time zone to a known good one, in case the user is
  55. # using one of the 'right' zones that take into account leap seconds
  56. # which causes the cookie expiry times to be different.
  57. <setenv>
  58. TZ=GMT
  59. </setenv>
  60. <tool>
  61. lib506
  62. </tool>
  63. <command>
  64. http://%HOSTIP:%HTTPPORT/506
  65. </command>
  66. </client>
  67. # Verify data after the test has been "shot"
  68. <verify>
  69. <stdout mode="text">
  70. GLOBAL_INIT
  71. SHARE_INIT
  72. CURLSHOPT_LOCKFUNC
  73. CURLSHOPT_UNLOCKFUNC
  74. CURLSHOPT_USERDATA
  75. CURL_LOCK_DATA_COOKIE
  76. CURL_LOCK_DATA_DNS
  77. CURLOPT_SHARE
  78. lock: share [Pigs in space]: 0
  79. unlock: share [Pigs in space]: 1
  80. CURLOPT_COOKIELIST injected_and_clobbered
  81. lock: cookie [Pigs in space]: 2
  82. unlock: cookie [Pigs in space]: 3
  83. CURLOPT_COOKIELIST ALL
  84. lock: cookie [Pigs in space]: 4
  85. unlock: cookie [Pigs in space]: 5
  86. CURLOPT_COOKIELIST session
  87. lock: cookie [Pigs in space]: 6
  88. unlock: cookie [Pigs in space]: 7
  89. CURLOPT_COOKIELIST injected
  90. lock: cookie [Pigs in space]: 8
  91. unlock: cookie [Pigs in space]: 9
  92. CURLOPT_COOKIELIST SESS
  93. lock: cookie [Pigs in space]: 10
  94. unlock: cookie [Pigs in space]: 11
  95. CLEANUP
  96. lock: cookie [Pigs in space]: 12
  97. unlock: cookie [Pigs in space]: 13
  98. lock: share [Pigs in space]: 14
  99. unlock: share [Pigs in space]: 15
  100. *** run 1
  101. CURLOPT_SHARE
  102. lock: share [Pigs in space]: 16
  103. unlock: share [Pigs in space]: 17
  104. PERFORM
  105. lock: dns [Pigs in space]: 18
  106. unlock: dns [Pigs in space]: 19
  107. lock: dns [Pigs in space]: 20
  108. unlock: dns [Pigs in space]: 21
  109. lock: cookie [Pigs in space]: 22
  110. unlock: cookie [Pigs in space]: 23
  111. lock: cookie [Pigs in space]: 24
  112. unlock: cookie [Pigs in space]: 25
  113. lock: cookie [Pigs in space]: 26
  114. unlock: cookie [Pigs in space]: 27
  115. lock: cookie [Pigs in space]: 28
  116. unlock: cookie [Pigs in space]: 29
  117. run 1: set cookie 1, 2 and 3
  118. lock: dns [Pigs in space]: 30
  119. unlock: dns [Pigs in space]: 31
  120. CLEANUP
  121. lock: cookie [Pigs in space]: 32
  122. unlock: cookie [Pigs in space]: 33
  123. lock: share [Pigs in space]: 34
  124. unlock: share [Pigs in space]: 35
  125. *** run 2
  126. CURLOPT_SHARE
  127. lock: share [Pigs in space]: 36
  128. unlock: share [Pigs in space]: 37
  129. PERFORM
  130. lock: dns [Pigs in space]: 38
  131. unlock: dns [Pigs in space]: 39
  132. lock: cookie [Pigs in space]: 40
  133. unlock: cookie [Pigs in space]: 41
  134. lock: cookie [Pigs in space]: 42
  135. unlock: cookie [Pigs in space]: 43
  136. lock: cookie [Pigs in space]: 44
  137. unlock: cookie [Pigs in space]: 45
  138. run 2: set cookie 4 and 5
  139. lock: dns [Pigs in space]: 46
  140. unlock: dns [Pigs in space]: 47
  141. CLEANUP
  142. lock: cookie [Pigs in space]: 48
  143. unlock: cookie [Pigs in space]: 49
  144. lock: share [Pigs in space]: 50
  145. unlock: share [Pigs in space]: 51
  146. *** run 3
  147. CURLOPT_SHARE
  148. lock: share [Pigs in space]: 52
  149. unlock: share [Pigs in space]: 53
  150. CURLOPT_COOKIEJAR
  151. CURLOPT_COOKIELIST FLUSH
  152. lock: cookie [Pigs in space]: 54
  153. lock: cookie [Pigs in space]: 55
  154. unlock: cookie [Pigs in space]: 56
  155. unlock: cookie [Pigs in space]: 57
  156. PERFORM
  157. lock: dns [Pigs in space]: 58
  158. unlock: dns [Pigs in space]: 59
  159. lock: cookie [Pigs in space]: 60
  160. unlock: cookie [Pigs in space]: 61
  161. lock: cookie [Pigs in space]: 62
  162. unlock: cookie [Pigs in space]: 63
  163. lock: cookie [Pigs in space]: 64
  164. unlock: cookie [Pigs in space]: 65
  165. run 3: overwrite cookie 1 and 4
  166. lock: dns [Pigs in space]: 66
  167. unlock: dns [Pigs in space]: 67
  168. try SHARE_CLEANUP...
  169. lock: share [Pigs in space]: 68
  170. unlock: share [Pigs in space]: 69
  171. SHARE_CLEANUP failed, correct
  172. CLEANUP
  173. lock: cookie [Pigs in space]: 70
  174. unlock: cookie [Pigs in space]: 71
  175. lock: share [Pigs in space]: 72
  176. unlock: share [Pigs in space]: 73
  177. SHARE_CLEANUP
  178. lock: share [Pigs in space]: 74
  179. unlock: share [Pigs in space]: 75
  180. GLOBAL_CLEANUP
  181. </stdout>
  182. <stderr>
  183. http://%HOSTIP:%HTTPPORT/506
  184. </stderr>
  185. <file name="log/jar506" mode="text">
  186. # Netscape HTTP Cookie File
  187. # http://curl.haxx.se/docs/http-cookies.html
  188. # This file was generated by libcurl! Edit at your own risk.
  189. .host.foo.com TRUE / FALSE 1896263787 injected yes
  190. .foo.com TRUE / FALSE 1993463787 test1 overwritten1
  191. .host.foo.com TRUE / FALSE 1896263787 test2 two
  192. .foo.com TRUE / FALSE 1896263787 test3 three
  193. .host.foo.com TRUE / FALSE 2061978987 test4 overwritten4
  194. .host.foo.com TRUE / FALSE 1896263787 test5 five
  195. </file>
  196. </verify>
  197. </testcase>