Merge "Add API tests for router and DHCP port status"

This commit is contained in:
Jenkins 2016-08-01 23:56:29 +00:00 committed by Gerrit Code Review
commit 858c15d2dd
2 changed files with 26 additions and 0 deletions

View File

@ -12,8 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib import constants
from tempest import test
from neutron.common import utils
from neutron.tests.tempest.api import base
@ -30,6 +32,18 @@ class DHCPAgentSchedulersTestJSON(base.BaseAdminNetworkTest):
cls.cidr = cls.subnet['cidr']
cls.port = cls.create_port(cls.network)
@test.idempotent_id('f164801e-1dd8-4b8b-b5d3-cc3ac77cfaa5')
def test_dhcp_port_status_active(self):
def dhcp_port_active():
for p in self.client.list_ports(
network_id=self.network['id'])['ports']:
if (p['device_owner'] == constants.DEVICE_OWNER_DHCP and
p['status'] == constants.PORT_STATUS_ACTIVE):
return True
return False
utils.wait_until_true(dhcp_port_active)
@test.idempotent_id('5032b1fe-eb42-4a64-8f3b-6e189d8b5c7d')
def test_list_dhcp_agent_hosting_network(self):
self.admin_client.list_dhcp_agent_hosting_network(

View File

@ -18,6 +18,7 @@ import six
from tempest.lib.common.utils import data_utils
from tempest import test
from neutron.common import utils
from neutron.tests.tempest.api import base
from neutron.tests.tempest.api import base_routers
from neutron.tests.tempest import config
@ -153,6 +154,17 @@ class RoutersTest(base_routers.BaseRouterTest):
'enable_snat': False})
self._verify_gateway_port(router['id'])
@test.idempotent_id('db3093b1-93b6-4893-be83-c4716c251b3e')
def test_router_interface_status(self):
network = self.create_network()
subnet = self.create_subnet(network)
# Add router interface with subnet id
router = self._create_router(data_utils.rand_name('router-'), True)
intf = self.create_router_interface(router['id'], subnet['id'])
status_active = lambda: self.client.show_port(
intf['port_id'])['port']['status'] == 'ACTIVE'
utils.wait_until_true(status_active)
@test.idempotent_id('c86ac3a8-50bd-4b00-a6b8-62af84a0765c')
@test.requires_ext(extension='extraroute', service='network')
def test_update_extra_route(self):