File 7666-snmp-test-Add-skip-condition-for-specific-slooow-mac.patch of Package erlang

From 694850491e07635862bc22fa2a751afd8f1f0598 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Wed, 19 Jan 2022 16:37:26 +0100
Subject: [PATCH 06/12] [snmp|test] Add skip condition for specific *slooow*
 machine

---
 lib/snmp/test/snmp_agent_SUITE.erl | 50 ++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/lib/snmp/test/snmp_agent_SUITE.erl b/lib/snmp/test/snmp_agent_SUITE.erl
index 44ee3abdc0..7f5c2dfec4 100644
--- a/lib/snmp/test/snmp_agent_SUITE.erl
+++ b/lib/snmp/test/snmp_agent_SUITE.erl
@@ -1091,6 +1091,56 @@ init_per_testcase1(v3_inform_i = _Case, Config) when is_list(Config) ->
 	 "~n   Case:   ~p"
 	 "~n   Config: ~p", [_Case, Config]),
     wd_start(10, Config);
+init_per_testcase1(v3_des_priv = _Case, Config) when is_list(Config) ->
+    ?DBG("init_per_testcase1 -> entry with"
+	 "~n   Case:   ~p"
+	 "~n   Config: ~p", [_Case, Config]),
+    %% <CONDITIONAL-SKIP>
+    %% This is intended to catch Yellow Dog Linux release 6.2 (2.6.29)
+    LinuxVersionVerify = 
+	fun() ->
+		case string:to_lower(os:cmd("uname -m")) of
+		    "ppc" ++ _ ->
+			case file:read_file_info("/etc/issue") of
+			    {ok, _} ->
+				case string:to_lower(
+                                       os:cmd("grep -i yellow /etc/issue")) of
+				    "yellow dog " ++ _ ->
+					case os:version() of
+					    {2, 6, 29} ->
+                                                ?IPRINT("(PPC Linux) "
+                                                        "kernel version check: "
+                                                        "{2, 6, 29} => SKIP"),
+						true;
+					    V ->
+                                                ?IPRINT("(PPC Linux) "
+                                                        "kernel version check: "
+                                                        "~p != {2, 6, 29} => "
+                                                        "*NO* SKIP", [V]),
+						false
+					end;
+				    _ -> % Maybe plain Debian or Ubuntu
+                                        ?IPRINT("(PPC Linux) => *NO* SKIP"),
+					false
+				end;
+			    _ ->
+                                ?IPRINT("(PPC Linux) Unknown distro => "
+                                        "*NO* SKIP"),
+				false
+			end;
+		    _ ->
+                        ?IPRINT("(Linux) Not PPC => *NO* SKIP"),
+			false
+		end
+	end,
+    Skippable = [{unix, [{linux, LinuxVersionVerify}]}],
+    %% </CONDITIONAL-SKIP>
+    case ?OS_BASED_SKIP(Skippable) of
+        true ->
+            {skip, "Host *may* not *properly* handle this test case"};
+        false ->
+            wd_start(6, Config)
+    end;
 init_per_testcase1(_Case, Config) when is_list(Config) ->
     ?DBG("init_per_testcase -> entry with"
 	 "~n   Case:   ~p"
-- 
2.34.1

openSUSE Build Service is sponsored by