From b88447c7c678703355bc827ded47d7cdd2e64a37 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Fri, 9 Nov 2018 11:55:46 +0100 Subject: [PATCH] Add setup and test code for barbican-vault --- zaza/charm_tests/barbican_vault/__init__.py | 15 ++++++++++ zaza/charm_tests/barbican_vault/tests.py | 33 +++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 zaza/charm_tests/barbican_vault/__init__.py create mode 100644 zaza/charm_tests/barbican_vault/tests.py diff --git a/zaza/charm_tests/barbican_vault/__init__.py b/zaza/charm_tests/barbican_vault/__init__.py new file mode 100644 index 0000000..90a70e6 --- /dev/null +++ b/zaza/charm_tests/barbican_vault/__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 barbican-vault.""" diff --git a/zaza/charm_tests/barbican_vault/tests.py b/zaza/charm_tests/barbican_vault/tests.py new file mode 100644 index 0000000..0684c77 --- /dev/null +++ b/zaza/charm_tests/barbican_vault/tests.py @@ -0,0 +1,33 @@ +# 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. + +"""Encapsulate barbican-vault testing.""" + +import zaza +import zaza.charm_tests.vault.tests as vault_tests + + +class BarbicanVaultUnsealVault(vault_tests.UnsealVault): + """Helper class to unseal Vault and update deploy status expectations.""" + + @classmethod + def setUpClass(cls): + """Run setup for UnsealVault class.""" + super(BarbicanVaultUnsealVault, cls).setUpClass() + + def test_unseal(self): + """Unseal vault, update barbican-vault deploy status expectations.""" + test_config = zaza.charm_lifecycle.utils.get_charm_config() + del test_config['target_deploy_status']['barbican-vault'] + super().test_unseal(test_config)