From b8201a09eeb47b959eef4871330624295d6eea26 Mon Sep 17 00:00:00 2001 From: Sahid Orentino Ferdjaoui Date: Mon, 21 Oct 2019 10:48:40 +0200 Subject: [PATCH] Enable functional tests for train This patch also updates the smoke test to run train. Change-Id: I8f3a4b38571ab560564d135f69664c294820158e Signed-off-by: Sahid Orentino Ferdjaoui --- tests/basic_deployment.py | 13 +++++++++++-- tests/gate-basic-bionic-train | 25 +++++++++++++++++++++++++ tox.ini | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100755 tests/gate-basic-bionic-train diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 9b89906..1ce043d 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -113,8 +113,10 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment): ceph_config = { 'monitor-count': '3', - 'auth-supported': 'none', } + if self._get_openstack_release() < self.bionic_train: + ceph_config['auth-supported'] = 'none' + cinder_ceph_config = { 'ceph-osd-replication-count': '3', } @@ -327,6 +329,9 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment): 'ceph-public-address': u.valid_ip, 'auth': 'none', } + if self._get_openstack_release() >= self.bionic_train: + expected['auth'] = 'cephx' + ret = u.validate_relation_data(ceph_unit, relation, expected) if ret: msg = u.relation_error('cinder cinder-ceph storage-backend', ret) @@ -563,6 +568,9 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment): # 'log to syslog': 'false' } } + if self._get_openstack_release() >= self.bionic_train: + expected['global']['auth_supported'] = 'cephx' + for section, pairs in expected.iteritems(): ret = u.validate_config_data(unit, conf, section, pairs) if ret: @@ -714,11 +722,12 @@ class CinderCephBasicDeployment(OpenStackAmuletDeployment): all ceph units, and the cinder-ceph unit.""" u.log.debug('Checking exit values are 0 on ceph commands') sentry_units = [ - self.cinder_ceph_sentry, self.ceph0_sentry, self.ceph1_sentry, self.ceph2_sentry ] + if self._get_openstack_release() < self.bionic_train: + sentry_units.append(self.cinder_ceph_sentry) commands = [ 'sudo ceph health', 'sudo ceph mds stat', diff --git a/tests/gate-basic-bionic-train b/tests/gate-basic-bionic-train new file mode 100755 index 0000000..8698e91 --- /dev/null +++ b/tests/gate-basic-bionic-train @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# +# Copyright 2019 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-ceph deployment on bionic-train.""" + +from basic_deployment import CinderCephBasicDeployment + +if __name__ == '__main__': + deployment = CinderCephBasicDeployment(series='bionic', + openstack='cloud:bionic-train', + source='cloud:bionic-train') + deployment.run_tests() diff --git a/tox.ini b/tox.ini index ce4546b..b625434 100644 --- a/tox.ini +++ b/tox.ini @@ -105,7 +105,7 @@ basepython = python2.7 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-stein --no-destroy + bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-train --no-destroy [testenv:func-dev] # Charm Functional Test