From c9e90ec0b21dc973cc8244f99a434024d8694cbe Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 14 Feb 2022 09:29:05 -0800 Subject: [PATCH] tests: Fix the image minimizer test dnf usage If the host dnf repos contain $releasever then using --installroot will fail because it tries to use a rpmdb in the installroot, which starts out empty. Passing --releasever=/ will use the releasever from the host. --- tests/image-minimizer/test_minimizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/image-minimizer/test_minimizer.py b/tests/image-minimizer/test_minimizer.py index 3c594665..93dd1a93 100644 --- a/tests/image-minimizer/test_minimizer.py +++ b/tests/image-minimizer/test_minimizer.py @@ -5,10 +5,10 @@ import unittest from minimizer import ImageMinimizer -class BuildStampTestCase(unittest.TestCase): +class MinimizerTestCase(unittest.TestCase): def test_minimizer_ok(self): with tempfile.TemporaryDirectory(prefix="minimize.test.") as rootdir: - check_call(["dnf", "--installroot", rootdir, "install", "-y", \ + check_call(["dnf", "--releasever=/", "--installroot", rootdir, "install", "-y", \ "filesystem"]) im = ImageMinimizer("./tests/image-minimizer/im-script.txt", rootdir, False, False)