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

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