test506 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. *** run 1
  78. CURLOPT_SHARE
  79. lock: share [Pigs in space]: 0
  80. unlock: share [Pigs in space]: 1
  81. PERFORM
  82. lock: dns [Pigs in space]: 2
  83. unlock: dns [Pigs in space]: 3
  84. lock: dns [Pigs in space]: 4
  85. unlock: dns [Pigs in space]: 5
  86. lock: cookie [Pigs in space]: 6
  87. unlock: cookie [Pigs in space]: 7
  88. lock: cookie [Pigs in space]: 8
  89. unlock: cookie [Pigs in space]: 9
  90. lock: cookie [Pigs in space]: 10
  91. unlock: cookie [Pigs in space]: 11
  92. lock: cookie [Pigs in space]: 12
  93. unlock: cookie [Pigs in space]: 13
  94. run 1: set cookie 1, 2 and 3
  95. lock: dns [Pigs in space]: 14
  96. unlock: dns [Pigs in space]: 15
  97. CLEANUP
  98. lock: dns [Pigs in space]: 16
  99. unlock: dns [Pigs in space]: 17
  100. lock: cookie [Pigs in space]: 18
  101. unlock: cookie [Pigs in space]: 19
  102. lock: share [Pigs in space]: 20
  103. unlock: share [Pigs in space]: 21
  104. *** run 2
  105. CURLOPT_SHARE
  106. lock: share [Pigs in space]: 22
  107. unlock: share [Pigs in space]: 23
  108. PERFORM
  109. lock: dns [Pigs in space]: 24
  110. unlock: dns [Pigs in space]: 25
  111. lock: cookie [Pigs in space]: 26
  112. unlock: cookie [Pigs in space]: 27
  113. lock: cookie [Pigs in space]: 28
  114. unlock: cookie [Pigs in space]: 29
  115. lock: cookie [Pigs in space]: 30
  116. unlock: cookie [Pigs in space]: 31
  117. run 2: set cookie 4 and 5
  118. lock: dns [Pigs in space]: 32
  119. unlock: dns [Pigs in space]: 33
  120. CLEANUP
  121. lock: dns [Pigs in space]: 34
  122. unlock: dns [Pigs in space]: 35
  123. lock: cookie [Pigs in space]: 36
  124. unlock: cookie [Pigs in space]: 37
  125. lock: share [Pigs in space]: 38
  126. unlock: share [Pigs in space]: 39
  127. *** run 3
  128. CURLOPT_SHARE
  129. lock: share [Pigs in space]: 40
  130. unlock: share [Pigs in space]: 41
  131. CURLOPT_COOKIEJAR
  132. PERFORM
  133. lock: dns [Pigs in space]: 42
  134. unlock: dns [Pigs in space]: 43
  135. lock: cookie [Pigs in space]: 44
  136. unlock: cookie [Pigs in space]: 45
  137. lock: cookie [Pigs in space]: 46
  138. unlock: cookie [Pigs in space]: 47
  139. lock: cookie [Pigs in space]: 48
  140. unlock: cookie [Pigs in space]: 49
  141. run 3: overwrite cookie 1 and 4
  142. lock: dns [Pigs in space]: 50
  143. unlock: dns [Pigs in space]: 51
  144. try SHARE_CLEANUP...
  145. lock: share [Pigs in space]: 52
  146. unlock: share [Pigs in space]: 53
  147. SHARE_CLEANUP failed, correct
  148. CLEANUP
  149. lock: dns [Pigs in space]: 54
  150. unlock: dns [Pigs in space]: 55
  151. lock: cookie [Pigs in space]: 56
  152. unlock: cookie [Pigs in space]: 57
  153. lock: share [Pigs in space]: 58
  154. unlock: share [Pigs in space]: 59
  155. SHARE_CLEANUP
  156. lock: share [Pigs in space]: 60
  157. unlock: share [Pigs in space]: 61
  158. GLOBAL_CLEANUP
  159. </stdout>
  160. <stderr>
  161. http://%HOSTIP:%HTTPPORT/506
  162. </stderr>
  163. <file name="log/jar506" mode="text">
  164. # Netscape HTTP Cookie File
  165. # http://curl.haxx.se/docs/http-cookies.html
  166. # This file was generated by libcurl! Edit at your own risk.
  167. .foo.com TRUE / FALSE 1993463787 test1 overwritten1
  168. .host.foo.com TRUE / FALSE 1896263787 test2 two
  169. .foo.com TRUE / FALSE 1896263787 test3 three
  170. .host.foo.com TRUE / FALSE 2061978987 test4 overwritten4
  171. .host.foo.com TRUE / FALSE 1896263787 test5 five
  172. </file>
  173. </verify>
  174. </testcase>