Added default value for allowed_direct_url_schemes

Included 'allowed_direct_url_schemes' in driver options of
cinder configuration with a default value of 'cinder'
Also, added to unit test and functional test as part of change.

- modified cinder_purestorage.py
- modified tests_cinder_purestorage.py to include a functional test
- modified test_lib_charm_openstack_cinder_purestorage.py to
  extend the unit tests

- rebased

Closes-Bug: #1957848
Change-Id: I26a033b03f6d03fa5e68d9e26aa741c6529ecac2
This commit is contained in:
nishant-dash 2022-09-23 14:19:24 +04:00
parent f004c6a228
commit ee5c5d92d8
No known key found for this signature in database
GPG Key ID: 795977A4FC3A2A31
3 changed files with 16 additions and 2 deletions

View File

@ -37,7 +37,8 @@ class CinderpurestorageCharm(
('pure_automatic_max_oversubscription_ratio',
self.config.get('automatic-max-oversubscription')),
('volume_driver', volumedriver),
('volume_backend_name', service)]
('volume_backend_name', service),
('allowed_direct_url_schemes', 'cinder')]
if self.config.get('protocol') == 'iscsi':
if self.config.get('iscsi-cidr'):

View File

@ -50,3 +50,15 @@ class CinderpurestorageTest(test_utils.OpenStackBaseTest):
getattr(test_vol, 'os-vol-host-attr:host').split('#')[0],
'cinder@cinder-purestorage')
self.cinder_client.volumes.delete(vol_new)
# Check to see if allowed_direct_url_schemes gets propagated to
# /etc/cinder/cinder.conf
def test_config_propagation(self):
expected_contents = {
'cinder-purestorage': {
'allowed_direct_url_schemes': ['cinder']}}
zaza.model.block_until_oslo_config_entries_match(
'cinder',
'/etc/cinder/cinder.conf',
expected_contents,
model_name=self.model_name)

View File

@ -51,4 +51,5 @@ class TestCinderpurestorageCharm(test_utils.PatchHelper):
('pure_automatic_max_oversubscription_ratio',
None),
('volume_driver', None),
('volume_backend_name', None)])
('volume_backend_name', None),
('allowed_direct_url_schemes', 'cinder')])