Merge "Ceph_check operator test to support dedicated and centralized with error code"
This commit is contained in:
commit
f19dc487d4
|
@ -146,6 +146,9 @@ class TestManager(object):
|
||||||
if result[0] == 200:
|
if result[0] == 200:
|
||||||
Test['state'] = 'success'
|
Test['state'] = 'success'
|
||||||
Test['result'] = textwrap.fill(str(result[1]), 40)
|
Test['result'] = textwrap.fill(str(result[1]), 40)
|
||||||
|
elif result[0] == 300:
|
||||||
|
Test['state'] = 'skipped'
|
||||||
|
Test['result'] = textwrap.fill(str(result[1]), 40)
|
||||||
else:
|
else:
|
||||||
Test['state'] = 'failed'
|
Test['state'] = 'failed'
|
||||||
Test['result'] = textwrap.fill(str(result[1]), 40)
|
Test['result'] = textwrap.fill(str(result[1]), 40)
|
||||||
|
|
|
@ -196,9 +196,14 @@ class operator_scenario(base.Scenario):
|
||||||
|
|
||||||
@base.scenario(admin_only=False, operator=True)
|
@base.scenario(admin_only=False, operator=True)
|
||||||
def ceph_check(self):
|
def ceph_check(self):
|
||||||
self.load()
|
|
||||||
cmd = (r"ceph -f json status")
|
|
||||||
|
|
||||||
|
self.load()
|
||||||
|
storage_nodes_from_ansible_config = [node.name.lower(
|
||||||
|
) for node in self.os_node_info_obj.get_host_list()
|
||||||
|
if node.role == "block_storage"]
|
||||||
|
|
||||||
|
if storage_nodes_from_ansible_config:
|
||||||
|
cmd = (r"ceph -f json status")
|
||||||
is_containerized = cfg.CONF.operator_test.containerized
|
is_containerized = cfg.CONF.operator_test.containerized
|
||||||
if is_containerized:
|
if is_containerized:
|
||||||
ceph_container = cfg.CONF.operator_test.ceph_container
|
ceph_container = cfg.CONF.operator_test.ceph_container
|
||||||
|
@ -216,14 +221,16 @@ class operator_scenario(base.Scenario):
|
||||||
num_of_osd = ceph_json['osdmap']['osdmap']['num_osds']
|
num_of_osd = ceph_json['osdmap']['osdmap']['num_osds']
|
||||||
num_up_osds = ceph_json['osdmap']['osdmap']['num_up_osds']
|
num_up_osds = ceph_json['osdmap']['osdmap']['num_up_osds']
|
||||||
if overall_status == 'HEALTH_OK':
|
if overall_status == 'HEALTH_OK':
|
||||||
return (200, "Overall Status = %s, Cluster status = %s/%s" %
|
return (200, "Overall Status = %s, "
|
||||||
|
"Cluster status = %s/%s" %
|
||||||
(overall_status, num_up_osds, num_of_osd))
|
(overall_status, num_up_osds, num_of_osd))
|
||||||
else:
|
else:
|
||||||
return (404, "Overall Status = %s, Cluster status = %s/%s" %
|
return (404, "Overall Status = %s, "
|
||||||
|
"Cluster status = %s/%s" %
|
||||||
(overall_status, num_up_osds, num_of_osd))
|
(overall_status, num_up_osds, num_of_osd))
|
||||||
else:
|
else:
|
||||||
return (404, ("Ceph cluster Test Failed: %s" %
|
return (300, ("Ceph cluster test skipped "
|
||||||
results['status_message']), [])
|
"as no dedicated storage found"))
|
||||||
|
|
||||||
@base.scenario(admin_only=False, operator=True)
|
@base.scenario(admin_only=False, operator=True)
|
||||||
def node_check(self):
|
def node_check(self):
|
||||||
|
|
Loading…
Reference in New Issue