File 0728-fix-SSL-tests-run-in-specific-environment.patch of Package erlang

From 5a8bcf18ad9f75ae18c168f2804b0ab315b802fe Mon Sep 17 00:00:00 2001
From: Maxim Fedorov <dane@whatsapp.com>
Date: Tue, 16 Nov 2021 20:13:11 -0800
Subject: [PATCH] fix SSL tests run in specific environment

Before this patch, run_where and node_to_hostip were returning
different IP addresses, failing large number of tests when /etc/hosts
file was containing
    host 127.0.0.1
    host.domain 127.0.0.2

It was happening because `node()` was `test_server@host`, while
`net_adm:localhost()` was returning `host.domain`, so they were
returning different IP addresses, subsequently failing in verification
in check_result/4.
---
 lib/ssl/test/ssl_test_lib.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index 91601b2133..7ef5034f4b 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -409,7 +409,7 @@ run_where(_, ipv6) ->
     {ClientNode, ServerNode, Host}.
 
 node_to_hostip(Node, Role) ->
-    [_ , Host] = string:tokens(atom_to_list(Node), "@"),
+    Host = rpc:call(Node, net_adm, localhost, []),
     {ok, Address} = inet:getaddr(Host, inet),
     %% Convert client addresses in 127.0.0.0/24 subnet to the atom 'localhost'.
     %% This is a workaround for testcase problems caused by the fact that
-- 
2.31.1

openSUSE Build Service is sponsored by