Enable bionic/stein and disco/stein functional tests
Update name of ``backup_driver`` for Stein and onwards, reflecting changes of how Oslo library now does import of drivers. Change-Id: Icb050254488437bd1635fbe73b564238869e3421
This commit is contained in:
@@ -42,7 +42,10 @@ class CephBackupSubordinateContext(OSContextGenerator):
|
|||||||
raise Exception("Unsupported version of Openstack")
|
raise Exception("Unsupported version of Openstack")
|
||||||
|
|
||||||
service = service_name()
|
service = service_name()
|
||||||
backup_driver = 'cinder.backup.drivers.ceph'
|
if CompareOpenStackReleases(release) >= "stein":
|
||||||
|
backup_driver = 'cinder.backup.drivers.ceph.CephBackupDriver'
|
||||||
|
else:
|
||||||
|
backup_driver = 'cinder.backup.drivers.ceph'
|
||||||
return {
|
return {
|
||||||
"cinder": {
|
"cinder": {
|
||||||
"/etc/cinder/cinder.conf": {
|
"/etc/cinder/cinder.conf": {
|
||||||
|
@@ -335,9 +335,13 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
|
|||||||
unit = self.cinder_backup_sentry
|
unit = self.cinder_backup_sentry
|
||||||
relation = ['backup-backend', 'cinder:backup-backend']
|
relation = ['backup-backend', 'cinder:backup-backend']
|
||||||
|
|
||||||
|
if self._get_openstack_release() >= self.bionic_stein:
|
||||||
|
backup_driver = 'cinder.backup.drivers.ceph.CephBackupDriver'
|
||||||
|
else:
|
||||||
|
backup_driver = 'cinder.backup.drivers.ceph'
|
||||||
sub = ('{"cinder": {"/etc/cinder/cinder.conf": {"sections": '
|
sub = ('{"cinder": {"/etc/cinder/cinder.conf": {"sections": '
|
||||||
'{"DEFAULT": ['
|
'{"DEFAULT": ['
|
||||||
'["backup_driver", "cinder.backup.drivers.ceph"], '
|
'["backup_driver", "'+backup_driver+'"], '
|
||||||
'["backup_ceph_conf", '
|
'["backup_ceph_conf", '
|
||||||
'"/var/lib/charm/cinder-backup/ceph.conf"], '
|
'"/var/lib/charm/cinder-backup/ceph.conf"], '
|
||||||
'["backup_ceph_pool", "cinder-backup"], '
|
'["backup_ceph_pool", "cinder-backup"], '
|
||||||
@@ -495,6 +499,11 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
|
|||||||
unit_mq = self.rabbitmq_sentry
|
unit_mq = self.rabbitmq_sentry
|
||||||
rel_mq_ci = unit_mq.relation('amqp', 'cinder:amqp')
|
rel_mq_ci = unit_mq.relation('amqp', 'cinder:amqp')
|
||||||
|
|
||||||
|
if self._get_openstack_release() >= self.bionic_stein:
|
||||||
|
backup_driver = 'cinder.backup.drivers.ceph.CephBackupDriver'
|
||||||
|
else:
|
||||||
|
backup_driver = 'cinder.backup.drivers.ceph'
|
||||||
|
|
||||||
expected = {
|
expected = {
|
||||||
'DEFAULT': {
|
'DEFAULT': {
|
||||||
'use_syslog': 'False',
|
'use_syslog': 'False',
|
||||||
@@ -505,7 +514,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
|
|||||||
'auth_strategy': 'keystone',
|
'auth_strategy': 'keystone',
|
||||||
'volumes_dir': '/var/lib/cinder/volumes',
|
'volumes_dir': '/var/lib/cinder/volumes',
|
||||||
'enabled_backends': 'cinder-ceph',
|
'enabled_backends': 'cinder-ceph',
|
||||||
'backup_driver': 'cinder.backup.drivers.ceph',
|
'backup_driver': backup_driver,
|
||||||
'backup_ceph_pool': 'cinder-backup',
|
'backup_ceph_pool': 'cinder-backup',
|
||||||
'backup_ceph_user': 'cinder-backup'
|
'backup_ceph_user': 'cinder-backup'
|
||||||
},
|
},
|
||||||
|
23
tests/dev-basic-disco-stein
Executable file
23
tests/dev-basic-disco-stein
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# Copyright 2016 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.
|
||||||
|
|
||||||
|
"""Amulet tests on a basic cinder-backup deployment on disco-stein."""
|
||||||
|
|
||||||
|
from basic_deployment import CinderBackupBasicDeployment
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
deployment = CinderBackupBasicDeployment(series='disco')
|
||||||
|
deployment.run_tests()
|
25
tests/gate-basic-bionic-stein
Executable file
25
tests/gate-basic-bionic-stein
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# Copyright 2016 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.
|
||||||
|
|
||||||
|
"""Amulet tests on a basic cinder backup deployment on bionic-stein."""
|
||||||
|
|
||||||
|
from basic_deployment import CinderBackupBasicDeployment
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
deployment = CinderBackupBasicDeployment(series='bionic',
|
||||||
|
openstack='cloud:bionic-stein',
|
||||||
|
source='cloud:bionic-stein')
|
||||||
|
deployment.run_tests()
|
@@ -46,6 +46,20 @@ class TestCinderBackupContext(CharmTestCase):
|
|||||||
('backup_ceph_user',
|
('backup_ceph_user',
|
||||||
'cinder-backup-ut')]}}}}
|
'cinder-backup-ut')]}}}}
|
||||||
self.assertEqual(ctxt, exp)
|
self.assertEqual(ctxt, exp)
|
||||||
|
self.get_os_codename_package.return_value = 'stein'
|
||||||
|
exp = {'cinder': {'/etc/cinder/cinder.conf':
|
||||||
|
{'sections': {'DEFAULT':
|
||||||
|
[('backup_driver',
|
||||||
|
'cinder.backup.drivers.ceph.'
|
||||||
|
'CephBackupDriver'),
|
||||||
|
('backup_ceph_conf',
|
||||||
|
'/var/lib/charm/'
|
||||||
|
'cinder-backup-ut/ceph.conf'),
|
||||||
|
('backup_ceph_pool',
|
||||||
|
'cinder-backup-ut'),
|
||||||
|
('backup_ceph_user',
|
||||||
|
'cinder-backup-ut')]}}}}
|
||||||
|
self.assertEqual(contexts.CephBackupSubordinateContext()(), exp)
|
||||||
|
|
||||||
def test_backup_context_unsupported(self):
|
def test_backup_context_unsupported(self):
|
||||||
self.get_os_codename_package.return_value = 'havana'
|
self.get_os_codename_package.return_value = 'havana'
|
||||||
|
Reference in New Issue
Block a user