From: Michael Tremer Date: Thu, 21 Jul 2022 08:18:21 +0000 (+0000) Subject: tests: Run execute tests in the stub environment X-Git-Tag: 0.9.28~663 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d3a872c6b84eef4d389fa0f648059a0a0497d63;p=pakfire.git tests: Run execute tests in the stub environment Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 67be32c6a..31d89fe1f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -801,6 +801,7 @@ TESTSUITE_LDADD = \ TESTS_ENVIRONMENT = \ TEST_DATA_DIR="$(abs_top_srcdir)/tests/data" \ + TEST_STUB_ROOT="$(abs_top_builddir)/tests/stub/root" \ PAKFIRE_LOG=debug \ #PYTHONPATH="$(top_srcdir)/.libs:$(top_srcdir)/src" \ topdir="$(shell pwd)" diff --git a/tests/python/execute.py b/tests/python/execute.py index 3567adfac..d619e41e4 100755 --- a/tests/python/execute.py +++ b/tests/python/execute.py @@ -1,5 +1,6 @@ #!/usr/bin/python3 +import os import pakfire import unittest @@ -8,7 +9,11 @@ class Test(unittest.TestCase): This tests the execute command """ def setUp(self): - self.pakfire = pakfire.Pakfire("/") + path = os.environ.get("TEST_STUB_ROOT") + if not path: + raise RuntimeError("TEST_STUB_ROOT is not defined") + + self.pakfire = pakfire.Pakfire(path) def test_execute(self): r = self.pakfire.execute(["/usr/bin/sleep", "0"])