parent
8daed1d773
commit
9478e1e6fd
@ -1,2 +1,2 @@
|
|||||||
SOURCES/sos-4.5.0.tar.gz
|
SOURCES/sos-4.5.1.tar.gz
|
||||||
SOURCES/sos-audit-0.3.tgz
|
SOURCES/sos-audit-0.3.tgz
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
d5e166c75250aef01c86a3a9d8c9fcc8db335f4e SOURCES/sos-4.5.0.tar.gz
|
918b69741255038a99d969cc8b4ceecb7e18034f SOURCES/sos-4.5.1.tar.gz
|
||||||
9d478b9f0085da9178af103078bbf2fd77b0175a SOURCES/sos-audit-0.3.tgz
|
9d478b9f0085da9178af103078bbf2fd77b0175a SOURCES/sos-audit-0.3.tgz
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
From ff5e73b29b1fcc4c5531654d4f67f808408aa989 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pablo Acevedo Montserrat <pacevedo@redhat.com>
|
||||||
|
Date: Thu, 2 Mar 2023 12:12:06 +0100
|
||||||
|
Subject: [PATCH] [microshift] Fix microshift get and add commands
|
||||||
|
|
||||||
|
Drop microshift get usage in favor of oc get commands.
|
||||||
|
Add version and show-config commands before running inspect.
|
||||||
|
|
||||||
|
Closes https://issues.redhat.com/browse/USHIFT-932
|
||||||
|
|
||||||
|
Signed-off-by: Pablo Acevedo Montserrat <pacevedo@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/microshift.py | 9 +++++++--
|
||||||
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/microshift.py b/sos/report/plugins/microshift.py
|
||||||
|
index 953eb88e..69981d63 100644
|
||||||
|
--- a/sos/report/plugins/microshift.py
|
||||||
|
+++ b/sos/report/plugins/microshift.py
|
||||||
|
@@ -86,9 +86,10 @@ class Microshift(Plugin, RedHatPlugin):
|
||||||
|
|
||||||
|
def _get_namespaces(self):
|
||||||
|
res = self.exec_cmd(
|
||||||
|
- 'microshift get namespaces'
|
||||||
|
+ 'oc get namespaces'
|
||||||
|
' -o custom-columns=NAME:.metadata.name'
|
||||||
|
- ' --no-headers')
|
||||||
|
+ ' --no-headers'
|
||||||
|
+ ' --kubeconfig=%s' % self.get_option('kubeconfig'))
|
||||||
|
if res['status'] == 0:
|
||||||
|
return self._reduce_namespace_list(res['output'].split('\n'))
|
||||||
|
return []
|
||||||
|
@@ -146,6 +147,10 @@ class Microshift(Plugin, RedHatPlugin):
|
||||||
|
which is used to retrieve all API resources from the cluster.
|
||||||
|
"""
|
||||||
|
self.add_forbidden_path('/var/lib/microshift')
|
||||||
|
+ self.add_cmd_output([
|
||||||
|
+ 'microshift version',
|
||||||
|
+ 'microshift show-config -m effective'
|
||||||
|
+ ])
|
||||||
|
|
||||||
|
_cluster_resources_to_collect = ",".join(
|
||||||
|
self._get_cluster_resources())
|
||||||
|
--
|
||||||
|
2.39.2
|
||||||
|
|
@ -0,0 +1,56 @@
|
|||||||
|
From e8dc0e55988b36d0476bcae741652208356f0f07 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Tue, 7 Mar 2023 10:10:33 +0100
|
||||||
|
Subject: [PATCH] [iprconfig] guard whole plugin by sg kmod predicate
|
||||||
|
|
||||||
|
Calling any iprconfig command loads 'sg' kernel module. So guard
|
||||||
|
collecting anything from the plugin by that kmod predicate.
|
||||||
|
|
||||||
|
Resolves: #3159
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/iprconfig.py | 13 ++++++++-----
|
||||||
|
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/iprconfig.py b/sos/report/plugins/iprconfig.py
|
||||||
|
index 6b4fb895..a304107f 100644
|
||||||
|
--- a/sos/report/plugins/iprconfig.py
|
||||||
|
+++ b/sos/report/plugins/iprconfig.py
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
# This plugin enables collection of logs for Power systems
|
||||||
|
|
||||||
|
import re
|
||||||
|
-from sos.report.plugins import Plugin, IndependentPlugin
|
||||||
|
+from sos.report.plugins import Plugin, IndependentPlugin, SoSPredicate
|
||||||
|
|
||||||
|
|
||||||
|
class IprConfig(Plugin, IndependentPlugin):
|
||||||
|
@@ -22,6 +22,13 @@ class IprConfig(Plugin, IndependentPlugin):
|
||||||
|
|
||||||
|
def setup(self):
|
||||||
|
|
||||||
|
+ show_ioas = self.collect_cmd_output(
|
||||||
|
+ "iprconfig -c show-ioas",
|
||||||
|
+ pred=SoSPredicate(self, kmods=['sg'])
|
||||||
|
+ )
|
||||||
|
+ if not show_ioas['status'] == 0:
|
||||||
|
+ return
|
||||||
|
+
|
||||||
|
self.add_cmd_output([
|
||||||
|
"iprconfig -c show-config",
|
||||||
|
"iprconfig -c show-alt-config",
|
||||||
|
@@ -35,10 +42,6 @@ class IprConfig(Plugin, IndependentPlugin):
|
||||||
|
"iprconfig -c dump"
|
||||||
|
])
|
||||||
|
|
||||||
|
- show_ioas = self.collect_cmd_output("iprconfig -c show-ioas")
|
||||||
|
- if not show_ioas['status'] == 0:
|
||||||
|
- return
|
||||||
|
-
|
||||||
|
devices = []
|
||||||
|
if show_ioas['output']:
|
||||||
|
p = re.compile('sg')
|
||||||
|
--
|
||||||
|
2.39.2
|
||||||
|
|
@ -0,0 +1,85 @@
|
|||||||
|
From d4d4d5509fe4f0e29260b33a1c51bf62297ef0b9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Tue, 7 Mar 2023 13:16:02 +0100
|
||||||
|
Subject: [PATCH 1/2] [cleaner] dont clean sys_tmp from final_path
|
||||||
|
|
||||||
|
When generating location of final tarball, apply cleaner obfuscation to
|
||||||
|
the filename but not to the tmp path itself. Otherwise
|
||||||
|
|
||||||
|
sos clean --keywords tmp
|
||||||
|
|
||||||
|
fails in attempt to move file to nonexisting /var/obfuscatedword0
|
||||||
|
directory.
|
||||||
|
|
||||||
|
Resolves: #3160
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/cleaner/__init__.py | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/cleaner/__init__.py b/sos/cleaner/__init__.py
|
||||||
|
index d3e32992..b8e4aafd 100644
|
||||||
|
--- a/sos/cleaner/__init__.py
|
||||||
|
+++ b/sos/cleaner/__init__.py
|
||||||
|
@@ -400,8 +400,9 @@ third party.
|
||||||
|
cf.write(checksum)
|
||||||
|
self.write_cleaner_log()
|
||||||
|
|
||||||
|
- final_path = self.obfuscate_string(
|
||||||
|
- os.path.join(self.sys_tmp, arc_path.split('/')[-1])
|
||||||
|
+ final_path = os.path.join(
|
||||||
|
+ self.sys_tmp,
|
||||||
|
+ self.obfuscate_string(arc_path.split('/')[-1])
|
||||||
|
)
|
||||||
|
shutil.move(arc_path, final_path)
|
||||||
|
arcstat = os.stat(final_path)
|
||||||
|
--
|
||||||
|
2.39.2
|
||||||
|
|
||||||
|
|
||||||
|
From 622a26ee2faff91df03532892ca386c39e36a5fe Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Tue, 7 Mar 2023 17:55:19 +0100
|
||||||
|
Subject: [PATCH 2/2] [tests] add a test covering #3160
|
||||||
|
|
||||||
|
Run the cleaner tests with obfuscating (also) "tmp" to cover files
|
||||||
|
handling under sys_tmp.
|
||||||
|
|
||||||
|
Related to: #3160
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
tests/cleaner_tests/existing_archive.py | 19 +++++++++++++++++++
|
||||||
|
1 file changed, 19 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/tests/cleaner_tests/existing_archive.py b/tests/cleaner_tests/existing_archive.py
|
||||||
|
index e13d1cae..7f31f88e 100644
|
||||||
|
--- a/tests/cleaner_tests/existing_archive.py
|
||||||
|
+++ b/tests/cleaner_tests/existing_archive.py
|
||||||
|
@@ -89,3 +89,22 @@ class ExistingArchiveCleanTest(StageTwoReportTest):
|
||||||
|
"""Ensure that the 'testuser1' user created at install is obfuscated
|
||||||
|
"""
|
||||||
|
self.assertFileNotHasContent('var/log/anaconda/journal.log', 'testuser1')
|
||||||
|
+
|
||||||
|
+class ExistingArchiveCleanTmpTest(StageTwoReportTest):
|
||||||
|
+ """Continuation of above tests which requires cleaning var / tmp keywords
|
||||||
|
+
|
||||||
|
+ Note that this copies heavily from the full_report_run test.
|
||||||
|
+
|
||||||
|
+ :avocado: tags=stagetwo
|
||||||
|
+ """
|
||||||
|
+
|
||||||
|
+ sos_cmd = '-v --keywords var,tmp,avocado --disable-parsers ip,ipv6,mac,username \
|
||||||
|
+ --no-update tests/test_data/%s.tar.xz' % ARCHIVE
|
||||||
|
+ sos_component = 'clean'
|
||||||
|
+
|
||||||
|
+ def test_sys_tmp_not_obfuscated(self):
|
||||||
|
+ """ Ensure that keywords var, tmp and avocado remains in the final archive
|
||||||
|
+ path despite they are parts of the --tmp-dir
|
||||||
|
+ """
|
||||||
|
+ self.assertTrue(self.archive.startswith(os.getenv('AVOCADO_TESTS_COMMON_TMPDIR')))
|
||||||
|
+
|
||||||
|
--
|
||||||
|
2.39.2
|
||||||
|
|
Loading…
Reference in new issue