From 2223713525eec6c18fc5d0f20d05aa8ddc4eabb0 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 1 Dec 2016 11:12:46 -0600 Subject: [PATCH] tests: docker_cluster should run conf_tests This also makes the conf_tests take the subnet as input so multiple scenarios on differing subnets can use these tests. Signed-off-by: Andrew Schoen --- .../functional/centos/7/docker-cluster/scenario.py | 13 +++++++++++-- tests/functional/tests/mon/test_ceph_conf.py | 7 +++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/functional/centos/7/docker-cluster/scenario.py b/tests/functional/centos/7/docker-cluster/scenario.py index 4597b589f..31b12adf6 100644 --- a/tests/functional/centos/7/docker-cluster/scenario.py +++ b/tests/functional/centos/7/docker-cluster/scenario.py @@ -1,7 +1,8 @@ # Basic information about ceph and its configuration ceph = { 'releases': ['infernalis', 'jewel'], - 'cluster_name': 'ceph' + 'cluster_name': 'ceph', + 'subnet': '192.168.15', } # remote nodes to test, with anything specific to them that might be useful for @@ -10,7 +11,15 @@ ceph = { nodes = { 'mon0': { 'username': 'vagrant', - 'components': ['mon', 'mon_initial_members'] + 'components': ['conf_tests'] + }, + 'mon1': { + 'username': 'vagrant', + 'components': ['conf_tests'] + }, + 'mon2': { + 'username': 'vagrant', + 'components': ['conf_tests'] }, 'osd0': { 'username': 'vagrant', diff --git a/tests/functional/tests/mon/test_ceph_conf.py b/tests/functional/tests/mon/test_ceph_conf.py index 59b899bbd..ffe925a99 100644 --- a/tests/functional/tests/mon/test_ceph_conf.py +++ b/tests/functional/tests/mon/test_ceph_conf.py @@ -33,7 +33,10 @@ class TestMon(object): @uses_conf_tests def test_mon_host_line_has_correct_value(self, scenario_config): - cluster_name = scenario_config.get('ceph', {}).get('cluster_name', 'ceph') + config = scenario_config.get('ceph', {}) + cluster_name = config.get('cluster_name', 'ceph') ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name initial_members_line = self.get_line_from_config('mon host', ceph_conf_path) - assert initial_members_line == 'mon host = 192.168.9.10,192.168.9.11,192.168.9.12' + subnet = config.get('subnet', "192.168.9") + expected = 'mon host = {subnet}.10,{subnet}.11,{subnet}.12'.format(subnet=subnet) + assert initial_members_line == expected