test1903: test use of COOKIEFILE - reset - COOKIEFILE

This also tests for the memory leak bug fixed by parent commit b559ef6f.

Ref: #10694

Closes https://github.com/curl/curl/pull/10712
This commit is contained in:
Daniel Stenberg 2023-03-08 14:31:33 +01:00 committed by Jay Satiro
parent b559ef6f36
commit 674a0662cf
4 changed files with 111 additions and 2 deletions

View file

@ -219,7 +219,7 @@ test1700 test1701 test1702 test1703 \
\
test1800 test1801 \
\
test1904 test1905 test1906 test1907 \
test1903 test1904 test1905 test1906 test1907 \
test1908 test1909 test1910 test1911 test1912 test1913 test1914 test1915 \
test1916 test1917 test1918 test1919 \
\

51
tests/data/test1903 Normal file
View file

@ -0,0 +1,51 @@
<testcase>
<info>
<keywords>
HTTP
cookies
CURLOPT_COOKIEFILE
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes" crlf="yes">
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes swsclose
Set-Cookie: foobar=name;
Set-Cookie: secondcookie=present;
</data>
</reply>
# Client-side
<client>
<server>
http
</server>
<name>
CURLOPT_COOKIEFILE then reset then set again
</name>
<tool>
lib%TESTNUMBER
</tool>
<command>
http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER
</command>
<file name="log/cookies%TESTNUMBER" mode="text">
# Netscape HTTP Cookie File
# https://curl.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
%HOSTIP FALSE /we/want/ FALSE 0 secondcookie present
%HOSTIP FALSE /we/want/ FALSE 0 foobar name
</file>
</client>
# Verify data after the test has been "shot"
<verify>
</verify>
</testcase>