diff --git a/zaza/charm_tests/ceph/__init__.py b/zaza/charm_tests/ceph/__init__.py index 2e8a46b..82909a0 100644 --- a/zaza/charm_tests/ceph/__init__.py +++ b/zaza/charm_tests/ceph/__init__.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Collection of code for setting up and testing ceph-osd.""" +"""Collection of code for setting up and testing ceph.""" diff --git a/zaza/charm_tests/ceph/osd/__init__.py b/zaza/charm_tests/ceph/osd/__init__.py new file mode 100644 index 0000000..2e8a46b --- /dev/null +++ b/zaza/charm_tests/ceph/osd/__init__.py @@ -0,0 +1,15 @@ +# Copyright 2018 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Collection of code for setting up and testing ceph-osd.""" diff --git a/zaza/charm_tests/ceph/osd/tests.py b/zaza/charm_tests/ceph/osd/tests.py new file mode 100644 index 0000000..feafbb8 --- /dev/null +++ b/zaza/charm_tests/ceph/osd/tests.py @@ -0,0 +1,49 @@ +# Copyright 2018 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Ceph-osd Testing.""" + +import logging +import unittest + +import zaza.charm_tests.test_utils as test_utils +import zaza.model as zaza_model + + +class SecurityTest(unittest.TestCase): + """Ceph Security Tests.""" + + @classmethod + def setUpClass(cls): + """Run class setup for running ceph security tests.""" + super(SecurityTest, cls).setUpClass() + + def test_osd_security_checklist(self): + """Verify expected state with security-checklist.""" + expected_failures = [] + expected_passes = [ + 'validate-file-ownership', + 'validate-file-permissions', + ] + + logging.info('Running `security-checklist` action' + ' on Ceph OSD leader unit') + test_utils.audit_assertions( + zaza_model.run_action_on_leader( + 'ceph-osd', + 'security-checklist', + action_params={}), + expected_passes, + expected_failures, + expected_to_pass=True) diff --git a/zaza/charm_tests/ceph/tests.py b/zaza/charm_tests/ceph/tests.py index 2a09fb6..270c89c 100644 --- a/zaza/charm_tests/ceph/tests.py +++ b/zaza/charm_tests/ceph/tests.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Ceph-osd Testing.""" +"""Ceph Testing.""" import logging from os import (