test506 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. Set-Cookie: test6=six; domain=.www.host.foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
  42. Set-Cookie: test6=six_more; expires=Thu Mar 3 GMT 11:56:27 2033
  43. Content-Type: text/html
  44. Content-Length: 73
  45. run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch
  46. </data3>
  47. </reply>
  48. # Client-side
  49. <client>
  50. <server>
  51. http
  52. </server>
  53. # don't run this with the threaded-resolver since the events might trigger in
  54. # a different order!
  55. <features>
  56. !threaded-resolver
  57. </features>
  58. <name>
  59. HTTP with shared cookie list (and dns cache)
  60. </name>
  61. # Explicitly set the time zone to a known good one, in case the user is
  62. # using one of the 'right' zones that take into account leap seconds
  63. # which causes the cookie expiry times to be different.
  64. <setenv>
  65. TZ=GMT
  66. </setenv>
  67. <tool>
  68. lib506
  69. </tool>
  70. <command>
  71. http://%HOSTIP:%HTTPPORT/506
  72. </command>
  73. </client>
  74. # Verify data after the test has been "shot"
  75. <verify>
  76. <stdout>
  77. GLOBAL_INIT
  78. SHARE_INIT
  79. CURLSHOPT_LOCKFUNC
  80. CURLSHOPT_UNLOCKFUNC
  81. CURLSHOPT_USERDATA
  82. CURL_LOCK_DATA_COOKIE
  83. CURL_LOCK_DATA_DNS
  84. CURLOPT_SHARE
  85. lock: share [Pigs in space]: 0
  86. unlock: share [Pigs in space]: 1
  87. CURLOPT_COOKIELIST injected_and_clobbered
  88. lock: cookie [Pigs in space]: 2
  89. unlock: cookie [Pigs in space]: 3
  90. CURLOPT_COOKIELIST ALL
  91. lock: cookie [Pigs in space]: 4
  92. unlock: cookie [Pigs in space]: 5
  93. CURLOPT_COOKIELIST session
  94. lock: cookie [Pigs in space]: 6
  95. unlock: cookie [Pigs in space]: 7
  96. CURLOPT_COOKIELIST injected
  97. lock: cookie [Pigs in space]: 8
  98. unlock: cookie [Pigs in space]: 9
  99. CURLOPT_COOKIELIST SESS
  100. lock: cookie [Pigs in space]: 10
  101. unlock: cookie [Pigs in space]: 11
  102. CLEANUP
  103. lock: cookie [Pigs in space]: 12
  104. unlock: cookie [Pigs in space]: 13
  105. lock: share [Pigs in space]: 14
  106. unlock: share [Pigs in space]: 15
  107. *** run 1
  108. CURLOPT_SHARE
  109. lock: share [Pigs in space]: 16
  110. unlock: share [Pigs in space]: 17
  111. PERFORM
  112. lock: dns [Pigs in space]: 18
  113. unlock: dns [Pigs in space]: 19
  114. lock: dns [Pigs in space]: 20
  115. unlock: dns [Pigs in space]: 21
  116. lock: cookie [Pigs in space]: 22
  117. unlock: cookie [Pigs in space]: 23
  118. lock: cookie [Pigs in space]: 24
  119. unlock: cookie [Pigs in space]: 25
  120. lock: cookie [Pigs in space]: 26
  121. unlock: cookie [Pigs in space]: 27
  122. lock: cookie [Pigs in space]: 28
  123. unlock: cookie [Pigs in space]: 29
  124. run 1: set cookie 1, 2 and 3
  125. lock: dns [Pigs in space]: 30
  126. unlock: dns [Pigs in space]: 31
  127. lock: dns [Pigs in space]: 32
  128. unlock: dns [Pigs in space]: 33
  129. CLEANUP
  130. lock: cookie [Pigs in space]: 34
  131. unlock: cookie [Pigs in space]: 35
  132. lock: share [Pigs in space]: 36
  133. unlock: share [Pigs in space]: 37
  134. *** run 2
  135. CURLOPT_SHARE
  136. lock: share [Pigs in space]: 38
  137. unlock: share [Pigs in space]: 39
  138. PERFORM
  139. lock: dns [Pigs in space]: 40
  140. unlock: dns [Pigs in space]: 41
  141. lock: cookie [Pigs in space]: 42
  142. unlock: cookie [Pigs in space]: 43
  143. lock: cookie [Pigs in space]: 44
  144. unlock: cookie [Pigs in space]: 45
  145. lock: cookie [Pigs in space]: 46
  146. unlock: cookie [Pigs in space]: 47
  147. run 2: set cookie 4 and 5
  148. lock: dns [Pigs in space]: 48
  149. unlock: dns [Pigs in space]: 49
  150. lock: dns [Pigs in space]: 50
  151. unlock: dns [Pigs in space]: 51
  152. CLEANUP
  153. lock: cookie [Pigs in space]: 52
  154. unlock: cookie [Pigs in space]: 53
  155. lock: share [Pigs in space]: 54
  156. unlock: share [Pigs in space]: 55
  157. *** run 3
  158. CURLOPT_SHARE
  159. lock: share [Pigs in space]: 56
  160. unlock: share [Pigs in space]: 57
  161. CURLOPT_COOKIEJAR
  162. CURLOPT_COOKIELIST FLUSH
  163. lock: cookie [Pigs in space]: 58
  164. unlock: cookie [Pigs in space]: 59
  165. PERFORM
  166. lock: dns [Pigs in space]: 60
  167. unlock: dns [Pigs in space]: 61
  168. lock: cookie [Pigs in space]: 62
  169. unlock: cookie [Pigs in space]: 63
  170. lock: cookie [Pigs in space]: 64
  171. unlock: cookie [Pigs in space]: 65
  172. lock: cookie [Pigs in space]: 66
  173. unlock: cookie [Pigs in space]: 67
  174. lock: cookie [Pigs in space]: 68
  175. unlock: cookie [Pigs in space]: 69
  176. lock: cookie [Pigs in space]: 70
  177. unlock: cookie [Pigs in space]: 71
  178. run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch
  179. lock: dns [Pigs in space]: 72
  180. unlock: dns [Pigs in space]: 73
  181. lock: dns [Pigs in space]: 74
  182. unlock: dns [Pigs in space]: 75
  183. CLEANUP
  184. lock: cookie [Pigs in space]: 76
  185. unlock: cookie [Pigs in space]: 77
  186. lock: share [Pigs in space]: 78
  187. unlock: share [Pigs in space]: 79
  188. CURLOPT_SHARE
  189. lock: share [Pigs in space]: 80
  190. unlock: share [Pigs in space]: 81
  191. CURLOPT_COOKIELIST ALL
  192. lock: cookie [Pigs in space]: 82
  193. unlock: cookie [Pigs in space]: 83
  194. CURLOPT_COOKIEJAR
  195. CURLOPT_COOKIELIST RELOAD
  196. lock: cookie [Pigs in space]: 84
  197. unlock: cookie [Pigs in space]: 85
  198. lock: cookie [Pigs in space]: 86
  199. unlock: cookie [Pigs in space]: 87
  200. loaded cookies:
  201. -----------------
  202. www.host.foo.com FALSE / FALSE 1993463787 test6 six_more
  203. .www.host.foo.com TRUE / FALSE 1993463787 test6 six
  204. .host.foo.com TRUE / FALSE 1896263787 test5 five
  205. .host.foo.com TRUE / FALSE 2061978987 test4 overwritten4
  206. .foo.com TRUE / FALSE 1896263787 test3 three
  207. .host.foo.com TRUE / FALSE 1896263787 test2 two
  208. .foo.com TRUE / FALSE 1993463787 test1 overwritten1
  209. .host.foo.com TRUE / FALSE 1896263787 injected yes
  210. -----------------
  211. try SHARE_CLEANUP...
  212. lock: share [Pigs in space]: 88
  213. unlock: share [Pigs in space]: 89
  214. SHARE_CLEANUP failed, correct
  215. CLEANUP
  216. lock: cookie [Pigs in space]: 90
  217. unlock: cookie [Pigs in space]: 91
  218. lock: share [Pigs in space]: 92
  219. unlock: share [Pigs in space]: 93
  220. SHARE_CLEANUP
  221. lock: share [Pigs in space]: 94
  222. unlock: share [Pigs in space]: 95
  223. GLOBAL_CLEANUP
  224. </stdout>
  225. <stderr>
  226. http://%HOSTIP:%HTTPPORT/506
  227. </stderr>
  228. <file name="log/jar506" mode="text">
  229. # Netscape HTTP Cookie File
  230. # https://curl.haxx.se/docs/http-cookies.html
  231. # This file was generated by libcurl! Edit at your own risk.
  232. www.host.foo.com FALSE / FALSE 1993463787 test6 six_more
  233. .www.host.foo.com TRUE / FALSE 1993463787 test6 six
  234. .host.foo.com TRUE / FALSE 1896263787 test5 five
  235. .host.foo.com TRUE / FALSE 2061978987 test4 overwritten4
  236. .foo.com TRUE / FALSE 1896263787 test3 three
  237. .host.foo.com TRUE / FALSE 1896263787 test2 two
  238. .foo.com TRUE / FALSE 1993463787 test1 overwritten1
  239. .host.foo.com TRUE / FALSE 1896263787 injected yes
  240. </file>
  241. </verify>
  242. </testcase>