File 3481-snmp-agent-test-Adjust-address-extraction.patch of Package erlang

From 364a2a6fffb8430377de7038e72ca10bac6f2023 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Wed, 30 Sep 2020 08:21:09 +0200
Subject: [PATCH 11/21] [snmp|agent|test] Adjust address extraction

OTP-16649
---
 lib/snmp/test/snmp_agent_SUITE.erl | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/snmp/test/snmp_agent_SUITE.erl b/lib/snmp/test/snmp_agent_SUITE.erl
index 36e52ce207..bc477f7a72 100644
--- a/lib/snmp/test/snmp_agent_SUITE.erl
+++ b/lib/snmp/test/snmp_agent_SUITE.erl
@@ -7670,8 +7670,15 @@ otp16649_init(N, AgentPreTransports, Config) ->
     IpFamily          = inet,
     Host              = snmp_test_lib:hostname(), 
     Ip                = ?LOCALHOST(),
-    {ok, AgentIP}     = snmp_misc:ip(AgentHost),
-    {ok, ManagerIP0}  = snmp_misc:ip(ManagerHost),
+    %% We should really "extract" the address from the hostnames,
+    %% but because on some OSes (Ubuntu) adds 12.7.0.1.1 to its hosts file,
+    %% this does not work. We want a "proper" address.
+    %% Also, since both nodes (agent and manager) are both started locally,
+    %% we can use 'Ip' for both!
+    %% {ok, AgentIP}     = snmp_misc:ip(AgentHost),
+    %% {ok, ManagerIP0}  = snmp_misc:ip(ManagerHost),
+    AgentIP           = Ip,
+    ManagerIP0        = Ip,
     ManagerIP         = tuple_to_list(ManagerIP0),
     ?IPRINT("otp16649_init -> "
             "~n      Host:       ~p"
-- 
2.26.2

openSUSE Build Service is sponsored by