mirror of https://github.com/ceph/ceph-ansible.git
tests: remove test files that are not used anymore
These tests have been replaced by the ones in test_install.py Signed-off-by: Andrew Schoen <aschoen@redhat.com>pull/1150/head
parent
20f6831f8b
commit
0e7133cfd0
|
@ -1,42 +0,0 @@
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uses_conf_tests = pytest.mark.skipif(
|
|
||||||
'conf_tests' not in pytest.config.slaveinput['node_config']['components'],
|
|
||||||
reason="only run in monitors configured with initial_members"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TestMon(object):
|
|
||||||
|
|
||||||
def get_line_from_config(self, string, conf_path):
|
|
||||||
with open(conf_path) as ceph_conf:
|
|
||||||
ceph_conf_lines = ceph_conf.readlines()
|
|
||||||
for line in ceph_conf_lines:
|
|
||||||
if string in line:
|
|
||||||
return line.strip().strip('\n')
|
|
||||||
|
|
||||||
@uses_conf_tests
|
|
||||||
def test_ceph_config_has_inital_members_line(self, scenario_config):
|
|
||||||
cluster_name = scenario_config.get('ceph', {}).get('cluster_name', 'ceph')
|
|
||||||
ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name
|
|
||||||
initial_members_line = self.get_line_from_config('mon initial members', ceph_conf_path)
|
|
||||||
assert initial_members_line
|
|
||||||
|
|
||||||
@uses_conf_tests
|
|
||||||
def test_initial_members_line_has_correct_value(self, scenario_config):
|
|
||||||
cluster_name = scenario_config.get('ceph', {}).get('cluster_name', 'ceph')
|
|
||||||
ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name
|
|
||||||
initial_members_line = self.get_line_from_config('mon initial members', ceph_conf_path)
|
|
||||||
assert initial_members_line == 'mon initial members = ceph-mon0,ceph-mon1,ceph-mon2'
|
|
||||||
|
|
||||||
@uses_conf_tests
|
|
||||||
def test_mon_host_line_has_correct_value(self, scenario_config):
|
|
||||||
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)
|
|
||||||
subnet = config.get('subnet', "192.168.9")
|
|
||||||
expected = 'mon host = {subnet}.10,{subnet}.11,{subnet}.12'.format(subnet=subnet)
|
|
||||||
assert initial_members_line == expected
|
|
|
@ -1,32 +0,0 @@
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uses_mon_initial_members = pytest.mark.skipif(
|
|
||||||
'mon_initial_members' not in pytest.config.slaveinput['node_config']['components'],
|
|
||||||
reason="only run in monitors configured with initial_members"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TestMon(object):
|
|
||||||
|
|
||||||
def get_line_from_config(self, string, conf_path):
|
|
||||||
with open(conf_path) as ceph_conf:
|
|
||||||
ceph_conf_lines = ceph_conf.readlines()
|
|
||||||
for line in ceph_conf_lines:
|
|
||||||
if string in line:
|
|
||||||
return line.strip().strip('\n')
|
|
||||||
|
|
||||||
@uses_mon_initial_members
|
|
||||||
def test_ceph_config_has_inital_members_line(self, scenario_config):
|
|
||||||
cluster_name = scenario_config.get('ceph', {}).get('cluster_name', 'ceph')
|
|
||||||
ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name
|
|
||||||
initial_members_line = self.get_line_from_config('mon initial members', ceph_conf_path)
|
|
||||||
assert initial_members_line
|
|
||||||
|
|
||||||
@uses_mon_initial_members
|
|
||||||
def test_initial_members_line_has_correct_value(self, scenario_config):
|
|
||||||
cluster_name = scenario_config.get('ceph', {}).get('cluster_name', 'ceph')
|
|
||||||
ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name
|
|
||||||
initial_members_line = self.get_line_from_config('mon initial members', ceph_conf_path)
|
|
||||||
assert initial_members_line == 'mon initial members = ceph-mon0'
|
|
Loading…
Reference in New Issue