diff --git a/.cirrus.yml b/.cirrus.yml index ffdcde13ba..6038229871 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -43,6 +43,8 @@ env: curl --fail --location -O --url https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID} + SUNBEAM_VER: "2024.1/beta" + # Default task timeout timeout_in: 30m @@ -343,3 +345,24 @@ report_foreman_task: on_failure: fail_script: *faillogs log_artifacts: *logs + +report_sunbeam_task: + skip: "!changesInclude('.cirrus.yml', '**/{__init__,sunbeam,sunbeam_hypervisor,kubernetes,microk8s,k8s,ovn_host}.py', '**/sunbeam_setup.sh')" + timeout_in: 90m + alias: "sunbeam_integration" + name: "Integration Test - Sunbeam ${SUNBEAM_VER} - ${BUILD_NAME}" + depends_on: stageone_report + gce_instance: &xbigvm + <<: *standardvm + type: e2-standard-4 + disk: 50 + environment: + SUNBEAM_VER: ${SUNBEAM_VER} + matrix: + - env: *ubuntuprior + setup_script: *setup + sunbeam_setup_script: ./tests/test_data/sunbeam_setup.sh + main_script: PYTHONPATH=tests/ avocado run -p TESTLOCAL=true --max-parallel-tasks=1 -t sunbeam tests/product_tests/sunbeam/ + on_failure: + fail_script: *faillogs + log_artifacts: *logs diff --git a/tests/product_tests/sunbeam/__init__.py b/tests/product_tests/sunbeam/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/product_tests/sunbeam/juju_tests.py b/tests/product_tests/sunbeam/juju_tests.py new file mode 100644 index 0000000000..39f3b216f1 --- /dev/null +++ b/tests/product_tests/sunbeam/juju_tests.py @@ -0,0 +1,88 @@ +# 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 StageOneReportTest + + +class JujuBasicTest(StageOneReportTest): + """Ensure that a basic execution runs as expected with simple deployment. + + :avocado: tags=sunbeam + """ + + sos_cmd = '-v -o juju' + arch = ['x86_64'] + + ubuntu_only = True + + def test_unit_agent_conf_collected(self): + self.assertFileCollected('/var/lib/juju/agents/machine-0/agent.conf') + self.assertFileCollected('/var/log/juju/machine-0.log') + +# def test_unit_commands_collected(self): +# cmds_to_check = [ +# 'juju_engine_report', +# 'juju_goroutines', +# 'juju_heap_profile', +# 'juju_leases', +# 'juju_metrics', +# 'juju_pubsub_report', +# 'juju_presence_report', +# 'juju_statepool_report', +# 'juju_statetracker_report', +# 'juju_unit_status', +# ] +# +# for the_cmd in cmds_to_check: +# self.assertFileCollected(f'sos_commands/juju/{the_cmd}') + + def test_unit_agent_conf_cert_scrubbed(self): + file = '/var/lib/juju/agents/machine-0/agent.conf' + + check_cert_scrub = [ + "cacert", + "controllercert", + ] + for cert in check_cert_scrub: + self.assertFileHasContent( + file, f'{cert}: |\n -----SCRUBBED CERTIFICATE-----') + + def test_unit_agent_conf_private_cert_scrubbed(self): + file = '/var/lib/juju/agents/machine-0/agent.conf' + check_priv_key = [ + "controllerkey", + "caprivatekey", + ] + for priv in check_priv_key: + self.assertFileHasContent( + file, f'{priv}: |\n -----SCRUBBED PRIVATE KEY-----') + + def test_unit_agent_conf_private_cert_rsa_scrubbed(self): + file = '/var/lib/juju/agents/machine-0/agent.conf' + check_priv_rsa_key = [ + "systemidentity", + ] + + for priv_rsa in check_priv_rsa_key: + self.assertFileHasContent( + file, f'{priv_rsa}: |\n -----SCRUBBED RSA PRIVATE KEY-----') + + def test_unit_agent_conf_secrets_scrubbed(self): + file = '/var/lib/juju/agents/machine-0/agent.conf' + + check_key_scrub = [ + "sharedsecret", + "apipassword", + "oldpassword", + "statepassword", + ] + + for key in check_key_scrub: + self.assertFileHasContent(file, rf'{key}: \*\*\*\*\*\*\*\*\*') + +# vim: et ts=4 sw=4 diff --git a/tests/product_tests/sunbeam/kubernetes_tests.py b/tests/product_tests/sunbeam/kubernetes_tests.py new file mode 100644 index 0000000000..d2007c59da --- /dev/null +++ b/tests/product_tests/sunbeam/kubernetes_tests.py @@ -0,0 +1,42 @@ +# 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 StageOneReportTest + + +class K8sBasicTest(StageOneReportTest): + """Ensure that a basic execution runs as expected with simple deployment. + + :avocado: tags=sunbeam + """ + + sos_cmd = '-v -o microk8s,kubernetes' + arch = ['x86_64'] + + ubuntu_only = True + + microk8s_cmd = "microk8s" + + def test_client_config_collected(self): + self.assertFileCollected( + '/var/snap/microk8s/current/credentials/client.config') + + def test_microk8s_cmd_ran(self): + ran_cmds = [ + f"{self.microk8s_cmd}_addons_repo_list", + f"{self.microk8s_cmd}_config", + f"{self.microk8s_cmd}_ctr_plugins_ls", + f"{self.microk8s_cmd}_ctr_plugins_ls_-d", + f"{self.microk8s_cmd}_status", + f"{self.microk8s_cmd}_version", + ] + for cmd_run in ran_cmds: + self.assertFileCollected(f'sos_commands/microk8s/{cmd_run}') + + +# vim: et ts=4 sw=4 diff --git a/tests/product_tests/sunbeam/sunbeam_tests.py b/tests/product_tests/sunbeam/sunbeam_tests.py new file mode 100644 index 0000000000..bf6e82bda8 --- /dev/null +++ b/tests/product_tests/sunbeam/sunbeam_tests.py @@ -0,0 +1,116 @@ +# 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 StageOneReportTest + + +class SunbeamBasicTest(StageOneReportTest): + """Ensure that a basic execution runs as expected with simple deployment. + + :avocado: tags=sunbeam + """ + + sos_cmd = '-v' + arch = ['x86_64'] + + ubuntu_only = True + sos_timeout = 1200 + + sunbeam_common = "/var/snap/openstack/common" + sunbeam_current = "/var/snap/openstack/current" + + hypervisor_common = "/var/snap/openstack-hypervisor/common" + + check_obfuscate = [ + r"transport_url = \*\*\*\*\*\*\*\*\*", + r"password = \*\*\*\*\*\*\*\*\*", + ] + + def test_plugins_ran(self): + self.assertPluginIncluded([ + 'juju', + 'libvirt', + 'kubernetes', + 'ovn_host', + 'sunbeam', + 'sunbeam_hypervisor', + ]) + + def test_sunbeam_keys_skipped(self): + self.assertFileGlobNotInArchive( + f"{self.hypervisor_common}/etc/pki/**/*.pem") + self.assertFileGlobNotInArchive( + f"{self.hypervisor_common}/etc/ssl/**/*.pem") + + def test_sunbeam_installer_dirs_collected(self): + self.assertFileGlobInArchive("/etc/sunbeam-installer/*") + self.assertFileGlobInArchive("/var/log/sunbeam-installer/*") + + def test_sunbeam_openstack_config_files_collected(self): + files_collected = [ + f'{self.sunbeam_common}/state/daemon.yaml', + f'{self.sunbeam_common}/state/database/info.yaml', + f'{self.sunbeam_common}/state/database/cluster.yaml', + f'{self.sunbeam_current}/config.yaml', + ] + for file in files_collected: + self.assertFileCollected(file) + + def test_sunbeam_nova_log_collected(self): + self.assertFileCollected( + f'{self.hypervisor_common}/var/log/nova/nova.log') + + def test_sunbeam_neutron_log_collected(self): + self.assertFileCollected( + f'{self.hypervisor_common}/var/log/neutron/neutron.log') + + def test_sunbeam_ovn_controller_log_collected(self): + self.assertFileCollected( + f'{self.hypervisor_common}/var/log/ovn/ovn-controller.log') + + def test_sunbeam_openvswitch_log_collected(self): + self.assertFileCollected( + f'{self.hypervisor_common}/var/log/openvswitch/ovs-vswitchd.log') + self.assertFileCollected( + f'{self.hypervisor_common}/var/log/openvswitch/ovsdb-server.log') + + def test_sunbeam_cluster_list_collected_(self): + self.assertFileCollected('sos_commands/sunbeam/sunbeam_cluster_list') + + def test_sunbeam_juju_configs_controller_collected(self): + files_collected = [ + 'juju_status_-m_sunbeam-controller_admin.controller', + 'juju_model-config_-m_sunbeam-controller_admin.controller', + ] + + for file in files_collected: + self.assertFileCollected(f'sos_commands/sunbeam/sunbeam/{file}') + + def test_sunbeam_nova_conf_collected_and_obfuscated(self): + nova_conf = f'{self.hypervisor_common}/etc/nova/nova.conf' + self.assertFileCollected(nova_conf) + + for check in self.check_obfuscate: + self.assertFileHasContent(nova_conf, check) + + def test_sunbeam_neutron_conf_collected_and_obfuscated(self): + neutron_conf = f'{self.hypervisor_common}/etc/neutron/neutron.conf' + self.assertFileCollected(neutron_conf) + + for check in self.check_obfuscate: + self.assertFileHasContent(neutron_conf, check) + + def test_sunbeam_ceilometer_conf_collected_and_obfuscated(self): + ceilometer_conf = (f'{self.hypervisor_common}/etc/ceilometer/' + 'ceilometer.conf') + self.assertFileCollected(ceilometer_conf) + + for check in self.check_obfuscate: + self.assertFileHasContent(ceilometer_conf, check) + +# vim: et ts=4 sw=4 diff --git a/tests/report_tests/plugin_tests/juju/agent.conf b/tests/report_tests/plugin_tests/juju/agent.conf deleted file mode 100644 index 10719157df..0000000000 --- a/tests/report_tests/plugin_tests/juju/agent.conf +++ /dev/null @@ -1,219 +0,0 @@ -# format 2.0 -tag: machine-0 -datadir: /var/lib/juju -transient-datadir: /var/run/juju -logdir: /var/log/juju -metricsspooldir: /var/lib/juju/metricspool -nonce: user-admin:bootstrap -jobs: -- JobManageModel -- JobHostUnits -upgradedToVersion: 2.9.47 -cacert: | - -----BEGIN CERTIFICATE----- - MIIEEjCCAnqgAwIBAgIUXRUjAHgO+z8hifta518W/MvxZ9gwDQYJKoZIhvcNAQEL - BQAwITENMAsGA1UEChMESnVqdTEQMA4GA1UEAxMHanVqdS1jYTAeFw0yNDAyMDYx - MTUxNTNaFw0zNDAyMDYxMTU2NTNaMCExDTALBgNVBAoTBEp1anUxEDAOBgNVBAMT - B2p1anUtY2EwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQCfDj2vFQls - DlV4C7uObnHcmkdCve8Bn8Bqjov+GtTsnfdqidVUKbImQbWiagaBPTP2uuwHo7ak - 2zp7ZrP3TRmgsUSIx6O+OEUqWPQ6cqZ4D2rB8iWuHzTLcT/pUo60g3ydwtKwcgcx - /4x2ioy/j5D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lE -controller: controller-c9d714f0-cf40-4c6b-84e9-9ec47192312f -model: model-fea00f63-88b5-4a54-804c-59882170d3a6 -apiaddresses: -- 10.28.18.119:17070 -apipassword: cR97RRZheQgiLDrnkGxp8mlE -oldpassword: 111512798b7abbd4c2884e4de83d7989 -loggingconfig: =INFO -values: - AGENT_SERVICE_NAME: jujud-machine-0 - CONTAINER_TYPE: "" - NUMA_CTL_PREFERENCE: "false" - PROVIDER_TYPE: lxd -agent-logfile-max-size: 100 -agent-logfile-max-backups: 2 -controllercert: | - -----BEGIN CERTIFICATE----- - MIIEfjCCAuagAwIBAgIVANVl9irudWew6MVfGuzX85+5nW/OMA0GCSqGSIb3DQEB - CwUAMCExDTALBgNVBAoTBEp1anUxEDAOBgNVBAMTB2p1anUtY2EwHhcNMjQwMjA2 - MTE1MjQwWhcNMzQwMjA2MTE1NzQwWjBtMQ0wCwYDVQQKEwRKdWp1MS0wKwYDVQQD - EyRKdWp1IHNlcnZlciBjZXJ0aWZpY2F0ZSAtIGNvbnRyb2xsZXIxLTArBgNVBAUT - JDQ3YmNiNzQ5LWYxYTUtNDBhMS04NWVmLTE5OTM3N2FjMGNiYTCCAaIwDQYJKoZI - hvcNAQEBBQADggGPADCCAYoCggGBALzpvEWdgNgWyyBYOShQ/3ZAzESaMevycKXz - GnA86uw7keVxq4vqdzWp4wleOA1ZJ+W+Rm9xF8wXzdqz7i73zYa90qtKkies0faE - 1/OsMO0IbKH8YEYmxleV5sRyl/+jB/kPuXOr3HbQ/5Gay7pUwdh+XkKK1WJWwaS4 - Ve7d7WnuSNAbKXGyqbil0/8dpNIFv4X9k3WENDRamo7KREJtfHkKjFgdTS4PfVWb - BCZJhcE/JzE/FQ6/mwoa6tFySfwp0dyndKtVmRp/Egf2NCfCjCywfYqZgYCfenba - 2RnvxrFBaPgHghDbrl65+ccOoPaf2aOimOx0C/zHbysOPHc0w1XYfvZTrsffVvw1 - O6+MjC/QhjbVppwJUTNR6oYb3OiFrnhzZ65B1Rk/cZv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AYC6mnytqR1/EqRr4WJdt - sTvpBzqlcwzUZUAE/XsgIifXpMMsrtmlCKBQOu2kr0p7Fr4kZX2ZJvcrYIWdLddY - EB+ZKAkbUOMtPnhcFnZImnvxy658IPxGxr1ZoigInbnRr13h5/g= - -----END CERTIFICATE----- -controllerkey: | - -----BEGIN PRIVATE KEY----- - MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQC86bxFnYDYFssg - WDkoUP92QMxEmjHr8nCl8xpwPOrsO5HlcauL6nc1qeMJXjgNWSflvkZvcRfMF83a - s+4u982GvdKrSpInrNH2hNfzrDDtCGyh/GBGJsZXlebEcpf/owf5D7lzq9x20P+R - msu6VMHYfl5CitViVsGkuFXu3e1p7kjQGylxsqm4pdP/HaTSBb+F/ZN1q340WpqO - ykRCbXx5CoxYHU0uD31VmwQmSYXBPycxPxUOv5sKGurRckn8KdHcp3SrVZkafxIH - 9jQnwowssH2KmYGAn3p22tkZ78axQWj4B4IQ265eufnHDqD2n9mjopjsdAv8x28r - Djx3NMNV2H72U67H31b8NTuvjIwv0IY21aacCVEzUeqGG9zoha54c2euQdUZP3Gb - 7AZzANo1x7kApq0I7il/XGfR/R239SzQQd19X7wdA+EeW8aw61Dle8WeH+vjllLp - +e7GL2Ysgxxs6Pern4rrxxo7IsluwT0BYgpZ78rAb6sfpGLCtpcCAwEAAQKCAYBZ - 0qUTUK1nkYbpjSk4MzMUTgESCWL9Nhw7u5hxj3V/918Kgn63mzctS+bImIT8S8z9 - nvgsmtBe2V6mw3DX4jlV/MHDckSGGtUGaumnUdM9kQjeCHraQCuEj6DW/UmqYiEz - WjeqeSftUriByeFealh1ELjO2OZWyLtwD7nERr9Q49y5HoEZL4MlaaugHL82oUcM - daJ8i5sJV58vj5rfHuHVR5+tcdk1smW8o2VYsxKm7Nk8wCrKBW65Yk0OY1IsVNFE - AEKIALNylRmAfBSftE3ztaze3fqz1ywSRe3Z+Zrfv5QQjOfFoAXdMRqOKSvHKErT - 9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BgDWeSP1vEPT+cs7mlWirF/zSx7JRX2846OiabYMa - OePH9B7Ug29rlDsn0h0jt0cd2FhYTFnW4NbCUDSY0lFkTvCCLQeIvvIZIh/pUwoL - Fx+8djo+q9dA+T/wYiy0iw603N+joz6tWiRfwz2LG3gbyVL+zR78yz9Bv4JIOPEu - LIwbAoGBAI8Nx9UcD3vy4Q8PkI6FN/GLN+rPwl9vOfeGEIdU/nH21JaJi287U2G3 - zEEzX4rY3dmLtEs3r2TMQwRUkmm9846iorjgxi+K+5zVtM7SK/TXqUDaJ9tCGtcX - L/x36ewmw1rsKYlFI5X/6qM6n5DIKU+IJGNj5VSYb1u3Q7TZZ1yF - -----END RSA PRIVATE KEY----- -mongoversion: 4.4.18/wiredTiger -mongomemoryprofile: default -juju-db-snap-channel: 4.4/stable diff --git a/tests/report_tests/plugin_tests/juju/juju.py b/tests/report_tests/plugin_tests/juju/juju.py deleted file mode 100644 index 717e69c652..0000000000 --- a/tests/report_tests/plugin_tests/juju/juju.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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', - 'EB+ZKAkbUOMtPnhcFnZImnvxy658IPxGxr1ZoigInbnRr13h5/g=', - 'BjEUrba1VcDLW3fJQOxTH7R7wzM1bbu2p8R2ZnfUAWNXjr+mHuMc3mCnkEFL/X+/', - 'EB+ZKAkbUOMtPnhcFnZImnvxy658IPxGxr1ZoigInbnRr13h5/g=', - 'MK5DNKHKNIynw+tXbuJ2pQ==', - 'gGizOraTiFeIuvHMD3KATTLc', - 'L/x36ewmw1rsKYlFI5X/6qM6n5DIKU+IJGNj5VSYb1u3Q7TZZ1yF', - ] - for text in check_text_scrub: - self.assertFileNotHasContent( - '/var/lib/juju/agents/machine-0/agent.conf', text) diff --git a/tests/test_data/sunbeam_setup.sh b/tests/test_data/sunbeam_setup.sh new file mode 100755 index 0000000000..e804ca7596 --- /dev/null +++ b/tests/test_data/sunbeam_setup.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +SUCCESS=0 + +if grep -iq ubuntu /etc/os-release; then + sudo snap install openstack --channel $SUNBEAM_VER + sudo sunbeam prepare-node-script | sudo -u ubuntu bash -x + sudo -u ubuntu -- sunbeam cluster bootstrap --accept-defaults && SUCCESS=1 +fi + +if [[ $SUCCESS != 1 ]]; then + echo "Setup failed" + exit 1 +fi diff --git a/tox.ini b/tox.ini index e195261336..62916da4ea 100644 --- a/tox.ini +++ b/tox.ini @@ -19,6 +19,8 @@ py_files = setup.py plugins_overview.py sos tests foreman_tests = {toxinidir}/tests/product_tests/foreman +sunbeam_tests = + {toxinidir}/tests/product_tests/sunbeam [testenv:flake8] deps = flake8 @@ -51,6 +53,11 @@ basepython = python3 commands = {[testenv]avocado_cmd} -t foreman {posargs:{[testenv]foreman_tests}} +[testenv:sunbeam_tests] +basepython = python3 +commands = + {[testenv]avocado_cmd} -t sunbeam {posargs:{[testenv]sunbeam_tests}} + [testenv:nosetests] basepython = python3 deps =