Blame SOURCES/0016-Run-tests-for-fill-sack-from-repos-in-cache-in-installroot..patch

4f4af9
From 291071a937a1de398641f02002413678398e473c Mon Sep 17 00:00:00 2001
4f4af9
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
4f4af9
Date: Mon, 8 Feb 2021 08:25:46 +0100
4f4af9
Subject: [PATCH] Run tests for fill_sack_from_repos_in_cache in installroot
4f4af9
 (RhBug:1865803)
4f4af9
4f4af9
This prevents loading data (like failsafe) from host.
4f4af9
4f4af9
It also allows testing that there are no modules in the installroot not just
4f4af9
no base-runtime* in test_with_modular_repo_without_modules_yaml.
4f4af9
4f4af9
https://bugzilla.redhat.com/show_bug.cgi?id=1865803
4f4af9
---
4f4af9
 tests/test_fill_sack_from_repos_in_cache.py | 4 +++-
4f4af9
 1 file changed, 3 insertions(+), 1 deletion(-)
4f4af9
4f4af9
diff --git a/tests/test_fill_sack_from_repos_in_cache.py b/tests/test_fill_sack_from_repos_in_cache.py
4f4af9
index 24b0d4598d..f27235bf84 100644
4f4af9
--- a/tests/test_fill_sack_from_repos_in_cache.py
4f4af9
+++ b/tests/test_fill_sack_from_repos_in_cache.py
4f4af9
@@ -42,6 +42,7 @@ class FillSackFromReposInCacheTest(unittest.TestCase):
4f4af9
     def _create_cache_for_repo(self, repopath, tmpdir):
4f4af9
         conf = dnf.conf.MainConf()
4f4af9
         conf.cachedir = os.path.join(tmpdir, "cache")
4f4af9
+        conf.installroot = os.path.join(tmpdir)
4f4af9
 
4f4af9
         base = dnf.Base(conf=conf)
4f4af9
 
4f4af9
@@ -68,6 +69,7 @@ def _setUp_from_repo_path(self, original_repo_path):
4f4af9
         # Prepare base for the actual test
4f4af9
         conf = dnf.conf.MainConf()
4f4af9
         conf.cachedir = os.path.join(self.tmpdir, "cache")
4f4af9
+        conf.installroot = os.path.join(self.tmpdir)
4f4af9
         self.test_base = dnf.Base(conf=conf)
4f4af9
         repoconf = dnf.repo.Repo(TEST_REPO_NAME, conf)
4f4af9
         repoconf.baseurl = self.repo_copy_path
4f4af9
@@ -258,5 +260,5 @@ def test_with_modular_repo_without_modules_yaml(self):
4f4af9
         self.assertEqual(packages[0].evr, "10.0-7")
4f4af9
 
4f4af9
         self.module_base = dnf.module.module_base.ModuleBase(self.test_base)
4f4af9
-        modules, _ = self.module_base._get_modules("base-runtime*")
4f4af9
+        modules, _ = self.module_base._get_modules("*")
4f4af9
         self.assertEqual(len(modules), 0)