Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
3211-kernel-net-test-Tweaked-tests-for-ubuntu-o...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3211-kernel-net-test-Tweaked-tests-for-ubuntu-on-vm.patch of Package erlang
From c71544e3c18a23108f8aa32d77a3882d65f7718a Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Wed, 17 Apr 2024 12:53:18 +0200 Subject: [PATCH 11/18] [kernel|net|test] Tweaked tests for ubuntu on vm --- lib/kernel/test/net_SUITE.erl | 40 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/lib/kernel/test/net_SUITE.erl b/lib/kernel/test/net_SUITE.erl index f49fc77a1c..32e089532b 100644 --- a/lib/kernel/test/net_SUITE.erl +++ b/lib/kernel/test/net_SUITE.erl @@ -394,7 +394,23 @@ api_b_getservbyname() -> {ok, 80} = net:getservbyname("http"), {ok, 80} = net:getservbyname("http", any), {ok, 80} = net:getservbyname("http", tcp), - not_on_windows(fun() -> {ok, 80} = net:getservbyname("www", udp) end), + not_on_windows(fun() -> + case net:getservbyname("www", udp) of + {ok, 80} -> + ok; + {error, Reason} -> + case os:type() of + {unix, linux} -> + %% This happens on some linux + %% (Ubuntu 22 on Parallels ARM VM) + ok; + _ -> + ?P("Unexpected failure: ~p", + [Reason]), + ?FAIL({"www", udp, Reason}) + end + end + end), {ok, 161} = net:getservbyname("snmp", udp), not_on_windows(fun() -> {ok, 161} = net:getservbyname("snmp", tcp) end), not_on_windows(fun() -> {ok, 4369} = net:getservbyname("epmd", tcp) end), @@ -430,11 +446,23 @@ api_b_getservbyport() -> {ok, "http"} = net:getservbyport(80), {ok, "http"} = net:getservbyport(80, any), {ok, "http"} = net:getservbyport(80, tcp), - not_on_windows(fun() -> case net:getservbyport(80, udp) of - {ok, STR} when (STR =:= "http") orelse (STR =:= "WWW") -> ok; - {error, Reason} -> ?P("Unexpected failure: ~p", [Reason]), ?FAIL({80, udp, Reason}) - end - end), + not_on_windows(fun() -> + case net:getservbyport(80, udp) of + {ok, STR} when (STR =:= "http") orelse + (STR =:= "WWW") -> ok; + {error, Reason} -> + case os:type() of + {unix, linux} -> + %% This happens on some linux + %% (Ubuntu 22 on Parallels ARM VM) + ok; + _ -> + ?P("Unexpected failure: ~p", + [Reason]), + ?FAIL({80, udp, Reason}) + end + end + end), {ok, "snmp"} = net:getservbyport(161, udp), not_on_windows(fun() -> {ok, "snmp"} = net:getservbyport(161, tcp) end), not_on_windows(fun() -> {ok, "epmd"} = net:getservbyport(4369, tcp) end), -- 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