File 0163-snmp-snmpnet-test-Corrected-the-suite-init-function.patch of Package erlang

From da34b2fbe983e19ed5a0e49971618d9ceaf0aea9 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Fri, 13 Dec 2019 16:41:32 +0100
Subject: [PATCH 03/10] [snmp|snmpnet|test] Corrected the suite init function

Did not properly handle the (suite) skip.
---
 lib/snmp/test/snmp_to_snmpnet_SUITE.erl | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
index 09f20ad48a..d612094c35 100644
--- a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
+++ b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl
@@ -131,15 +131,19 @@ snmpd_cases() ->
 %%
 
 init_per_suite(Config) ->
-    try
-        begin
-            Config2 = ?LIB:init_per_suite(netsnmp_init(Config)),
-            snmp_test_sys_monitor:start(),
-            Config2
-        end
-    catch
-        throw:{skip, _} = SKIP ->
-            SKIP
+    case netsnmp_init(Config) of
+        {skip, _} = SKIP ->
+            SKIP;
+
+        Config1 ->
+            case ?LIB:init_per_suite(Config1) of
+                {skip, _} = SKIP ->
+                    SKIP;
+
+                Config2 when is_list(Config2) ->
+                    snmp_test_sys_monitor:start(),
+                    Config2
+            end
     end.
 
 netsnmp_init(Config) ->
@@ -150,10 +154,10 @@ netsnmp_init(Config) ->
                     [{agent_port,   ?AGENT_PORT},
                      {manager_port, ?MANAGER_PORT} | Config];
                 false ->
-                    throw({skip, "Buggy NetSNMP"})
+                    {skip, "Buggy NetSNMP"}
             end;
         false ->
-            throw({skip, "No NetSNMP"})
+            {skip, "No NetSNMP"}
     end.
 
 has_netsnmp() ->
-- 
2.16.4

openSUSE Build Service is sponsored by