Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
3206-kernel-net-test-Extend-getifaddrs-test-cas...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3206-kernel-net-test-Extend-getifaddrs-test-case.patch of Package erlang
From bb399793ec1426ca9dbd5d3f956631bcd00318a8 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Tue, 16 Apr 2024 11:18:43 +0200 Subject: [PATCH 06/18] [kernel|net|test] Extend getifaddrs test case --- lib/kernel/test/net_SUITE.erl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/kernel/test/net_SUITE.erl b/lib/kernel/test/net_SUITE.erl index bef17f0476..c9f649a8da 100644 --- a/lib/kernel/test/net_SUITE.erl +++ b/lib/kernel/test/net_SUITE.erl @@ -263,6 +263,8 @@ api_b_getifaddrs() -> {ok, IfAddrs} -> i("IfAddrs: " "~n ~p", [IfAddrs]), + verify_broadcast(IfAddrs), + verify_loopback(IfAddrs), ok; {error, enotsup = Reason} -> i("getifaddrs not supported - skipping"), @@ -302,6 +304,37 @@ api_b_getifaddrs() -> skip(CReason) end. + +verify_broadcast([]) -> + ok; +verify_broadcast([#{flags := Flags, + broadaddr := _} = IfAddr|IfAddrs]) -> + %% Must have the 'broadcast' flag + case lists:member(broadcast, Flags) of + true -> + verify_broadcast(IfAddrs); + false -> + ?FAIL({missing_broadcast_flag, IfAddr}) + end; +verify_broadcast([_|IfAddrs]) -> + verify_broadcast(IfAddrs). + +verify_loopback([]) -> + ok; +verify_loopback([#{name := "lo", + flags := Flags, + addr := _Addr} = IfAddr|IfAddrs]) -> + %% Must have the 'broadcast' flag + case lists:member(loopback, Flags) of + true -> + verify_loopback(IfAddrs); + false -> + ?FAIL({missing_loopback_flag, IfAddr}) + end; +verify_loopback([_|IfAddrs]) -> + verify_loopback(IfAddrs). + + win_getifaddrs_ife({ok, II}, {ok, AT}) -> IDX1 = [IDX || #{index := IDX} <- II], IDX2 = [IDX || #{index := IDX} <- AT], -- 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