Unskip test_list_virtual_interfaces
Nova will return a 400 in the case of using Neutron as the
network API. Remove the skip such that a 400 is expected in
the case of using Neutron, else it's a failure.
Nova will implement the API for neutron in a microversion.
Depends-On: I27f48b38d64b34277f001fba86b4e64e9ead937c
Change-Id: I409fc6349a40396be68796fc82e5c1f37242bbdb
Related-Bug: #1183436
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index b3e138f..e620e03 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -14,10 +14,11 @@
# under the License.
import netaddr
+import testtools
from tempest.api.compute import base
from tempest import config
-from tempest.lib import decorators
+from tempest.lib import exceptions
from tempest import test
CONF = config.CONF
@@ -42,20 +43,26 @@
server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
- @decorators.skip_because(bug="1183436",
- condition=CONF.service_available.neutron)
@test.idempotent_id('96c4e2ef-5e4d-4d7f-87f5-fed6dca18016')
@test.services('network')
def test_list_virtual_interfaces(self):
# Positive test:Should be able to GET the virtual interfaces list
# for a given server_id
- output = self.client.list_virtual_interfaces(self.server_id)
- self.assertIsNotNone(output)
- virt_ifaces = output
- self.assertNotEqual(0, len(virt_ifaces['virtual_interfaces']),
- 'Expected virtual interfaces, got 0 interfaces.')
- for virt_iface in virt_ifaces['virtual_interfaces']:
- mac_address = virt_iface['mac_address']
- self.assertTrue(netaddr.valid_mac(mac_address),
- "Invalid mac address detected. mac address: %s"
- % mac_address)
+
+ if CONF.service_available.neutron:
+ # TODO(mriedem): After a microversion implements the API for
+ # neutron, a 400 should be a failure for nova-network and neutron.
+ with testtools.ExpectedException(exceptions.BadRequest):
+ self.client.list_virtual_interfaces(self.server_id)
+ else:
+ output = self.client.list_virtual_interfaces(self.server_id)
+ self.assertIsNotNone(output)
+ virt_ifaces = output
+ self.assertNotEqual(0, len(virt_ifaces['virtual_interfaces']),
+ 'Expected virtual interfaces, got 0 '
+ 'interfaces.')
+ for virt_iface in virt_ifaces['virtual_interfaces']:
+ mac_address = virt_iface['mac_address']
+ self.assertTrue(netaddr.valid_mac(mac_address),
+ "Invalid mac address detected. mac address: %s"
+ % mac_address)