From 3006f467e6e3908193d28d76bddcc372c4b98875 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Tue, 9 Jul 2019 13:35:28 +0200 Subject: [archive] Handle checking container sysroot in _make_leading_paths Previously, in _make_leading_paths(), checking host file paths did not account for non / sysroots, for situations where sos is run in a container and the host's / is actually mounted under /host for example. This would lead to copy errors when trying to copy symlinks. This method now will use sysroot if one is set, thus avoiding copy errors. Resolves: #1705 Signed-off-by: Jake Hunsaker Signed-off-by: Pavel Moravec --- tests/archive_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/archive_tests.py b/tests/archive_tests.py index e5b329b5..350220b9 100644 --- a/tests/archive_tests.py +++ b/tests/archive_tests.py @@ -20,7 +20,7 @@ class TarFileArchiveTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() enc = {'encrypt': False} - self.tf = TarFileArchive('test', self.tmpdir, Policy(), 1, enc) + self.tf = TarFileArchive('test', self.tmpdir, Policy(), 1, enc, '/') def tearDown(self): shutil.rmtree(self.tmpdir) @@ -113,6 +113,7 @@ class TarFileArchiveTest(unittest.TestCase): def test_compress(self): self.tf.finalize("auto") + if __name__ == "__main__": unittest.main() -- cgit