Merge "Skip some tests in "network.admin.test_ports" if nova is not enabled"
This commit is contained in:
commit
ecc33b29c8
|
@ -14,9 +14,13 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from tempest.api.network import base
|
from tempest.api.network import base
|
||||||
|
from tempest.common import utils
|
||||||
|
from tempest import config
|
||||||
from tempest.lib.common.utils import test_utils
|
from tempest.lib.common.utils import test_utils
|
||||||
from tempest.lib import decorators
|
from tempest.lib import decorators
|
||||||
|
|
||||||
|
CONF = config.CONF
|
||||||
|
|
||||||
|
|
||||||
class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
|
class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
|
||||||
|
|
||||||
|
@ -29,10 +33,12 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
|
||||||
def resource_setup(cls):
|
def resource_setup(cls):
|
||||||
super(PortsAdminExtendedAttrsTestJSON, cls).resource_setup()
|
super(PortsAdminExtendedAttrsTestJSON, cls).resource_setup()
|
||||||
cls.network = cls.create_network()
|
cls.network = cls.create_network()
|
||||||
|
if CONF.service_available.nova:
|
||||||
hyper_list = cls.hyper_client.list_hypervisors()
|
hyper_list = cls.hyper_client.list_hypervisors()
|
||||||
cls.host_id = hyper_list['hypervisors'][0]['hypervisor_hostname']
|
cls.host_id = hyper_list['hypervisors'][0]['hypervisor_hostname']
|
||||||
|
|
||||||
@decorators.idempotent_id('8e8569c1-9ac7-44db-8bc1-f5fb2814f29b')
|
@decorators.idempotent_id('8e8569c1-9ac7-44db-8bc1-f5fb2814f29b')
|
||||||
|
@utils.services('compute')
|
||||||
def test_create_port_binding_ext_attr(self):
|
def test_create_port_binding_ext_attr(self):
|
||||||
post_body = {"network_id": self.network['id'],
|
post_body = {"network_id": self.network['id'],
|
||||||
"binding:host_id": self.host_id}
|
"binding:host_id": self.host_id}
|
||||||
|
@ -46,6 +52,7 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
|
||||||
self.assertEqual(self.host_id, host_id)
|
self.assertEqual(self.host_id, host_id)
|
||||||
|
|
||||||
@decorators.idempotent_id('6f6c412c-711f-444d-8502-0ac30fbf5dd5')
|
@decorators.idempotent_id('6f6c412c-711f-444d-8502-0ac30fbf5dd5')
|
||||||
|
@utils.services('compute')
|
||||||
def test_update_port_binding_ext_attr(self):
|
def test_update_port_binding_ext_attr(self):
|
||||||
post_body = {"network_id": self.network['id']}
|
post_body = {"network_id": self.network['id']}
|
||||||
body = self.admin_ports_client.create_port(**post_body)
|
body = self.admin_ports_client.create_port(**post_body)
|
||||||
|
@ -61,6 +68,7 @@ class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
|
||||||
self.assertEqual(self.host_id, host_id)
|
self.assertEqual(self.host_id, host_id)
|
||||||
|
|
||||||
@decorators.idempotent_id('1c82a44a-6c6e-48ff-89e1-abe7eaf8f9f8')
|
@decorators.idempotent_id('1c82a44a-6c6e-48ff-89e1-abe7eaf8f9f8')
|
||||||
|
@utils.services('compute')
|
||||||
def test_list_ports_binding_ext_attr(self):
|
def test_list_ports_binding_ext_attr(self):
|
||||||
# Create a new port
|
# Create a new port
|
||||||
post_body = {"network_id": self.network['id']}
|
post_body = {"network_id": self.network['id']}
|
||||||
|
|
Loading…
Reference in New Issue