Return 'DOWN' ports when Ironic enabled
This patch ensures that _get_server_port_id_and_ip4() return
'DOWN' ports when Ironic is enabled.
Change-Id: I42bd456a445bc4e5a9542b9a6ffe03ea96462e0d
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 7389722..d753650 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -817,11 +817,17 @@
# A port can have more then one IP address in some cases.
# If the network is dual-stack (IPv4 + IPv6), this port is associated
# with 2 subnets
+ p_status = ['ACTIVE']
+ # NOTE(vsaienko) With Ironic, instances live on separate hardware
+ # servers. Neutron does not bind ports for Ironic instances, as a
+ # result the port remains in the DOWN state.
+ if CONF.service_available.ironic:
+ p_status.append('DOWN')
port_map = [(p["id"], fxip["ip_address"])
for p in ports
for fxip in p["fixed_ips"]
if netaddr.valid_ipv4(fxip["ip_address"])
- and p['status'] == 'ACTIVE']
+ and p['status'] in p_status]
inactive = [p for p in ports if p['status'] != 'ACTIVE']
if inactive:
LOG.warning("Instance has ports that are not ACTIVE: %s", inactive)