]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: introduce %CLIENT6IP-NB
authorDaniel Stenberg <daniel@haxx.se>
Wed, 25 Sep 2024 12:11:01 +0000 (14:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 26 Sep 2024 06:44:55 +0000 (08:44 +0200)
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

tests/FILEFORMAT.md
tests/data/test1046
tests/data/test1048
tests/data/test1050
tests/servers.pm

index 1bb56cf4ab940e71b451104124ee0bf2da296673..aa02baff1fa7b41177fd500d0bbb1b0b09fe0209 100644 (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
index 865fe12933ccfb87209a7d8328a1efdf044b1bf6..fd05b3d5357b5829ecf700f560f05f4e8100ef68 100644 (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>
 
 #
index d2d2317bcf1b44c1c0fb0128dc2f0c222fdc39d4..5aed75a374b7dac1d43f6ee7f79db0d4d5e08550 100644 (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>
 
 #
index 5c3e9a007b199d942f2ffbe9ee9bc36d5dc323f2..0f8267f95a25a85672cf81035f02cca149c6291d 100644 (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"
index 86119c088c6d0d0172d7a3cfd78f1754a7d706f4..87a11079d4052b14c9b263add662aeb1fd69e5cb 100644 (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;