From 0105f1444f3e794bbc1131732de22a1318e4e845 Mon Sep 17 00:00:00 2001 From: Tatyana Leontovich Date: Tue, 27 May 2014 14:37:50 +0300 Subject: [PATCH] Permit infrastructure test only if node is online Permit sanity infrastructure tests only if node is online Change-Id: I174120b313fd907e2c41c85dc3cf57a2ea0f35bd Related-Bug: #1323252 (cherry picked from commit ab76323cdb6f9c43f9e97177aa920c5452029eef) --- fuel_health/config.py | 7 +++++++ fuel_health/tests/sanity/test_sanity_infrastructure.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fuel_health/config.py b/fuel_health/config.py index ef2ea613..4038c36e 100644 --- a/fuel_health/config.py +++ b/fuel_health/config.py @@ -144,6 +144,9 @@ ComputeGroup = [ cfg.ListOpt('compute_nodes', default=[], help="IP addresses of compute nodes"), + cfg.ListOpt('online_computes', + default=[], + help="IP addresses of online compute nodes"), cfg.ListOpt('ceph_nodes', default=[], help="IP addresses of nodes with ceph-osd role"), @@ -573,6 +576,10 @@ class NailgunConfig(object): compute_nodes = filter(lambda node: 'compute' in node['roles'], data) + online_computes = filter( + lambda node: 'compute' in node['roles'] + and node['online'] is True, data) + self.compute.online_computes = online_computes compute_ips = [] for node in compute_nodes: compute_ips.append(node['ip']) diff --git a/fuel_health/tests/sanity/test_sanity_infrastructure.py b/fuel_health/tests/sanity/test_sanity_infrastructure.py index 610d95b7..c47794af 100644 --- a/fuel_health/tests/sanity/test_sanity_infrastructure.py +++ b/fuel_health/tests/sanity/test_sanity_infrastructure.py @@ -36,8 +36,8 @@ class SanityInfrastructureTest(nmanager.SanityChecksTest): @classmethod def setUpClass(cls): super(SanityInfrastructureTest, cls).setUpClass() - cls.controllers = cls.config.compute.controller_nodes - cls.computes = cls.config.compute.compute_nodes + cls.controllers = cls.config.compute.online_controllers + cls.computes = cls.config.compute.online_computes cls.usr = cls.config.compute.controller_node_ssh_user cls.pwd = cls.config.compute.controller_node_ssh_password cls.key = cls.config.compute.path_to_private_key