tests: introduce %CLIENT6IP-NB

This is the %CLIENT6IP variable - but without outmost brackets since
some commmand lines need the address without the brackets. With this
variable we can run three more tests without prechecks.

Closes #15039
This commit is contained in:
Daniel Stenberg 2024-09-25 14:11:01 +02:00
parent 7aa2b4e01f
commit 5fb1b64fdd
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
5 changed files with 9 additions and 16 deletions

View File

@ -121,7 +121,8 @@ replaced by their content at that time.
Available substitute variables include:
- `%CLIENT6IP` - IPv6 address of the client running curl
- `%CLIENT6IP` - IPv6 address of the client running curl (including brackets)
- `%CLIENT6IP-NB` - IPv6 address of the client running curl (no brackets)
- `%CLIENTIP` - IPv4 address of the client running curl
- `%CURL` - Path to the curl executable
- `%DATE` - current YYYY-MM-DD date

View File

@ -36,12 +36,8 @@ http-ipv6
HTTP-IPv6 GET with numeric localhost --interface
</name>
<command>
-g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface ::1
-g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface %CLIENT6IP-NB
</command>
# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out
<precheck>
perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );"
</precheck>
</client>
#

View File

@ -41,12 +41,8 @@ ftp-ipv6
FTP-IPv6 dir list PASV with localhost --interface
</name>
<command>
-g "ftp://%HOST6IP:%FTP6PORT/" --interface ::1
-g "ftp://%HOST6IP:%FTP6PORT/" --interface %CLIENT6IP-NB
</command>
# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out
<precheck>
perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );"
</precheck>
</client>
#

View File

@ -38,12 +38,8 @@ ftp-ipv6
FTP-IPv6 dir list, EPRT with specified IP
</name>
<command>
-g "ftp://%HOST6IP:%FTP6PORT/" -P ::1
-g "ftp://%HOST6IP:%FTP6PORT/" -P %CLIENT6IP-NB
</command>
# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out
<precheck>
perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );"
</precheck>
</client>
# Verify data after the test has been "shot"

View File

@ -2990,6 +2990,10 @@ sub subvariables {
$$thing =~ s/${prefix}SOCKSUNIXPATH/$SOCKSUNIXPATH/g;
# client IP addresses
my $nb = $CLIENT6IP;
$nb =~ s/^\[(.*)\]/$1/; # trim off the brackets
$$thing =~ s/${prefix}CLIENT6IP-NB/$nb/g;
$$thing =~ s/${prefix}CLIENT6IP/$CLIENT6IP/g;
$$thing =~ s/${prefix}CLIENTIP/$CLIENTIP/g;