From: Daniel Stenberg Date: Wed, 25 Sep 2024 12:11:01 +0000 (+0200) Subject: tests: introduce %CLIENT6IP-NB X-Git-Tag: curl-8_11_0~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fb1b64fdd8a205396610ba046bc6249eff0805d;p=thirdparty%2Fcurl.git 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 --- diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index 1bb56cf4ab..aa02baff1f 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -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 diff --git a/tests/data/test1046 b/tests/data/test1046 index 865fe12933..fd05b3d535 100644 --- a/tests/data/test1046 +++ b/tests/data/test1046 @@ -36,12 +36,8 @@ http-ipv6 HTTP-IPv6 GET with numeric localhost --interface --g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface ::1 +-g "http://%HOST6IP:%HTTP6PORT/%TESTNUMBER" --interface %CLIENT6IP-NB -# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out - -perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );" - # diff --git a/tests/data/test1048 b/tests/data/test1048 index d2d2317bcf..5aed75a374 100644 --- a/tests/data/test1048 +++ b/tests/data/test1048 @@ -41,12 +41,8 @@ ftp-ipv6 FTP-IPv6 dir list PASV with localhost --interface --g "ftp://%HOST6IP:%FTP6PORT/" --interface ::1 +-g "ftp://%HOST6IP:%FTP6PORT/" --interface %CLIENT6IP-NB -# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out - -perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );" - # diff --git a/tests/data/test1050 b/tests/data/test1050 index 5c3e9a007b..0f8267f95a 100644 --- a/tests/data/test1050 +++ b/tests/data/test1050 @@ -38,12 +38,8 @@ ftp-ipv6 FTP-IPv6 dir list, EPRT with specified IP --g "ftp://%HOST6IP:%FTP6PORT/" -P ::1 +-g "ftp://%HOST6IP:%FTP6PORT/" -P %CLIENT6IP-NB -# --interface doesn't accept an address surrounded by [] so %CLIENT6IP is out - -perl -e "print 'Test requires default test client host address' if ( '%CLIENT6IP' ne '[::1]' );" - # Verify data after the test has been "shot" diff --git a/tests/servers.pm b/tests/servers.pm index 86119c088c..87a11079d4 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -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;