aboutsummaryrefslogtreecommitdiffstats
path: root/tests/report_tests/plugin_tests/juju/juju.py
diff options
context:
space:
mode:
authorArif Ali <arif.ali@canonical.com>2024-04-22 09:02:46 +0100
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2024-05-01 14:09:21 -0400
commit0a876d47196bf9738b4d14509b593583f59c7e3a (patch)
treed3393349cdc86633e8a79c566ed2a24579d3dead /tests/report_tests/plugin_tests/juju/juju.py
parent782889258497025e84a28cd14834ce1d9a6dbfbd (diff)
downloadsos-0a876d47196bf9738b4d14509b593583f59c7e3a.tar.gz
[tests] Add some tests for netplan and juju
Signed-off-by: Arif Ali <arif.ali@canonical.com>
Diffstat (limited to 'tests/report_tests/plugin_tests/juju/juju.py')
-rw-r--r--tests/report_tests/plugin_tests/juju/juju.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/report_tests/plugin_tests/juju/juju.py b/tests/report_tests/plugin_tests/juju/juju.py
new file mode 100644
index 00000000..3f4e3347
--- /dev/null
+++ b/tests/report_tests/plugin_tests/juju/juju.py
@@ -0,0 +1,40 @@
+# This file is part of the sos project: https://github.com/sosreport/sos
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# version 2 of the GNU General Public License.
+#
+# See the LICENSE file in the source distribution for further information.
+
+from sos_tests import StageTwoReportTest
+
+
+class JujuAgentConfScrubbedTest(StageTwoReportTest):
+ """Ensure that agent conf is picked up and properly scrubbed
+
+ :avocado: tags=stagetwo
+ """
+
+ sos_cmd = '-o juju'
+ ubuntu_only = True
+ files = [('agent.conf', '/var/lib/juju/agents/machine-0/agent.conf')]
+
+ def test_unit_agent_conf_collected(self):
+ self.assertFileCollected('/var/lib/juju/agents/machine-0/agent.conf')
+
+ def test_unit_agent_conf_scrubbed(self):
+ # Ensure that we scrubbed all passwords/secrets and the certificates
+ check_text_scrub = [
+ 'cR97RRZheQgiLDrnkGxp8mlE',
+ '111512798b7abbd4c2884e4de83d7989',
+ 'FaIBoxLXcbn6RghOnbZBh0r7v8a8PTdQWJ9fG5ey6OJLjTSd/Fk8',
+ 'MIIEEjCCAnqgAwIBAgIUXRUjAHgO+z8hifta518W/MvxZ9gwDQYJKoZIhvcNAQEL',
+ 'MIIEfjCCAuagAwIBAgIVANVl9irudWew6MVfGuzX85+5nW/OMA0GCSqGSIb3DQEB',
+ 'MIIEEjCCAnqgAwIBAgIUXRUjAHgO+z8hifta518W/MvxZ9gwDQYJKoZIhvcNAQEL',
+ 'MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQC86bxFnYDYFssg',
+ 'MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQCfDj2vFQlsDlV4',
+ 'MIIEowIBAAKCAQEAsQmlk3a4OBmBNSy43bl66+rX+5sTsu+2yO93E/iGuzmGqX0t',
+ ]
+ for text in check_text_scrub:
+ self.assertFileNotHasContent(
+ '/var/lib/juju/agents/machine-0/agent.conf', text)