]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: docker_cluster should run conf_tests
authorAndrew Schoen <aschoen@redhat.com>
Thu, 1 Dec 2016 17:12:46 +0000 (11:12 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 1 Dec 2016 18:18:01 +0000 (12:18 -0600)
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>
tests/functional/centos/7/docker-cluster/scenario.py
tests/functional/tests/mon/test_ceph_conf.py

index 4597b589fc29ab669f8f1f388bb105f2d45ce413..31b12adf633b376ef9c84e3b131e9ed5b19993ca 100644 (file)
@@ -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',
index 59b899bbd8ba58ad1b9f523a7d42bdf1a52695af..ffe925a99d468b0540dfcc9aabda9111bddd284b 100644 (file)
@@ -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