Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
3212-kernel-net-test-Tweaked-for-Darwin.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3212-kernel-net-test-Tweaked-for-Darwin.patch of Package erlang
From e4d5c24e496805b9c2b7ee66b2bd9fcf82d7d790 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Wed, 17 Apr 2024 14:34:54 +0200 Subject: [PATCH 12/18] [kernel|net|test] Tweaked for Darwin --- lib/kernel/test/net_SUITE.erl | 60 +++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/lib/kernel/test/net_SUITE.erl b/lib/kernel/test/net_SUITE.erl index 32e089532b..eea9283fec 100644 --- a/lib/kernel/test/net_SUITE.erl +++ b/lib/kernel/test/net_SUITE.erl @@ -400,7 +400,8 @@ api_b_getservbyname() -> ok; {error, Reason} -> case os:type() of - {unix, linux} -> + {unix, linux} + when (Reason =:= einval) -> %% This happens on some linux %% (Ubuntu 22 on Parallels ARM VM) ok; @@ -415,11 +416,39 @@ api_b_getservbyname() -> not_on_windows(fun() -> {ok, 161} = net:getservbyname("snmp", tcp) end), not_on_windows(fun() -> {ok, 4369} = net:getservbyname("epmd", tcp) end), not_on_windows(fun() -> {ok, 5672} = net:getservbyname("amqp", tcp) end), - not_on_windows(fun() -> {ok, 5672} = net:getservbyname("amqp", sctp) end), + not_on_windows(fun() -> + case net:getservbyname("amqp", sctp) of + {ok, 5672} -> + ok; + {error, Reason} -> + case os:type() of + {unix, darwin} + when (Reason =:= einval) -> + ok; + _ -> + ?P("Unexpected failure: ~p", + [Reason]), + ?FAIL({"amap", udp, Reason}) + end + end + end), ?P("A couple of (expected) failures"), {error, einval} = net:getservbyname("gurka", tcp), - {error, einval} = net:getservbyname("http", gurka), + case net:getservbyname("http", gurka) of + {error, einval} -> + ok; + {ok, 80} -> + case os:type() of + {unix, darwin} -> + %% Darwin seems to ignore the clearly invalid protocol + %% and just looks at the Service... + ok; + _ -> + ?P("Unexpected success"), + ?FAIL({"http", gurka}) + end + end, ?P("done"), ok. @@ -449,10 +478,12 @@ api_b_getservbyport() -> not_on_windows(fun() -> case net:getservbyport(80, udp) of {ok, STR} when (STR =:= "http") orelse + (STR =:= "www") orelse (STR =:= "WWW") -> ok; {error, Reason} -> case os:type() of - {unix, linux} -> + {unix, linux} + when (Reason =:= einval) -> %% This happens on some linux %% (Ubuntu 22 on Parallels ARM VM) ok; @@ -467,11 +498,26 @@ api_b_getservbyport() -> not_on_windows(fun() -> {ok, "snmp"} = net:getservbyport(161, tcp) end), not_on_windows(fun() -> {ok, "epmd"} = net:getservbyport(4369, tcp) end), not_on_windows(fun() -> {ok, "amqp"} = net:getservbyport(5672, tcp) end), - not_on_windows(fun() -> {ok, "amqp"} = net:getservbyport(5672, sctp) end), + not_on_windows(fun() -> + case net:getservbyport(5672, sctp) of + {ok, "amqp"} -> + ok; + {error, Reason} -> + case os:type() of + {unix, darwin} + when (Reason =:= einval) -> + ok; + _ -> + ?P("Unexpected failure: ~p", + [Reason]), + ?FAIL({"amap", sctp, Reason}) + end + end + end), ?P("A couple of (expected) failures"), - {error, einval} = net:getservbyport(11111, tcp), - {error, einval} = net:getservbyport(80, gurka), + {error, einval} = net:getservbyport(16#FFFF, tcp), + {error, einval} = net:getservbyport(80, gurka), ?P("done"), 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