curl/tests/data/test798
Graham Campbell 94fab2d210
test798: force IPv4 to avoid cross-runner port aliasing
`test798` is the only test fetching `http://localhost:%HTTPPORT` without
`-4`, since it needs the hostname for its folded `domain=localhost`
cookie. curl tries `::1` first, but the test HTTP server is IPv4-only.
On the BSDs, IPv4 and IPv6 have separate ephemeral port namespaces, so
with every test server binding port 0, another parallel runner's
IPv6-bound server can hold the same numeric port. curl then connects to
the wrong runner's server, which cannot open its own `log/N/test798` and
closes without a response, giving exit 52 and an empty `server.input`.

This PR fixes this flake by adding `-4` matches what tests 389 and 392
already do. Linux is immune because wildcard IPv6 binds occupy the IPv4
port too. Seen in
https://github.com/curl/curl/actions/runs/29229170329/job/86749470571.

Closes #22318
2026-07-15 22:06:07 +02:00

64 lines
1 KiB
XML

<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
HTTP
HTTP GET
cookies
cookiejar
</keywords>
</info>
# Server-side
<reply>
<data crlf="headers" nocheck="yes">
HTTP/1.1 200 OK
Content-Length: 4
Set-Cookie: flavor=tasty;
domain=localhost;
path=/p4/;
httponly;
secure
boo
</data>
<servercmd>
writedelay: 20
</servercmd>
</reply>
# Client-side
<client>
<server>
http
</server>
<name>
HTTP cookies in a folded header
</name>
<command>
-4 http://localhost:%HTTPPORT/we/want/%TESTNUMBER -b none -c %LOGDIR/jar%TESTNUMBER.txt
</command>
<features>
cookies
local-http
</features>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
GET /we/want/%TESTNUMBER HTTP/1.1
Host: localhost:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
</protocol>
<file name="%LOGDIR/jar%TESTNUMBER.txt" mode="text">
# Netscape HTTP Cookie File
# https://curl.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
#HttpOnly_.localhost TRUE /p4 TRUE 0 flavor tasty
</file>
</verify>
</testcase>