From dd81ee98dd447b95737a0c31bc4047165d6b9a6a Mon Sep 17 00:00:00 2001 From: Andrey Grebennikov Date: Wed, 10 Oct 2018 18:01:15 -0500 Subject: [PATCH] Added Keystone restart service test Modifies the config of Keystone and makes sure that Apache has been restarted. --- zaza/charm_tests/keystone/tests.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/zaza/charm_tests/keystone/tests.py b/zaza/charm_tests/keystone/tests.py index ba0617bf4..f2fea5cf9 100644 --- a/zaza/charm_tests/keystone/tests.py +++ b/zaza/charm_tests/keystone/tests.py @@ -53,6 +53,29 @@ def test_pause_resume(self): """ self.pause_resume(['apache2']) + def test_config_change_restart(self): + """Change disk format and check. + + Change debug mode and assert then change propagates to the correct + file and that services are restarted as a result + """ + # Expected default and alternate values + set_default = { + 'debug': 'False'} + set_alternate = {'debug': 'True'} + + # Config file affected by juju set config change + conf_file = '/etc/keystone/keystone.conf' + + # Make config change, check for service restarts + logging.debug('Setting debug mode keystone...') + self.restart_on_changed( + conf_file, + set_default, + set_alternate, + {'DEFAULT': {'debug': 'False'}}, + {'DEFAULT': {'debug': 'True'}}, ['apache2']) + def test_key_distribution_and_rotation(self): """Verify key rotation.