aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2023-05-19 12:06:44 -0400
committerJake Hunsaker <jhunsake@redhat.com>2023-05-31 08:54:17 -0400
commitdf0a4353eb48b538b3b63897be5e35d181d6ab20 (patch)
treed5dac600ee083466987af7198fa2cb3ff49805ef /tests
parent0af21a2afbd9f740c8e9488088ba1e8a4af1d981 (diff)
downloadsos-df0a4353eb48b538b3b63897be5e35d181d6ab20.tar.gz
[Plugin|Archive] Fix collection of symlinks in containers
When collecting an sos report from witin a container, and intending to collect host-level information, symlink collection would previously collect the container's version of the symlink target due to how they would resolve within the `Archive.add_file()` flow. Fix this by simply forcing the follow up collection of the sysroot location of the symlink target, which would previously be aborted due to the fact that sos had already collected the container's matching file. This introduces a certain level of inefficiency by way of doubling the copy operations, however ensuring that we only make a single copy operation originally involves a quite fragile set of path mangling that depends heavily upon how the symlinks are created on the host's filesystem. For example a symlink using a relative path could be resolved somewhat easily, but a symlink using an absolute path introduces a certain amount of indeterminate resolution, which we cannot allow for the vast majority of use cases that are performed outside of a container. Resolves: rhbz#2075720 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/plugin_tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unittests/plugin_tests.py b/tests/unittests/plugin_tests.py
index 8170a1dd..49784514 100644
--- a/tests/unittests/plugin_tests.py
+++ b/tests/unittests/plugin_tests.py
@@ -45,7 +45,7 @@ class MockArchive(TarFileArchive):
def name(self):
return "mock.archive"
- def add_file(self, src, dest=None):
+ def add_file(self, src, dest=None, force=False):
if not dest:
dest = src
self.m[src] = dest