'Test L3 interfaces query return valid result'

def test_l3_agent_sync_interfaces(self):

    with self.router() as router1:
        with self.router() as router2:
            with self.port() as port1:
                with self.port() as port2:
                    self._router_interface_action('add', router1['router']['id'], None, port1['port']['id'])
                    self._router_interface_action('add', router2['router']['id'], None, port2['port']['id'])
                    admin_ctx = context.get_admin_context()
                    router1_id = router1['router']['id']
                    router2_id = router2['router']['id']
                    ifaces = self.plugin._get_sync_interfaces(admin_ctx, [router1_id])
                    self.assertEqual(1, len(ifaces))
                    self.assertEqual(router1_id, ifaces[0]['device_id'])
                    ifaces = self.plugin._get_sync_interfaces(admin_ctx, [router1_id, router2_id])
                    self.assertEqual(2, len(ifaces))
                    device_list = [i['device_id'] for i in ifaces]
                    self.assertIn(router1_id, device_list)
                    self.assertIn(router2_id, device_list)
                    ifaces = self.plugin._get_sync_interfaces(admin_ctx, None)
                    self.assertEqual(0, len(ifaces))
