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 <aschoen@redhat.com>
pull/1138/head
Andrew Schoen 2016-12-01 11:12:46 -06:00
parent 7abbab820e
commit 2223713525
2 changed files with 16 additions and 4 deletions

View File

@ -1,7 +1,8 @@
# Basic information about ceph and its configuration # Basic information about ceph and its configuration
ceph = { ceph = {
'releases': ['infernalis', 'jewel'], '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 # remote nodes to test, with anything specific to them that might be useful for
@ -10,7 +11,15 @@ ceph = {
nodes = { nodes = {
'mon0': { 'mon0': {
'username': 'vagrant', 'username': 'vagrant',
'components': ['mon', 'mon_initial_members'] 'components': ['conf_tests']
},
'mon1': {
'username': 'vagrant',
'components': ['conf_tests']
},
'mon2': {
'username': 'vagrant',
'components': ['conf_tests']
}, },
'osd0': { 'osd0': {
'username': 'vagrant', 'username': 'vagrant',

View File

@ -33,7 +33,10 @@ class TestMon(object):
@uses_conf_tests @uses_conf_tests
def test_mon_host_line_has_correct_value(self, scenario_config): 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 ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name
initial_members_line = self.get_line_from_config('mon host', ceph_conf_path) 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