Add API tests for router and DHCP port status

Add API tests that ensure DHCP ports and router interface ports
become active.

Router gateway ports were excluded because deployments using
'external_network_bridge = br-ex' will always have their external
interface in the DOWN state.

Related-Bug: #1590845
Related-Bug: #1605955
Change-Id: I843f9217a3c401e8221c9dd42cbd4ea55dcd7a81
diff --git a/neutron/tests/tempest/api/test_routers.py b/neutron/tests/tempest/api/test_routers.py
index d0a38aa..7d08edd 100644
--- a/neutron/tests/tempest/api/test_routers.py
+++ b/neutron/tests/tempest/api/test_routers.py
@@ -18,6 +18,7 @@
 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 @@
              '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):