Merge "Add [baremetal] available_nodes configuration option"

This commit is contained in:
Zuul 2018-04-09 14:00:33 +00:00 committed by Gerrit Code Review
commit ef3756460c
2 changed files with 8 additions and 0 deletions

View File

@ -129,6 +129,9 @@ BaremetalGroup = [
min=0,
help="Ironic adjusted disk size to use in the standalone tests "
"as instance_info/root_gb value."),
cfg.IntOpt('available_nodes', min=0, default=None,
help="The number of baremetal hosts available to use for "
"the tests.")
]
BaremetalFeaturesGroup = [

View File

@ -44,6 +44,11 @@ class BaremetalMultitenancy(baremetal_manager.BaremetalScenarioTest,
if not CONF.baremetal.use_provision_network:
msg = 'Ironic/Neutron tenant isolation is not configured.'
raise cls.skipException(msg)
if (CONF.baremetal.available_nodes is not None and
CONF.baremetal.available_nodes < 2):
msg = ('Not enough baremetal nodes, %d configured, test requires '
'a minimum of 2') % CONF.baremetal.available_nodes
raise cls.skipException(msg)
def create_tenant_network(self, clients, tenant_cidr):
network = self._create_network(