diff --git a/tests/data/test1034 b/tests/data/test1034
index b4ffc8a985..89083a294c 100644
--- a/tests/data/test1034
+++ b/tests/data/test1034
@@ -43,7 +43,7 @@ HTTP over proxy with malformatted IDN host name
url = "http://invalid-utf8-.local/page/1034"
--K - -x %HOSTIP:%HTTPPORT
+-K - -x %HOSTIP:%NOLISTENPORT
diff --git a/tests/data/test1035 b/tests/data/test1035
index a316c51e13..62f9d7ae89 100644
--- a/tests/data/test1035
+++ b/tests/data/test1035
@@ -35,7 +35,7 @@ perl -MI18N::Langinfo=langinfo,CODESET -e 'die "Needs a UTF-8 locale" if (lc(lan
HTTP over proxy with too long IDN host name
-http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/1035 -x %HOSTIP:%HTTPPORT
+http://too-long-IDN-name-cürl-rüles-la-la-la-dee-da-flooby-nooby.local/page/1035 -x %HOSTIP:%NOLISTENPORT
diff --git a/tests/data/test1084 b/tests/data/test1084
index 1cfab68dcb..db6ab5e940 100644
--- a/tests/data/test1084
+++ b/tests/data/test1084
@@ -27,7 +27,7 @@ none
HTTP GET with invalid --interface
-http://%HOSTIP:%HTTPPORT/1084 --interface non-existing-host.haxx.se.
+http://%HOSTIP:%NOLISTENPORT/1084 --interface non-existing-host.haxx.se.
diff --git a/tests/data/test1085 b/tests/data/test1085
index db02e6033d..ac1f0629c6 100644
--- a/tests/data/test1085
+++ b/tests/data/test1085
@@ -29,7 +29,7 @@ none
HTTP-IPv6 GET with invalid --interface
--g "http://%HOST6IP:%HTTP6PORT/1085" --interface non-existing-host.haxx.se.
+-g "http://%HOST6IP:%NOLISTENPORT/1085" --interface non-existing-host.haxx.se.
# Ensure the IPv6 stack is operational before running this test (other tests
# use the startup of the IPv6 test server as a substitute check for this).
diff --git a/tests/data/test1234 b/tests/data/test1234
index 41c4bc06d5..577ba51aa7 100644
--- a/tests/data/test1234
+++ b/tests/data/test1234
@@ -19,7 +19,7 @@ none
abusing {}-globbing
-"%HOSTIP:%HTTPPORT/1234[0-1]{" "%HOSTIP:%HTTPPORT/{}{}{}{"
+"%HOSTIP:%NOLISTENPORT/1234[0-1]{" "%HOSTIP:%NOLISTENPORT/{}{}{}{"
diff --git a/tests/data/test1236 b/tests/data/test1236
index 0829be313e..7408a7bae0 100644
--- a/tests/data/test1236
+++ b/tests/data/test1236
@@ -19,7 +19,7 @@ none
# 2^62 == 4611686018427387904
-"%HOSTIP:%HTTPPORT/1234[0-1]{" "%HOSTIP:%HTTPPORT/[1-4611686018427387904][1-4611686018427387904]"
+"%HOSTIP:%NOLISTENPORT/1234[0-1]{" "%HOSTIP:%NOLISTENPORT/[1-4611686018427387904][1-4611686018427387904]"
diff --git a/tests/data/test1260 b/tests/data/test1260
index 1d86ecd4e8..b246882cb8 100644
--- a/tests/data/test1260
+++ b/tests/data/test1260
@@ -22,7 +22,7 @@ http
HTTP URL with rubbish after port number
--g "http://[%HOSTIP]:%HTTPPORT:80/we/want/1260" "http://%HOSTIP:%HTTPPORT:80/we/want/1260" "http://user@example.com:80@localhost"
+-g "http://[%HOSTIP]:%NOLISTENPORT:80/we/want/1260" "http://%HOSTIP:%NOLISTENPORT:80/we/want/1260" "http://user@example.com:80@localhost"
diff --git a/tests/data/test1263 b/tests/data/test1263
index 7462db4d42..88b13775eb 100644
--- a/tests/data/test1263
+++ b/tests/data/test1263
@@ -23,7 +23,7 @@ http
HTTP URL with rubbish after IPv6 bracket
--g "http://[%HOSTIP]test:%HTTPPORT/we/want/1263" "http://[%HOSTIP][%HOSTIP]:%HTTPPORT/we/want/1263" "http://user@[::1]@localhost"
+-g "http://[%HOSTIP]test:%NOLISTENPORT/we/want/1263" "http://[%HOSTIP][%HOSTIP]:%NOLISTENPORT/we/want/1263" "http://user@[::1]@localhost"
diff --git a/tests/data/test1269 b/tests/data/test1269
index c776636332..7cf86cab3c 100644
--- a/tests/data/test1269
+++ b/tests/data/test1269
@@ -20,7 +20,7 @@ none
too large --retry-delay value
---retry 3 --retry-delay 9223372036854776 http://%HOSTIP:%HTTPPORT/1269
+--retry 3 --retry-delay 9223372036854776 http://%HOSTIP:%NOLISTENPORT/1269
diff --git a/tests/data/test1409 b/tests/data/test1409
index 5ceb53be3b..8d54b4c951 100644
--- a/tests/data/test1409
+++ b/tests/data/test1409
@@ -17,7 +17,7 @@ none
Pass in string to -C
-http://%HOSTIP:%HTTPPORT/1409 -C wrong
+http://%HOSTIP:%NOLISTENPORT/1409 -C wrong
diff --git a/tests/data/test1410 b/tests/data/test1410
index 97ad05698a..a8b89db3fc 100644
--- a/tests/data/test1410
+++ b/tests/data/test1410
@@ -17,7 +17,7 @@ none
Pass in negative number to --max-time
-http://%HOSTIP:%HTTPPORT/1410 --max-time -4
+http://%HOSTIP:%NOLISTENPORT/1410 --max-time -4
diff --git a/tests/data/test1427 b/tests/data/test1427
index 03cab4b93b..648b1da56b 100644
--- a/tests/data/test1427
+++ b/tests/data/test1427
@@ -15,7 +15,7 @@ none
too large -m timeout value
-http://%HOSTIP:%HTTPPORT/1427 -m 184467440737095510
+http://%HOSTIP:%NOLISTENPORT/1427 -m 184467440737095510
diff --git a/tests/data/test1447 b/tests/data/test1447
index d1182942ee..8a651f0092 100644
--- a/tests/data/test1447
+++ b/tests/data/test1447
@@ -24,7 +24,7 @@ proxy
Provide illegal proxy name
---proxy "http://a:b@/x" http://%HOSTIP:%HTTPPORT
+--proxy "http://a:b@/x" http://%HOSTIP:%NOLISTENPORT
diff --git a/tests/data/test1453 b/tests/data/test1453
index eaf9dd3b9e..76b5acda4f 100644
--- a/tests/data/test1453
+++ b/tests/data/test1453
@@ -23,7 +23,7 @@ tftp
Too long tftp filename
-tftp://%HOSTIP:%TFTPPORT/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
+tftp://%HOSTIP:%NOLISTENPORT/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz
diff --git a/tests/data/test1508 b/tests/data/test1508
index b276b8b310..fbdc322a05 100644
--- a/tests/data/test1508
+++ b/tests/data/test1508
@@ -18,7 +18,7 @@ lib1508
Close a multi handle without using it
-http://%HOSTIP:%HTTPPORT/path/1508
+http://%HOSTIP:%NOLISTENPORT/path/1508
diff --git a/tests/data/test1550 b/tests/data/test1550
index b78756e9a8..bbf60f98a7 100644
--- a/tests/data/test1550
+++ b/tests/data/test1550
@@ -23,7 +23,7 @@ lib1550
verify setting pipeling blacklisting options
-http://%HOSTIP:%HTTPPORT/1550
+http://%HOSTIP:%NOLISTENPORT/1550
diff --git a/tests/data/test2036 b/tests/data/test2036
index 0ab8b66c5c..4b2ec43a81 100644
--- a/tests/data/test2036
+++ b/tests/data/test2036
@@ -22,7 +22,7 @@ http
HTTP, -O with no slash at all in the URL
-%HOSTIP:%HTTPPORT -O
+%HOSTIP:%NOLISTENPORT -O
diff --git a/tests/data/test219 b/tests/data/test219
index 49f17e43fd..2b638950ef 100644
--- a/tests/data/test219
+++ b/tests/data/test219
@@ -24,7 +24,7 @@ proxy
try using proxy with unsupported scheme
--x foo://%HOSTIP:%HTTPPORT/219 http://%HOSTIP:%HTTPPORT/219
+-x foo://%HOSTIP:%NOLISTENPORT/219 http://%HOSTIP:%NOLISTENPORT/219
diff --git a/tests/data/test288 b/tests/data/test288
index e62eabd3c3..26e1b842a8 100644
--- a/tests/data/test288
+++ b/tests/data/test288
@@ -28,7 +28,7 @@ file
file:// with (unsupported) proxy, authentication and range
-all_proxy=http://fake:user@%HOSTIP:%HTTPPORT/
+all_proxy=http://fake:user@%HOSTIP:%NOLISTENPORT/
file://localhost%FILE_PWD/log/test288.txt
diff --git a/tests/data/test333 b/tests/data/test333
index 198af9c861..0fd0591e8c 100644
--- a/tests/data/test333
+++ b/tests/data/test333
@@ -20,7 +20,7 @@ none
Try a non-boolean command line option with --no-
---no-proxy "hey" http://%HOSTIP:%HTTPPORT/333
+--no-proxy "hey" http://%HOSTIP:%NOLISTENPORT/333
diff --git a/tests/data/test501 b/tests/data/test501
index 674bc43b4a..8b3dac7ede 100644
--- a/tests/data/test501
+++ b/tests/data/test501
@@ -26,7 +26,7 @@ lib501
simple libcurl attempt operation without URL set
-http://%HOSTIP:%HTTPPORT/501
+http://%HOSTIP:%NOLISTENPORT/501
diff --git a/tests/data/test504 b/tests/data/test504
index be8f95e2bb..351ae749f2 100644
--- a/tests/data/test504
+++ b/tests/data/test504
@@ -32,7 +32,7 @@ lib504
simple multi through local proxy without listener
-http://%HOSTIP:%HTTPSPORT/504 %HOSTIP:%NOLISTENPORT
+http://%HOSTIP:%NOLISTENPORT/504 %HOSTIP:%NOLISTENPORT
diff --git a/tests/data/test632 b/tests/data/test632
index 63f5630adf..456adc604c 100644
--- a/tests/data/test632
+++ b/tests/data/test632
@@ -20,7 +20,7 @@ sftp
SFTP syntactically invalid host key
---hostpubmd5 00 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%POSIX_PWD/log/irrelevant-file --insecure
+--hostpubmd5 00 --key curl_client_key --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%NOLISTENPORT%POSIX_PWD/log/irrelevant-file --insecure
diff --git a/tests/data/test75 b/tests/data/test75
index 115963dfa9..7a67c638ec 100644
--- a/tests/data/test75
+++ b/tests/data/test75
@@ -30,7 +30,7 @@ HTTP, urlglob retrieval with bad range
# The error message on stdout implicitly depends on the length of the
# URL, so refuse to run if the length is unexpected.
-perl %SRCDIR/libtest/test75.pl http://%HOSTIP:%HTTPPORT/ 22
+perl %SRCDIR/libtest/test75.pl http://%HOSTIP:%NOLISTENPORT/ 22
diff --git a/tests/data/test76 b/tests/data/test76
index ada3a33595..b6c47cd88a 100644
--- a/tests/data/test76
+++ b/tests/data/test76
@@ -22,7 +22,7 @@ http
HTTP, -O with no file name part in the URL
-http://%HOSTIP:%HTTPPORT/76/ -O
+http://%HOSTIP:%NOLISTENPORT/76/ -O