diff options
author | Micael Karlberg <[email protected]> | 2019-03-01 12:03:43 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-03-01 12:03:43 +0100 |
commit | d80019d4a3c4c3682a6f9ba713c3ea9c92c06af2 (patch) | |
tree | 1ced9d0c1aba0fc46685cf400a7b3fb735f9b03e /erts | |
parent | a2a28242245744b8b0a6cf22e24e54b20abb5ed1 (diff) | |
download | otp-d80019d4a3c4c3682a6f9ba713c3ea9c92c06af2.tar.gz otp-d80019d4a3c4c3682a6f9ba713c3ea9c92c06af2.tar.bz2 otp-d80019d4a3c4c3682a6f9ba713c3ea9c92c06af2.zip |
[net] Fixed name_and_addr_info test case
The test case did not consider that the machine might have both
IPv4 (inet) and IPv6 (inet6) domain interfaces.
OTP-15635
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/test/net_SUITE.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/erts/emulator/test/net_SUITE.erl b/erts/emulator/test/net_SUITE.erl index cd95ad3903..1a973cacb2 100644 --- a/erts/emulator/test/net_SUITE.erl +++ b/erts/emulator/test/net_SUITE.erl @@ -235,7 +235,9 @@ verify_addr_info(AddrInfos, Domain) when (AddrInfos =/= []) -> verify_addr_info2([], _Domain) -> ok; -verify_addr_info2([#{addr := #{addr := Addr, family := Domain, port := Port}, +verify_addr_info2([#{addr := #{addr := Addr, + family := Domain, + port := Port}, family := Domain, type := _Type, protocol := _Proto}|T], Domain) @@ -243,6 +245,10 @@ verify_addr_info2([#{addr := #{addr := Addr, family := Domain, port := Port} (((Domain =:= inet) andalso is_tuple(Addr) andalso (size(Addr) =:= 4)) orelse ((Domain =:= inet6) andalso is_tuple(Addr) andalso (size(Addr) =:= 8))) -> verify_addr_info2(T, Domain); +verify_addr_info2([#{family := DomainA}|T], DomainB) + when (DomainA =/= DomainB) -> + %% Ignore entries for other domains + verify_addr_info2(T, DomainB); verify_addr_info2([BadAddrInfo|_], Domain) -> ?FAIL({bad_address_info, BadAddrInfo, Domain}). @@ -327,7 +333,7 @@ which_local_addr(Domain) -> end. which_addr(_Domain, []) -> - ?FAIL(no_address); + skip(no_address); which_addr(Domain, [{"lo" ++ _, _}|IFL]) -> which_addr(Domain, IFL); which_addr(Domain, [{_Name, IFO}|IFL]) -> |