curl/tests/data/test1056
Viktor Szakats 31a29fc6bd
tests: add and use %PERL variable to refer to the Perl binary
To ensure Perl invocations within tests call the same Perl binary used
for running the tests, as specified or auto-detected via `PERL` env
(autotools) or `PERL_EXECUTABLE` setting (cmake). Instead of the first
`perl` executable found in `PATH`.)

Cherry-picked from #14949
Closes #15097
2024-10-01 12:04:50 +02:00

86 lines
1.6 KiB
Plaintext

<testcase>
<info>
<keywords>
HTTP
HTTP GET
followlocation
IPv6
</keywords>
</info>
#
# Server-side
<reply>
<data>
HTTP/1.1 302 OK swsclose
Location: http://[::1%259999]:%HTTP6PORT/moo/%TESTNUMBER0002
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close
</data>
<data2>
HTTP/1.1 200 OK swsclose
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close
body
</data2>
<datacheck>
HTTP/1.1 302 OK swsclose
Location: http://[::1%259999]:%HTTP6PORT/moo/%TESTNUMBER0002
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close
HTTP/1.1 200 OK swsclose
Date: Thu, 31 Jul 2008 14:49:00 GMT
Connection: close
body
</datacheck>
</reply>
#
# Client-side
<client>
# This test relies on the IPv6 scope field being ignored when connecting to
# ipv6-localhost (i.e. [::1%259999] is treated as [::1]). Maybe this is a bit
# dodgy, but it happens on all our test platforms but Windows so skip this
# test there. This feature doesn't work on msys or Cygwin, so use a precheck
# to skip those.
<features>
IPv6
!win32
</features>
<server>
http
http-ipv6
</server>
<name>
HTTP follow redirect from IPv4 to IPv6 with scope
</name>
<command>
http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L
</command>
<precheck>
%PERL -e "print 'Test is not supported on the Windows kernel' if ($^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin');"
</precheck>
</client>
#
# Verify data after the test has been "shot"
<verify>
<protocol>
GET /we/are/all/twits/%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
GET /moo/%TESTNUMBER0002 HTTP/1.1
Host: %HOST6IP:%HTTP6PORT
User-Agent: curl/%VERSION
Accept: */*
</protocol>
</verify>
</testcase>