test506 7.2 KB

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