[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 233/264: tests: add %NOLISTENPORT and use it
From: |
gnunet |
Subject: |
[gnurl] 233/264: tests: add %NOLISTENPORT and use it |
Date: |
Thu, 30 Apr 2020 16:08:56 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 018dd775c868a53c15fdaba7c67aaae6c5fd35c1
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Apr 20 10:21:57 2020 +0200
tests: add %NOLISTENPORT and use it
The purpose with this variable is to provide a port number that is
reasonably likely to not have a listener on the local host so that tests
can try connect failures against it. It uses port 47 - "reserved"
according to IANA.
Updated six tests to use it instead of the previous different ports.
Assisted-by: Emil Engler
Closes #5270
---
tests/FILEFORMAT.md | 1 +
tests/data/test19 | 2 +-
tests/data/test504 | 2 +-
tests/data/test702 | 2 +-
tests/data/test703 | 2 +-
tests/data/test704 | 2 +-
tests/data/test705 | 2 +-
tests/runtests.pl | 2 ++
8 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md
index 586b84b74..034b1a73c 100644
--- a/tests/FILEFORMAT.md
+++ b/tests/FILEFORMAT.md
@@ -365,6 +365,7 @@ Available substitute variables include:
- `%IMAPPORT` - Port number of the IMAP server
- `%MQTTPORT` - Port number of the MQTT server
- `%NEGTELNETPORT` - Port number of the telnet server
+- `%NOLISTENPORT` - Port number where no service is listening
- `%POP36PORT` - IPv6 port number of the POP3 server
- `%POP3PORT` - Port number of the POP3 server
- `%POSIX_PWD` - Current directory somewhat mingw friendly
diff --git a/tests/data/test19 b/tests/data/test19
index 8e1bf5eb4..f053baf08 100644
--- a/tests/data/test19
+++ b/tests/data/test19
@@ -24,7 +24,7 @@ http
attempt connect to non-listening socket
</name>
<command>
-%HOSTIP:2
+%HOSTIP:%NOLISTENPORT
</command>
</client>
diff --git a/tests/data/test504 b/tests/data/test504
index 7c92209cd..be8f95e2b 100644
--- a/tests/data/test504
+++ b/tests/data/test504
@@ -32,7 +32,7 @@ lib504
simple multi through local proxy without listener
</name>
<command>
-http://%HOSTIP:%HTTPSPORT/504 %HOSTIP:55555
+http://%HOSTIP:%HTTPSPORT/504 %HOSTIP:%NOLISTENPORT
</command>
</client>
diff --git a/tests/data/test702 b/tests/data/test702
index c03723676..1c18d0976 100644
--- a/tests/data/test702
+++ b/tests/data/test702
@@ -31,7 +31,7 @@ proxy
Attempt connect to non-listening HTTP server via SOCKS4 proxy
</name>
<command>
---socks4 %HOSTIP:%SOCKSPORT http://%HOSTIP:60000
+--socks4 %HOSTIP:%SOCKSPORT http://%HOSTIP:%NOLISTENPORT
</command>
</client>
diff --git a/tests/data/test703 b/tests/data/test703
index 53d6a0222..d7be71393 100644
--- a/tests/data/test703
+++ b/tests/data/test703
@@ -31,7 +31,7 @@ proxy
Attempt connect to non-listening HTTP server via SOCKS5 proxy
</name>
<command>
---socks5 %HOSTIP:%SOCKSPORT http://%HOSTIP:60000
+--socks5 %HOSTIP:%SOCKSPORT http://%HOSTIP:%NOLISTENPORT
</command>
</client>
diff --git a/tests/data/test704 b/tests/data/test704
index 7f891fa95..9e821c608 100644
--- a/tests/data/test704
+++ b/tests/data/test704
@@ -23,7 +23,7 @@ http
Attempt connect to non-listening SOCKS4 proxy
</name>
<command>
---socks4 %HOSTIP:2 http://%HOSTIP:%HTTPPORT/704
+--socks4 %HOSTIP:%NOLISTENPORT http://%HOSTIP:%HTTPPORT/704
</command>
<features>
proxy
diff --git a/tests/data/test705 b/tests/data/test705
index cfbf3419f..e7ba01220 100644
--- a/tests/data/test705
+++ b/tests/data/test705
@@ -23,7 +23,7 @@ http
Attempt connect to non-listening SOCKS5 proxy
</name>
<command>
---socks5 %HOSTIP:2 http://%HOSTIP:%HTTPPORT/705
+--socks5 %HOSTIP:%NOLISTENPORT http://%HOSTIP:%HTTPPORT/705
</command>
<features>
proxy
diff --git a/tests/runtests.pl b/tests/runtests.pl
index cd22cd3f7..cfc2c8694 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -126,6 +126,7 @@ my $maxport; # maximum used port number
my $noport="[not running]";
+my $NOLISTENPORT=47; # port number we use for a local non-listening service
my $MQTTPORT=$noport; # MQTT server port
my $HTTPPORT=$noport; # HTTP server port
my $HTTP6PORT=$noport; # HTTP IPv6 server port
@@ -3229,6 +3230,7 @@ sub subVariables {
$$thing =~ s/${prefix}SMBPORT/$SMBPORT/g;
$$thing =~ s/${prefix}SMBSPORT/$SMBSPORT/g;
$$thing =~ s/${prefix}NEGTELNETPORT/$NEGTELNETPORT/g;
+ $$thing =~ s/${prefix}NOLISTENPORT/$NOLISTENPORT/g;
# server Unix domain socket paths
$$thing =~ s/${prefix}HTTPUNIXPATH/$HTTPUNIXPATH/g;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 134/264: RELEASE-NOTES: synced, (continued)
- [gnurl] 134/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 103/264: memdebug: don't log free(NULL), gnunet, 2020/04/30
- [gnurl] 138/264: cleanup: correct copyright year range on a few files, gnunet, 2020/04/30
- [gnurl] 131/264: TODO: Option to make -Z merge lined based outputs on stdout, gnunet, 2020/04/30
- [gnurl] 104/264: build: fixed build for systems with select() in unistd.h, gnunet, 2020/04/30
- [gnurl] 226/264: multi-ssl: reset the SSL backend on `Curl_global_cleanup()`, gnunet, 2020/04/30
- [gnurl] 227/264: tests: run the SOCKS test server on a dynamic port number, gnunet, 2020/04/30
- [gnurl] 223/264: runtests: always put test number in servercmd file, gnunet, 2020/04/30
- [gnurl] 205/264: tests: make 2006-2010 handle different port number lengths, gnunet, 2020/04/30
- [gnurl] 235/264: mqtt: make NOSTATE get within the debug name array, gnunet, 2020/04/30
- [gnurl] 233/264: tests: add %NOLISTENPORT and use it,
gnunet <=
- [gnurl] 234/264: tests: run the RTSP test server on a dynamic port number, gnunet, 2020/04/30
- [gnurl] 232/264: mqtt: remove code with no purpose, gnunet, 2020/04/30
- [gnurl] 231/264: mqtt: fix Curl_read() error handling while reading remaining length, gnunet, 2020/04/30
- [gnurl] 247/264: tests/git: ignore mqttd and port files, gnunet, 2020/04/30
- [gnurl] 248/264: docs: fix two typos, gnunet, 2020/04/30
- [gnurl] 240/264: version: skip idn2_check_version() check and add precaution, gnunet, 2020/04/30
- [gnurl] 241/264: lib/mk-ca-bundle: skip empty certs, gnunet, 2020/04/30
- [gnurl] 242/264: transfer: Switch PUT to GET/HEAD on 303 redirect, gnunet, 2020/04/30
- [gnurl] 238/264: curl.h: update comment typo, gnunet, 2020/04/30
- [gnurl] 237/264: GnuTLS: Don't skip really long certificate fields, gnunet, 2020/04/30