File fix-optimization_order-opt-to-prevent-test-fails.patch of Package salt

From 1600cc0e46ea81c4e2380fc52182c85e6c3949ef Mon Sep 17 00:00:00 2001
From: Victor Zhestkov <vzhestkov@suse.com>
Date: Mon, 2 Oct 2023 14:24:27 +0200
Subject: [PATCH] Fix optimization_order opt to prevent test fails

---
 tests/pytests/unit/grains/test_core.py   | 4 ++--
 tests/pytests/unit/loader/test_loader.py | 2 +-
 tests/pytests/unit/test_config.py        | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py
index 8b840738ef..ae732c4f3d 100644
--- a/tests/pytests/unit/grains/test_core.py
+++ b/tests/pytests/unit/grains/test_core.py
@@ -158,7 +158,7 @@ def test_network_grains_secondary_ip(tmp_path):
     opts = {
         "cachedir": str(cache_dir),
         "extension_modules": str(extmods),
-        "optimization_order": [0],
+        "optimization_order": [0, 1, 2],
     }
     with patch("salt.utils.network.interfaces", side_effect=[data]):
         grains = salt.loader.grain_funcs(opts)
@@ -254,7 +254,7 @@ def test_network_grains_cache(tmp_path):
     opts = {
         "cachedir": str(cache_dir),
         "extension_modules": str(extmods),
-        "optimization_order": [0],
+        "optimization_order": [0, 1, 2],
     }
     with patch(
         "salt.utils.network.interfaces", side_effect=[call_1, call_2]
diff --git a/tests/pytests/unit/loader/test_loader.py b/tests/pytests/unit/loader/test_loader.py
index ea0883b938..357ea565cf 100644
--- a/tests/pytests/unit/loader/test_loader.py
+++ b/tests/pytests/unit/loader/test_loader.py
@@ -59,7 +59,7 @@ def test_raw_mod_functions():
     "Ensure functions loaded by raw_mod are LoaderFunc instances"
     opts = {
         "extension_modules": "",
-        "optimization_order": [0],
+        "optimization_order": [0, 1, 2],
     }
     ret = salt.loader.raw_mod(opts, "grains", "get")
     for k, v in ret.items():
diff --git a/tests/pytests/unit/test_config.py b/tests/pytests/unit/test_config.py
index 313c3cb0b0..e64faa3659 100644
--- a/tests/pytests/unit/test_config.py
+++ b/tests/pytests/unit/test_config.py
@@ -20,7 +20,7 @@ def test_call_id_function(tmp_path):
         "cachedir": str(cache_dir),
         "extension_modules": str(extmods),
         "grains": {"osfinger": "meh"},
-        "optimization_order": [0],
+        "optimization_order": [0, 1, 2],
     }
     ret = salt.config.call_id_function(opts)
     assert ret == "meh"
-- 
2.47.0

openSUSE Build Service is sponsored by