Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
0303-Test-empty-hostname-behaviour-only-for-Uni...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0303-Test-empty-hostname-behaviour-only-for-Unix.patch of Package erlang
From b4c7f5b030f09564d7ed2b3ebb5610f7ed34b4e2 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Tue, 18 Apr 2023 09:40:52 +0200 Subject: [PATCH 4/4] Test empty hostname behaviour only for Unix On Windows, when looking up the empty hostname, one gets the address of localhost. On Unix one gets a failed attempt to find an address of the top domain ("."). Change the test cases to verify the Unix behaviour on Unix. --- lib/kernel/test/gen_sctp_SUITE.erl | 7 +++++-- lib/kernel/test/gen_tcp_api_SUITE.erl | 7 +++++-- lib/kernel/test/gen_udp_SUITE.erl | 7 +++++-- lib/kernel/test/inet_SUITE.erl | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index c1556f69d7..7b0dbb0d2e 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -771,8 +771,11 @@ api_listen(Config) when is_list(Config) -> {ok,Sb} = gen_sctp:open(Pb), {ok,Sa} = gen_sctp:open(), - {error, nxdomain} = gen_sctp:connect(Sa, "", 65535, []), - {error, nxdomain} = gen_sctp:connect(Sa, '', 65535, []), + element(1, os:type()) =:= unix andalso + begin + {error, nxdomain} = gen_sctp:connect(Sa, "", 65535, []), + {error, nxdomain} = gen_sctp:connect(Sa, '', 65535, []) + end, {error, nxdomain} = gen_sctp:connect(Sa, ".", 65535, []), {error, nxdomain} = gen_sctp:connect(Sa, '.', 65535, []), diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 41dd745250..adaf38226a 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -355,8 +355,11 @@ t_connect_bad(Config) when is_list(Config) -> NonExistingPort = 45638, % Not in use, I hope. t_connect_bad(Config, localhost, NonExistingPort, "port not in use"), t_connect_bad(Config, "non-existing-host-xxx", 7, "non-existing host"), - t_connect_bad(Config, "", 7, "empty host string"), - t_connect_bad(Config, '', 7, "empty host atom"), + element(1, os:type()) =:= unix andalso + begin + t_connect_bad(Config, "", 7, "empty host string"), + t_connect_bad(Config, '', 7, "empty host atom") + end, t_connect_bad(Config, ".", 7, "root domain string"), t_connect_bad(Config, '.', 7, "root domain atom"). diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 44c3c7708b..66f0bf3373 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -348,8 +348,11 @@ send_to_empty(Config) when is_list(Config) -> do_send_to_empty(Config) -> {ok, Sock} = ?OPEN(Config, 0), - {error, nxdomain} = gen_udp:send(Sock, "", ?CLOSED_PORT, "xXx"), - {error, nxdomain} = gen_udp:send(Sock, '', ?CLOSED_PORT, "xXx"), + element(1, os:type()) =:= unix andalso + begin + {error, nxdomain} = gen_udp:send(Sock, "", ?CLOSED_PORT, "xXx"), + {error, nxdomain} = gen_udp:send(Sock, '', ?CLOSED_PORT, "xXx") + end, {error, nxdomain} = gen_udp:send(Sock, ".", ?CLOSED_PORT, "xXx"), {error, nxdomain} = gen_udp:send(Sock, '.', ?CLOSED_PORT, "xXx"), ok. diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index 2a59edaaf2..9061b67be1 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -369,8 +369,11 @@ do_gethostbyname(Config) when is_list(Config) -> t_gethostbyname_empty(Config) when is_list(Config) -> - {error,nxdomain} = inet:gethostbyname(""), - {error,nxdomain} = inet:gethostbyname(''), + element(1, os:type()) =:= unix andalso + begin + {error,nxdomain} = inet:gethostbyname(""), + {error,nxdomain} = inet:gethostbyname('') + end, {error,nxdomain} = inet:gethostbyname("."), {error,nxdomain} = inet:gethostbyname('.'), ok. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor