charm-manila-ganesha/unit_tests/test_manila_ganesha_handlers.py
Seyeong Kim 6bdf6382d8
Use client cert for keystone-identity
When manila-ganesha is related to vault it needs a client cert to
configure the keystone-auth section of manila.conf to communicate with
keystone. This patch sets that up and removes the broken server cert
auto configuration which ended up masking the manila-share service.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1253
Change-Id: I55e9aa09b88684517d4052dc56eed0cab05a0262
Closes-Bug: #2064487
2024-10-07 08:02:59 +00:00

77 lines
3.3 KiB
Python

# 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.
# import json
# import mock
# import charm.openstack.manila_ganesha as manila_ganesha
import reactive.manila_ganesha as handlers
import charms_openstack.test_utils as test_utils
class TestRegisteredHooks(test_utils.TestRegisteredHooks):
def test_hooks(self):
defaults = [
'charm.installed',
'amqp.connected',
'shared-db.connected',
'config.changed',
'update-status',
'upgrade-charm',
'certificates.available',
]
hook_set = {
'when': {
'ceph_connected': ('ceph.connected',),
'setup_manila': ('manila-plugin.available',),
'configure_ident_username': ('identity-service.connected',),
'render_things': ('ceph.available',
'amqp.available',
'manila-plugin.available',
'shared-db.available',
'identity-service.available'),
'cluster_connected': ('ha.connected',
'ganesha-pool-configured',
'config.rendered',),
'enable_services_in_non_ha': ('config.rendered',
'ganesha-pool-configured',),
'disable_services': ('cluster.connected',),
'configure_nrpe': ('nrpe-external-master.available',),
'update_ident_username': ('config.changed.service-user',
'identity-service.connected',),
'install_root_ca_cert': ('certificates.ca.available',),
'set_client_cert_request': ('certificates.available',),
'update_client_cert': ('certificates.certs.available',),
},
'when_not': {
'ceph_connected': ('ganesha-pool-configured',),
'configure_ident_username': ('identity-service.available',),
'configure_ganesha': ('ganesha-pool-configured',),
'enable_services_in_non_ha': ('cluster.connected',
'services-started',),
'cluster_connected': ('ha-resources-exposed',),
'disable_services': ('services-disabled',),
'remove_nrpe': ('nrpe-external-master.available',),
},
'when_all': {
'configure_ganesha': ('config.rendered',
'ceph.pools.available',),
},
}
# test that the hooks were registered via the
# reactive.manila_ganesha_handlers
self.registered_hooks_test_helper(handlers, hook_set, defaults)