Merge "Revert "Remove setup_credentials from orchestration tests""
diff --git a/.gitignore b/.gitignore
index efba45e..d58b162 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,9 @@
dist
build
.testrepository
+.idea
+.project
+.pydevproject
.coverage*
!.coveragerc
cover/
diff --git a/.mailmap b/.mailmap
index 5c37a5e..a43c0b9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1,9 +1,25 @@
-Ravikumar Venkatesan <ravikumar.venkatesan@hp.com> ravikumar-venkatesan <ravikumar.venkatesan@hp.com>
-Ravikumar Venkatesan <ravikumar.venkatesan@hp.com> ravikumar venkatesan <ravikumar.venkatesan@hp.com>
-Rohit Karajgi <rohit.karajgi@nttdata.com> Rohit Karajgi <rohit.karajgi@vertex.co.in>
-Jay Pipes <jaypipes@gmail.com> Jay Pipes <jpipes@librebox.gateway.2wire.net>
-Joe Gordon <joe.gordon0@gmail.com> <jogo@cloudscaling.com>
<brian.waldon@rackspace.com> <bcwaldon@gmail.com>
-Daryl Walleck <daryl.walleck@rackspace.com> dwalleck <daryl.walleck@rackspace.com>
<jeblair@hp.com> <corvus@inaugust.com>
<jeblair@hp.com> <james.blair@rackspace.com>
+Adam Gandelman <adamg@ubuntu.com> Adam Gandelman <adamg@canonical.com>
+Andrea Frittoli (andreaf) <andrea.frittoli@hpe.com> Andrea Frittoli (andreaf) <andrea.frittoli@hp.com>
+Andrea Frittoli (andreaf) <andrea.frittoli@hpe.com> Andrea Frittoli <andrea.frittoli@hp.com>
+Daryl Walleck <daryl.walleck@rackspace.com> dwalleck <daryl.walleck@rackspace.com>
+David Kranz <dkranz@redhat.com> David Kranz <david.kranz@qrclab.com>
+Ghanshyam <ghanshyam.mann@nectechnologies.in> Ghanshyam Mann <ghanshyam.mann@nectechnologies.in>
+Ghanshyam <ghanshyam.mann@nectechnologies.in> ghanshyam <ghanshyam.mann@nectechnologies.in>
+Jay Pipes <jaypipes@gmail.com> Jay Pipes <jpipes@librebox.gateway.2wire.net>
+Joe Gordon <joe.gordon0@gmail.com> <jogo@cloudscaling.com>
+Ken'ichi Ohmichi <ken-oomichi@wx.jp.nec.com> Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
+Marc Koderer <marc@koderer.com> Marc Koderer <m.koderer@telekom.de>
+Masayuki Igawa <masayuki.igawa@gmail.com> Masayuki Igawa <igawa@mxs.nes.nec.co.jp>
+Masayuki Igawa <masayuki.igawa@gmail.com> Masayuki Igawa <mas-igawa@ut.jp.nec.com>
+Matthew Treinish <mtreinish@kortar.org> Matthew Treinish <treinish@linux.vnet.ibm.com>
+Nayna Patel <nayna.patel@hp.com> nayna-patel <nayna.patel@hp.com>
+ravikumar-venkatesan <ravikumar.venkatesan@hp.com> Ravikumar Venkatesan <ravikumar.venkatesan@hp.com>
+ravikumar-venkatesan <ravikumar.venkatesan@hp.com> ravikumar venkatesan <ravikumar.venkatesan@hp.com>
+Rohit Karajgi <rohit.karajgi@nttdata.com> Rohit Karajgi <rohit.karajgi@vertex.co.in>
+Sean Dague <sean@dague.net> Sean Dague <sdague@linux.vnet.ibm.com>
+Sean Dague <sean@dague.net> Sean Dague <sean.dague@samsung.com>
+Yuiko Takada <takada-yuiko@mxn.nes.nec.co.jp> YuikoTakada <takada-yuiko@mxn.nes.nec.co.jp>
+Zhi Kun Liu <zhikunli@cn.ibm.com> Liu, Zhi Kun <zhikunli@cn.ibm.com>
diff --git a/requirements.txt b/requirements.txt
index 43f8ff7..7a6ed97 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -21,7 +21,7 @@
iso8601>=0.1.9 # MIT
fixtures>=1.3.1 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
-tempest-lib>=0.13.0 # Apache-2.0
+tempest-lib>=0.14.0 # Apache-2.0
PyYAML>=3.1.0 # MIT
stevedore>=1.5.0 # Apache-2.0
PrettyTable<0.8,>=0.7 # BSD
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 6d19ca7..0856983 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -23,6 +23,7 @@
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
+from tempest import exceptions
import tempest.test
CONF = config.CONF
@@ -356,16 +357,19 @@
def get_server_ip(cls, server):
"""Get the server fixed or floating IP.
- For the floating IP, the address created by the validation resources
- is returned.
- For the fixed IP, the server is returned and the current mechanism of
- address extraction in the remote_client is followed.
+ Based on the configuration we're in, return a correct ip
+ address for validating that a guest is up.
"""
if CONF.validation.connect_method == 'floating':
- ip_or_server = cls.validation_resources['floating_ip']['ip']
+ return cls.validation_resources['floating_ip']['ip']
elif CONF.validation.connect_method == 'fixed':
- ip_or_server = server
- return ip_or_server
+ addresses = server['addresses'][CONF.validation.network_for_ssh]
+ for address in addresses:
+ if address['version'] == CONF.validation.ip_version_for_ssh:
+ return address['addr']
+ raise exceptions.ServerUnreachable()
+ else:
+ raise exceptions.InvalidConfiguration()
class BaseV2ComputeAdminTest(BaseV2ComputeTest):
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index 8f6ede9..8706566 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -68,7 +68,7 @@
resp = {}
resp['status'] = None
self.assertRaises(lib_exc.NotFound, self.create_image_from_server,
- '!@#$%^&*()', name=name, meta=meta)
+ '!@$%^&*()', name=name, meta=meta)
@test.attr(type=['negative'])
@test.idempotent_id('ec176029-73dc-4037-8d72-2e4ff60cf538')
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index 15bea28..1729dc9 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -85,7 +85,7 @@
self.assertEqual(new_desc, updated_domain['description'])
self.assertEqual(True, updated_domain['enabled'])
- fetched_domain = self.client.get_domain(domain['id'])['domain']
+ fetched_domain = self.client.show_domain(domain['id'])['domain']
self.assertEqual(new_name, fetched_domain['name'])
self.assertEqual(new_desc, fetched_domain['description'])
self.assertEqual(True, fetched_domain['enabled'])
@@ -124,6 +124,6 @@
@test.attr(type='smoke')
@test.idempotent_id('17a5de24-e6a0-4e4a-a9ee-d85b6e5612b5')
def test_default_domain_exists(self):
- domain = self.client.get_domain(self.domain_id)['domain']
+ domain = self.client.show_domain(self.domain_id)['domain']
self.assertTrue(domain['enabled'])
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index 2ac832e..2538829 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -71,7 +71,7 @@
', '.join(str(e) for e in missing_endpoints))
@test.idempotent_id('0e2446d2-c1fd-461b-a729-b9e73e3e3b37')
- def test_create_list_delete_endpoint(self):
+ def test_create_list_show_delete_endpoint(self):
region = data_utils.rand_name('region')
url = data_utils.rand_url()
interface = 'public'
@@ -79,16 +79,30 @@
interface=interface,
url=url, region=region,
enabled=True)['endpoint']
+
# Asserting Create Endpoint response body
self.assertIn('id', endpoint)
self.assertEqual(region, endpoint['region'])
self.assertEqual(url, endpoint['url'])
+
# Checking if created endpoint is present in the list of endpoints
fetched_endpoints = self.client.list_endpoints()['endpoints']
fetched_endpoints_id = [e['id'] for e in fetched_endpoints]
self.assertIn(endpoint['id'], fetched_endpoints_id)
+
+ # Show endpoint
+ fetched_endpoint = (
+ self.client.show_endpoint(endpoint['id'])['endpoint'])
+ # Asserting if the attributes of endpoint are the same
+ self.assertEqual(self.service_id, fetched_endpoint['service_id'])
+ self.assertEqual(interface, fetched_endpoint['interface'])
+ self.assertEqual(url, fetched_endpoint['url'])
+ self.assertEqual(region, fetched_endpoint['region'])
+ self.assertEqual(True, fetched_endpoint['enabled'])
+
# Deleting the endpoint created in this method
self.client.delete_endpoint(endpoint['id'])
+
# Checking whether endpoint is deleted successfully
fetched_endpoints = self.client.list_endpoints()['endpoints']
fetched_endpoints_id = [e['id'] for e in fetched_endpoints]
diff --git a/tempest/api/identity/admin/v3/test_list_projects.py b/tempest/api/identity/admin/v3/test_list_projects.py
index 5185fea..aaed467 100644
--- a/tempest/api/identity/admin/v3/test_list_projects.py
+++ b/tempest/api/identity/admin/v3/test_list_projects.py
@@ -44,8 +44,8 @@
list_projects = self.client.list_projects()['projects']
for p in self.project_ids:
- get_project = self.client.get_project(p)['project']
- self.assertIn(get_project, list_projects)
+ show_project = self.client.show_project(p)['project']
+ self.assertIn(show_project, list_projects)
@test.idempotent_id('fab13f3c-f6a6-4b9f-829b-d32fd44fdf10')
def test_list_projects_with_domains(self):
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index af9497c..2f4cc51 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -32,7 +32,7 @@
desc1 = project['description']
self.assertEqual(desc1, project_desc, 'Description should have '
'been sent in response for create')
- body = self.client.get_project(project_id)['project']
+ body = self.client.show_project(project_id)['project']
desc2 = body['description']
self.assertEqual(desc2, project_desc, 'Description does not appear'
'to be set')
@@ -48,7 +48,7 @@
project_id = project['id']
self.assertEqual(project_name, project['name'])
self.assertEqual(self.data.domain['id'], project['domain_id'])
- body = self.client.get_project(project_id)['project']
+ body = self.client.show_project(project_id)['project']
self.assertEqual(project_name, body['name'])
self.assertEqual(self.data.domain['id'], body['domain_id'])
@@ -62,7 +62,7 @@
project_id = project['id']
en1 = project['enabled']
self.assertTrue(en1, 'Enable should be True in response')
- body = self.client.get_project(project_id)['project']
+ body = self.client.show_project(project_id)['project']
en2 = body['enabled']
self.assertTrue(en2, 'Enable should be True in lookup')
@@ -76,7 +76,7 @@
en1 = project['enabled']
self.assertEqual('false', str(en1).lower(),
'Enable should be False in response')
- body = self.client.get_project(project['id'])['project']
+ body = self.client.show_project(project['id'])['project']
en2 = body['enabled']
self.assertEqual('false', str(en2).lower(),
'Enable should be False in lookup')
@@ -96,7 +96,7 @@
resp2_name = body['name']
self.assertNotEqual(resp1_name, resp2_name)
- body = self.client.get_project(project['id'])['project']
+ body = self.client.show_project(project['id'])['project']
resp3_name = body['name']
self.assertNotEqual(resp1_name, resp3_name)
@@ -119,7 +119,7 @@
resp2_desc = body['description']
self.assertNotEqual(resp1_desc, resp2_desc)
- body = self.client.get_project(project['id'])['project']
+ body = self.client.show_project(project['id'])['project']
resp3_desc = body['description']
self.assertNotEqual(resp1_desc, resp3_desc)
@@ -142,7 +142,7 @@
resp2_en = body['enabled']
self.assertNotEqual(resp1_en, resp2_en)
- body = self.client.get_project(project['id'])['project']
+ body = self.client.show_project(project['id'])['project']
resp3_en = body['enabled']
self.assertNotEqual(resp1_en, resp3_en)
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 85961b4..2ffc596 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -139,8 +139,8 @@
self.assertEqual(self.delegated_role, trust['roles'][0]['name'])
self.assertEqual(1, len(trust['roles']))
- def get_trust(self):
- trust_get = self.trustor_client.get_trust(self.trust_id)['trust']
+ def show_trust(self):
+ trust_get = self.trustor_client.show_trust(self.trust_id)['trust']
return trust_get
def validate_role(self, role):
@@ -155,12 +155,12 @@
def check_trust_roles(self):
# Check we find the delegated role
- roles_get = self.trustor_client.get_trust_roles(
+ roles_get = self.trustor_client.list_trust_roles(
self.trust_id)['roles']
self.assertEqual(1, len(roles_get))
self.validate_role(roles_get[0])
- role_get = self.trustor_client.get_trust_role(
+ role_get = self.trustor_client.show_trust_role(
self.trust_id, self.delegated_role_id)['role']
self.validate_role(role_get)
@@ -169,7 +169,7 @@
# And that we don't find not_delegated_role
self.assertRaises(lib_exc.NotFound,
- self.trustor_client.get_trust_role,
+ self.trustor_client.show_trust_role,
self.trust_id,
self.not_delegated_role_id)
@@ -181,7 +181,7 @@
def delete_trust(self):
self.trustor_client.delete_trust(self.trust_id)
self.assertRaises(lib_exc.NotFound,
- self.trustor_client.get_trust,
+ self.trustor_client.show_trust,
self.trust_id)
self.trust_id = None
@@ -200,7 +200,7 @@
trust = self.create_trust()
self.validate_trust(trust)
- trust_get = self.get_trust()
+ trust_get = self.show_trust()
self.validate_trust(trust_get)
self.check_trust_roles()
@@ -212,7 +212,7 @@
trust = self.create_trust(impersonate=False)
self.validate_trust(trust, impersonate=False)
- trust_get = self.get_trust()
+ trust_get = self.show_trust()
self.validate_trust(trust_get, impersonate=False)
self.check_trust_roles()
@@ -236,7 +236,7 @@
trust = self.create_trust(expires=expires_str)
self.validate_trust(trust, expires=expires_str)
- trust_get = self.get_trust()
+ trust_get = self.show_trust()
self.validate_trust(trust_get, expires=expires_str)
@@ -255,7 +255,7 @@
@test.idempotent_id('6268b345-87ca-47c0-9ce3-37792b43403a')
def test_get_trusts_query(self):
self.create_trust()
- trusts_get = self.trustor_client.get_trusts(
+ trusts_get = self.trustor_client.list_trusts(
trustor_user_id=self.trustor_user_id)['trusts']
self.assertEqual(1, len(trusts_get))
self.validate_trust(trusts_get[0], summary=True)
@@ -264,7 +264,7 @@
@test.idempotent_id('4773ebd5-ecbf-4255-b8d8-b63e6f72b65d')
def test_get_trusts_all(self):
self.create_trust()
- trusts_get = self.client.get_trusts()['trusts']
+ trusts_get = self.client.list_trusts()['trusts']
trusts = [t for t in trusts_get
if t['id'] == self.trust_id]
self.assertEqual(1, len(trusts))
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 894a7a9..7c0c223 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -128,7 +128,7 @@
project_body = self.client.create_project(
data_utils.rand_name('project'),
description=data_utils.rand_name('project-desc'))['project']
- project = self.client.get_project(project_body['id'])['project']
+ project = self.client.show_project(project_body['id'])['project']
# Delete the Project at the end of this method
self.addCleanup(self.client.delete_project, project_body['id'])
# Assigning roles to user on project
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 91d620c..d31569b 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -75,7 +75,6 @@
cls.non_admin_client = cls.os.identity_public_client
cls.non_admin_token_client = cls.os.token_client
cls.non_admin_tenants_client = cls.os.tenants_public_client
- cls.non_admin_roles_client = cls.os.roles_public_client
cls.non_admin_users_client = cls.os.users_public_client
@classmethod
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index 5d12e17..78d6aea 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -80,8 +80,8 @@
cls.network = cls.create_network()
cls.subnet = cls.create_subnet(cls.network)
cls.port = cls.create_port(cls.network)
- cls.client.add_router_interface_with_port_id(
- cls.router['id'], cls.port['id'])
+ cls.client.add_router_interface(cls.router['id'],
+ port_id=cls.port['id'])
# NOTE: Sometimes we have seen this test fail with dvr in,
# multinode tests, since the dhcp port is not created before
# the test gets executed and so the router is not scheduled
@@ -99,8 +99,8 @@
@classmethod
def resource_cleanup(cls):
if cls.is_dvr_router:
- cls.client.remove_router_interface_with_port_id(
- cls.router['id'], cls.port['id'])
+ cls.client.remove_router_interface(cls.router['id'],
+ port_id=cls.port['id'])
super(L3AgentSchedulerTestJSON, cls).resource_cleanup()
@test.idempotent_id('b7ce6e89-e837-4ded-9b78-9ed3c9c6a45a')
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index db4561f..f209f89 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -250,8 +250,8 @@
@classmethod
def create_router_interface(cls, router_id, subnet_id):
"""Wrapper utility that returns a router interface."""
- interface = cls.client.add_router_interface_with_subnet_id(
- router_id, subnet_id)
+ interface = cls.client.add_router_interface(router_id,
+ subnet_id=subnet_id)
return interface
@classmethod
@@ -260,8 +260,9 @@
interfaces = body['ports']
for i in interfaces:
try:
- cls.client.remove_router_interface_with_subnet_id(
- router['id'], i['fixed_ips'][0]['subnet_id'])
+ cls.client.remove_router_interface(
+ router['id'],
+ subnet_id=i['fixed_ips'][0]['subnet_id'])
except lib_exc.NotFound:
pass
cls.client.delete_router(router['id'])
diff --git a/tempest/api/network/base_routers.py b/tempest/api/network/base_routers.py
index 739e6f9..3495b76f 100644
--- a/tempest/api/network/base_routers.py
+++ b/tempest/api/network/base_routers.py
@@ -45,19 +45,19 @@
self.assertNotIn(router_id, routers_list)
def _add_router_interface_with_subnet_id(self, router_id, subnet_id):
- interface = self.client.add_router_interface_with_subnet_id(
- router_id, subnet_id)
+ interface = self.client.add_router_interface(router_id,
+ subnet_id=subnet_id)
self.addCleanup(self._remove_router_interface_with_subnet_id,
router_id, subnet_id)
self.assertEqual(subnet_id, interface['subnet_id'])
return interface
def _remove_router_interface_with_subnet_id(self, router_id, subnet_id):
- body = self.client.remove_router_interface_with_subnet_id(
- router_id, subnet_id)
+ body = self.client.remove_router_interface(router_id,
+ subnet_id=subnet_id)
self.assertEqual(subnet_id, body['subnet_id'])
def _remove_router_interface_with_port_id(self, router_id, port_id):
- body = self.client.remove_router_interface_with_port_id(router_id,
- port_id)
+ body = self.client.remove_router_interface(router_id,
+ port_id=port_id)
self.assertEqual(port_id, body['port_id'])
diff --git a/tempest/api/network/test_dhcp_ipv6.py b/tempest/api/network/test_dhcp_ipv6.py
index 74c1d51..dbb0d14 100644
--- a/tempest/api/network/test_dhcp_ipv6.py
+++ b/tempest/api/network/test_dhcp_ipv6.py
@@ -68,9 +68,8 @@
for port in ports:
if (port['device_owner'].startswith('network:router_interface')
and port['device_id'] in [r['id'] for r in self.routers]):
- self.client.remove_router_interface_with_port_id(
- port['device_id'], port['id']
- )
+ self.client.remove_router_interface(port['device_id'],
+ port_id=port['id'])
else:
if port['id'] in [p['id'] for p in self.ports]:
self.ports_client.delete_port(port['id'])
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 67f2c83..d7b220b 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -22,6 +22,7 @@
from tempest.common import custom_matchers
from tempest.common.utils import data_utils
from tempest import config
+from tempest import exceptions
from tempest import test
CONF = config.CONF
@@ -87,14 +88,16 @@
@classmethod
def _get_ipaddress_from_tempest_conf(cls):
- """Return first subnet gateway for configured CIDR """
+ """Return subnet with mask bits for configured CIDR """
if cls._ip_version == 4:
cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
+ cidr.prefixlen = CONF.network.tenant_network_mask_bits
elif cls._ip_version == 6:
cidr = netaddr.IPNetwork(CONF.network.tenant_network_v6_cidr)
+ cidr.prefixlen = CONF.network.tenant_network_v6_mask_bits
- return netaddr.IPAddress(cidr)
+ return cidr
@test.attr(type='smoke')
@test.idempotent_id('0435f278-40ae-48cb-a404-b8a087bc09b1')
@@ -102,9 +105,15 @@
network = self.create_network()
net_id = network['id']
address = self._get_ipaddress_from_tempest_conf()
- allocation_pools = {'allocation_pools': [{'start': str(address + 4),
- 'end': str(address + 6)}]}
- subnet = self.create_subnet(network, **allocation_pools)
+ if ((address.version == 4 and address.prefixlen >= 30) or
+ (address.version == 6 and address.prefixlen >= 126)):
+ msg = ("Subnet %s isn't large enough for the test" % address.cidr)
+ raise exceptions.InvalidConfiguration(message=msg)
+ allocation_pools = {'allocation_pools': [{'start': str(address[2]),
+ 'end': str(address[-2])}]}
+ subnet = self.create_subnet(network, cidr=address,
+ mask_bits=address.prefixlen,
+ **allocation_pools)
self.addCleanup(self.subnets_client.delete_subnet, subnet['id'])
body = self.ports_client.create_port(network_id=net_id)
self.addCleanup(self.ports_client.delete_port, body['port']['id'])
@@ -191,10 +200,10 @@
self.addCleanup(self.client.delete_router, router['id'])
port = self.ports_client.create_port(network_id=network['id'])
# Add router interface to port created above
- self.client.add_router_interface_with_port_id(
- router['id'], port['port']['id'])
- self.addCleanup(self.client.remove_router_interface_with_port_id,
- router['id'], port['port']['id'])
+ self.client.add_router_interface(router['id'],
+ port_id=port['port']['id'])
+ self.addCleanup(self.client.remove_router_interface, router['id'],
+ port_id=port['port']['id'])
# List ports filtered by router_id
port_list = self.ports_client.list_ports(device_id=router['id'])
ports = port_list['ports']
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 406ad44..0b64be4 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -137,8 +137,8 @@
subnet = self.create_subnet(network)
router = self._create_router(data_utils.rand_name('router-'))
# Add router interface with subnet id
- interface = self.client.add_router_interface_with_subnet_id(
- router['id'], subnet['id'])
+ interface = self.client.add_router_interface(router['id'],
+ subnet_id=subnet['id'])
self.addCleanup(self._remove_router_interface_with_subnet_id,
router['id'], subnet['id'])
self.assertIn('subnet_id', interface.keys())
@@ -158,8 +158,9 @@
port_body = self.ports_client.create_port(
network_id=network['id'])
# add router interface to port created above
- interface = self.client.add_router_interface_with_port_id(
- router['id'], port_body['port']['id'])
+ interface = self.client.add_router_interface(
+ router['id'],
+ port_id=port_body['port']['id'])
self.addCleanup(self._remove_router_interface_with_port_id,
router['id'], port_body['port']['id'])
self.assertIn('subnet_id', interface.keys())
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index 90da6fd..7b07d42 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -84,8 +84,8 @@
@test.attr(type=['negative'])
@test.idempotent_id('04df80f9-224d-47f5-837a-bf23e33d1c20')
def test_router_remove_interface_in_use_returns_409(self):
- self.client.add_router_interface_with_subnet_id(
- self.router['id'], self.subnet['id'])
+ self.client.add_router_interface(self.router['id'],
+ subnet_id=self.subnet['id'])
self.assertRaises(lib_exc.Conflict,
self.client.delete_router,
self.router['id'])
diff --git a/tempest/clients.py b/tempest/clients.py
index 50aa6f4..bc1f5ad 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -501,9 +501,10 @@
'region': CONF.identity.region
}
params.update(self.default_params_with_timeout_values)
+
+ # Clients below use the admin endpoint type of Keystone API v2
params_v2_admin = params.copy()
params_v2_admin['endpoint_type'] = CONF.identity.v2_admin_endpoint_type
- # Client uses admin endpoint type of Keystone API v2
self.endpoints_v2_client = EndpointsV2Client(self.auth_provider,
**params_v2_admin)
self.identity_client = IdentityClient(self.auth_provider,
@@ -516,21 +517,21 @@
**params_v2_admin)
self.services_v2_client = ServicesV2Client(self.auth_provider,
**params_v2_admin)
+
+ # Clients below use the public endpoint type of Keystone API v2
params_v2_public = params.copy()
params_v2_public['endpoint_type'] = (
CONF.identity.v2_public_endpoint_type)
- # Client uses public endpoint type of Keystone API v2
self.identity_public_client = IdentityClient(self.auth_provider,
**params_v2_public)
self.tenants_public_client = TenantsClient(self.auth_provider,
**params_v2_public)
- self.roles_public_client = RolesClient(self.auth_provider,
- **params_v2_public)
self.users_public_client = UsersClient(self.auth_provider,
**params_v2_public)
+
+ # Clients below use the endpoint type of Keystone API v3
params_v3 = params.copy()
params_v3['endpoint_type'] = CONF.identity.v3_endpoint_type
- # Clients below use the endpoint type of Keystone API v3
self.identity_v3_client = IdentityV3Client(self.auth_provider,
**params_v3)
self.endpoints_client = EndPointV3Client(self.auth_provider,
@@ -543,6 +544,7 @@
self.credentials_client = CredentialsV3Client(self.auth_provider,
**params_v3)
self.groups_client = GroupsV3Client(self.auth_provider, **params_v3)
+
# Token clients do not use the catalog. They only need default_params.
# They read auth_url, so they should only be set if the corresponding
# API version is marked as enabled
diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py
index ddfc75d..9e98d90 100755
--- a/tempest/cmd/account_generator.py
+++ b/tempest/cmd/account_generator.py
@@ -312,8 +312,8 @@
return resp_body['router']
def _add_router_interface(router_id, subnet_id):
- network_admin_client.add_router_interface_with_subnet_id(
- router_id, subnet_id)
+ network_admin_client.add_router_interface(router_id,
+ subnet_id=subnet_id)
network_name = name + "-network"
network = _create_network(network_name)
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 8a47406..33f19b1 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -469,8 +469,7 @@
in client.list_router_interfaces(rid)['ports']
if port["device_owner"] == "network:router_interface"]
for port in ports:
- client.remove_router_interface_with_port_id(rid,
- port['id'])
+ client.remove_router_interface(rid, port_id=port['id'])
client.delete_router(rid)
except Exception:
LOG.exception("Delete Router exception.")
diff --git a/tempest/cmd/javelin.py b/tempest/cmd/javelin.py
index 8012ad7..e26a014 100755
--- a/tempest/cmd/javelin.py
+++ b/tempest/cmd/javelin.py
@@ -841,8 +841,8 @@
for subnet in router['subnet']:
subnet_id = _get_resource_by_name(client.networks,
'subnets', subnet)['id']
- client.networks.remove_router_interface_with_subnet_id(router_id,
- subnet_id)
+ client.networks.remove_router_interface(router_id,
+ subnet_id=subnet_id)
client.networks.delete_router(router_id)
@@ -856,8 +856,8 @@
subnet_id = _get_resource_by_name(client.networks,
'subnets', subnet)['id']
# connect routers to their subnets
- client.networks.add_router_interface_with_subnet_id(router_id,
- subnet_id)
+ client.networks.add_router_interface(router_id,
+ subnet_id=subnet_id)
# connect routers to external network if set to "gateway"
if router['gateway']:
if CONF.network.public_network_id:
diff --git a/tempest/common/api_version_utils.py b/tempest/common/api_version_utils.py
index 98601a7..c3d977f 100644
--- a/tempest/common/api_version_utils.py
+++ b/tempest/common/api_version_utils.py
@@ -38,13 +38,13 @@
config_max_version = api_version_request.APIVersionRequest(cfg_max_version)
if ((min_version > max_version) or
(config_min_version > config_max_version)):
- msg = ("Min version is greater than Max version. Test Class versions "
- "[%s - %s]. configuration versions [%s - %s]."
+ msg = ("Test Class versions [%s - %s]. "
+ "Configuration versions [%s - %s]."
% (min_version.get_string(),
max_version.get_string(),
config_min_version.get_string(),
config_max_version.get_string()))
- raise exceptions.InvalidConfiguration(msg)
+ raise exceptions.InvalidAPIVersionRange(msg)
# NOTE: Select tests which are in range of configuration like
# config min config max
diff --git a/tempest/common/dynamic_creds.py b/tempest/common/dynamic_creds.py
index 95ad229..8d3a24d 100644
--- a/tempest/common/dynamic_creds.py
+++ b/tempest/common/dynamic_creds.py
@@ -233,8 +233,8 @@
return resp_body['router']
def _add_router_interface(self, router_id, subnet_id):
- self.network_admin_client.add_router_interface_with_subnet_id(
- router_id, subnet_id)
+ self.network_admin_client.add_router_interface(router_id,
+ subnet_id=subnet_id)
def get_credentials(self, credential_type):
if self._creds.get(str(credential_type)):
@@ -333,8 +333,9 @@
if (not self.network_resources or
(self.network_resources.get('router') and creds.subnet)):
try:
- net_client.remove_router_interface_with_subnet_id(
- creds.router['id'], creds.subnet['id'])
+ net_client.remove_router_interface(
+ creds.router['id'],
+ subnet_id=creds.subnet['id'])
except lib_exc.NotFound:
LOG.warning('router with name: %s not found for delete' %
creds.router['name'])
diff --git a/tempest/common/utils/__init__.py b/tempest/common/utils/__init__.py
index 81b8110..aad6373 100644
--- a/tempest/common/utils/__init__.py
+++ b/tempest/common/utils/__init__.py
@@ -27,8 +27,6 @@
class DataUtils(object):
def __getattr__(self, attr):
- if attr in self.__dict__:
- return self.__dict__[attr]
if attr == 'rand_name':
# NOTE(flwang): This is a proxy to generate a random name that
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index b76c356..8f5faef 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -15,8 +15,8 @@
import time
from oslo_log import log as logging
-import six
from tempest_lib.common import ssh
+import tempest_lib.exceptions
from tempest import config
from tempest import exceptions
@@ -28,22 +28,10 @@
class RemoteClient(object):
- # NOTE(afazekas): It should always get an address instead of server
- def __init__(self, server, username, password=None, pkey=None):
+ def __init__(self, ip_address, username, password=None, pkey=None):
ssh_timeout = CONF.validation.ssh_timeout
- network = CONF.validation.network_for_ssh
- ip_version = CONF.validation.ip_version_for_ssh
connect_timeout = CONF.validation.connect_timeout
- if isinstance(server, six.string_types):
- ip_address = server
- else:
- addresses = server['addresses'][network]
- for address in addresses:
- if address['version'] == ip_version:
- ip_address = address['addr']
- break
- else:
- raise exceptions.ServerUnreachable()
+
self.ssh_client = ssh.Client(ip_address, username, password,
ssh_timeout, pkey=pkey,
channel_timeout=connect_timeout)
@@ -191,4 +179,10 @@
def make_fs(self, dev_name, fs='ext4'):
cmd_mkfs = 'sudo /usr/sbin/mke2fs -t %s /dev/%s' % (fs, dev_name)
- self.exec_command(cmd_mkfs)
+ try:
+ self.exec_command(cmd_mkfs)
+ except tempest_lib.exceptions.SSHExecCommandFailed:
+ LOG.error("Couldn't mke2fs")
+ cmd_why = 'sudo ls -lR /dev'
+ LOG.info("Contents of /dev: %s" % self.exec_command(cmd_why))
+ raise
diff --git a/tempest/config.py b/tempest/config.py
index 6942172..14a6ad2 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1189,6 +1189,11 @@
'live_migration, pause, rescue, resize '
'shelve, snapshot, and suspend')
+
+# NOTE(deva): Ironic tests have been ported to tempest-lib. New config options
+# should be added to ironic/ironic_tempest_plugin/config.py.
+# However, these options need to remain here for testing stable
+# branches until Liberty release reaches EOL.
BaremetalGroup = [
cfg.StrOpt('catalog_type',
default='baremetal',
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 931737d..86e8460 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -186,6 +186,10 @@
" %(schema_versions_info)s")
+class InvalidAPIVersionRange(TempestException):
+ message = ("API Min Version is greater than Max version")
+
+
class CommandFailed(Exception):
def __init__(self, returncode, cmd, output, stderr):
super(CommandFailed, self).__init__()
diff --git a/tempest/hacking/ignored_list_T110.txt b/tempest/hacking/ignored_list_T110.txt
index ce69931..f1f21d1 100644
--- a/tempest/hacking/ignored_list_T110.txt
+++ b/tempest/hacking/ignored_list_T110.txt
@@ -1,4 +1,3 @@
-./tempest/services/identity/v3/json/identity_client.py
./tempest/services/messaging/json/messaging_client.py
./tempest/services/object_storage/object_client.py
./tempest/services/telemetry/json/alarming_client.py
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 6776220..1962286 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -328,9 +328,6 @@
for ruleset in rulesets:
sg_rule = _client_rules.create_security_group_rule(
parent_group_id=secgroup_id, **ruleset)['security_group_rule']
- self.addCleanup(self.delete_wrapper,
- _client_rules.delete_security_group_rule,
- sg_rule['id'])
rules.append(sg_rule)
return rules
@@ -352,25 +349,15 @@
return secgroup
- def get_remote_client(self, server_or_ip, username=None, private_key=None):
+ def get_remote_client(self, ip_address, username=None, private_key=None):
"""Get a SSH client to a remote server
- @param server_or_ip a server object as returned by Tempest compute
- client or an IP address to connect to
+ @param ip_address the server floating or fixed IP address to use
+ for ssh validation
@param username name of the Linux account on the remote server
@param private_key the SSH private key to use
@return a RemoteClient object
"""
- if isinstance(server_or_ip, six.string_types):
- ip = server_or_ip
- else:
- addrs = server_or_ip['addresses'][CONF.validation.network_for_ssh]
- try:
- ip = (addr['addr'] for addr in addrs if
- netaddr.valid_ipv4(addr['addr'])).next()
- except StopIteration:
- raise lib_exc.NotFound("No IPv4 addresses to use for SSH to "
- "remote server.")
if username is None:
username = CONF.validation.image_ssh_user
@@ -383,14 +370,15 @@
else:
password = CONF.validation.image_ssh_password
private_key = None
- linux_client = remote_client.RemoteClient(ip, username,
+ linux_client = remote_client.RemoteClient(ip_address, username,
pkey=private_key,
password=password)
try:
linux_client.validate_authentication()
except Exception as e:
message = ('Initializing SSH connection to %(ip)s failed. '
- 'Error: %(error)s' % {'ip': ip, 'error': e})
+ 'Error: %(error)s' % {'ip': ip_address,
+ 'error': e})
caller = misc_utils.find_test_caller()
if caller:
message = '(%s) %s' % (caller, message)
@@ -628,9 +616,9 @@
floating_ip['ip'], thing['id'])
return floating_ip
- def create_timestamp(self, server_or_ip, dev_name=None, mount_path='/mnt',
+ def create_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
private_key=None):
- ssh_client = self.get_remote_client(server_or_ip,
+ ssh_client = self.get_remote_client(ip_address,
private_key=private_key)
if dev_name is not None:
ssh_client.make_fs(dev_name)
@@ -643,9 +631,9 @@
ssh_client.umount(mount_path)
return timestamp
- def get_timestamp(self, server_or_ip, dev_name=None, mount_path='/mnt',
+ def get_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
private_key=None):
- ssh_client = self.get_remote_client(server_or_ip,
+ ssh_client = self.get_remote_client(ip_address,
private_key=private_key)
if dev_name is not None:
ssh_client.mount(dev_name, mount_path)
@@ -655,12 +643,25 @@
ssh_client.umount(mount_path)
return timestamp
- def get_server_or_ip(self, server):
+ def get_server_ip(self, server):
+ """Get the server fixed or floating IP.
+
+ Based on the configuration we're in, return a correct ip
+ address for validating that a guest is up.
+ """
if CONF.validation.connect_method == 'floating':
- ip = self.create_floating_ip(server)['ip']
+ # The tests calling this method don't have a floating IP
+ # and can't make use of the validattion resources. So the
+ # method is creating the floating IP there.
+ return self.create_floating_ip(server)['ip']
+ elif CONF.validation.connect_method == 'fixed':
+ addresses = server['addresses'][CONF.validation.network_for_ssh]
+ for address in addresses:
+ if address['version'] == CONF.validation.ip_version_for_ssh:
+ return address['addr']
+ raise exceptions.ServerUnreachable()
else:
- ip = server
- return ip
+ raise exceptions.InvalidConfiguration()
class NetworkScenarioTest(ScenarioTest):
@@ -1055,7 +1056,6 @@
client=sec_group_rules_client,
**sg_rule['security_group_rule']
)
- self.addCleanup(self.delete_wrapper, sg_rule.delete)
self.assertEqual(secgroup.tenant_id, sg_rule.tenant_id)
self.assertEqual(secgroup.id, sg_rule.security_group_id)
@@ -1316,13 +1316,6 @@
def add_keypair(self):
self.keypair = self.create_keypair()
- def verify_connectivity(self, ip=None):
- if ip:
- dest = self.get_remote_client(ip)
- else:
- dest = self.get_remote_client(self.instance)
- dest.validate_authentication()
-
def boot_instance(self):
self.instance = self.create_server(
key_name=self.keypair['name'])
diff --git a/tempest/scenario/test_baremetal_basic_ops.py b/tempest/scenario/test_baremetal_basic_ops.py
index 93b32f7..15d9b66 100644
--- a/tempest/scenario/test_baremetal_basic_ops.py
+++ b/tempest/scenario/test_baremetal_basic_ops.py
@@ -112,12 +112,9 @@
self.add_keypair()
self.boot_instance()
self.validate_ports()
- self.verify_connectivity()
- if CONF.validation.connect_method == 'floating':
- floating_ip = self.create_floating_ip(self.instance)['ip']
- self.verify_connectivity(ip=floating_ip)
-
- vm_client = self.get_remote_client(self.instance)
+ ip_address = self.get_server_ip(self.instance)
+ self.get_remote_client(ip_address).validate_authentication()
+ vm_client = self.get_remote_client(ip_address)
# We expect the ephemeral partition to be mounted on /mnt and to have
# the same size as our flavor definition.
@@ -126,6 +123,6 @@
self.verify_partition(vm_client, 'ephemeral0', '/mnt', eph_size)
# Create the test file
self.create_timestamp(
- floating_ip, private_key=self.keypair['private_key'])
+ ip_address, private_key=self.keypair['private_key'])
self.terminate_instance()
diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py
index cc28873..fc33dd9 100644
--- a/tempest/scenario/test_network_v6.py
+++ b/tempest/scenario/test_network_v6.py
@@ -124,7 +124,7 @@
fip = self.create_floating_ip(thing=srv)
ips = self.define_server_ips(srv=srv)
ssh = self.get_remote_client(
- server_or_ip=fip.floating_ip_address,
+ ip_address=fip.floating_ip_address,
username=username)
return ssh, ips, srv["id"]
@@ -203,31 +203,37 @@
(dest, source.ssh_client.host)
)
+ @test.attr(type='slow')
@test.idempotent_id('2c92df61-29f0-4eaa-bee3-7c65bef62a43')
@test.services('compute', 'network')
def test_slaac_from_os(self):
self._prepare_and_test(address6_mode='slaac')
+ @test.attr(type='slow')
@test.idempotent_id('d7e1f858-187c-45a6-89c9-bdafde619a9f')
@test.services('compute', 'network')
def test_dhcp6_stateless_from_os(self):
self._prepare_and_test(address6_mode='dhcpv6-stateless')
+ @test.attr(type='slow')
@test.idempotent_id('7ab23f41-833b-4a16-a7c9-5b42fe6d4123')
@test.services('compute', 'network')
def test_multi_prefix_dhcpv6_stateless(self):
self._prepare_and_test(address6_mode='dhcpv6-stateless', n_subnets6=2)
+ @test.attr(type='slow')
@test.idempotent_id('dec222b1-180c-4098-b8c5-cc1b8342d611')
@test.services('compute', 'network')
def test_multi_prefix_slaac(self):
self._prepare_and_test(address6_mode='slaac', n_subnets6=2)
+ @test.attr(type='slow')
@test.idempotent_id('b6399d76-4438-4658-bcf5-0d6c8584fde2')
@test.services('compute', 'network')
def test_dualnet_slaac_from_os(self):
self._prepare_and_test(address6_mode='slaac', dualnet=True)
+ @test.attr(type='slow')
@test.idempotent_id('76f26acd-9688-42b4-bc3e-cd134c4cb09e')
@test.services('compute', 'network')
def test_dualnet_dhcp6_stateless_from_os(self):
diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py
index 6c24d04..dcb095b 100644
--- a/tempest/scenario/test_server_basic_ops.py
+++ b/tempest/scenario/test_server_basic_ops.py
@@ -75,7 +75,7 @@
self.fip = self.create_floating_ip(self.instance)['ip']
# Check ssh
self.ssh_client = self.get_remote_client(
- server_or_ip=self.fip,
+ ip_address=self.fip,
username=self.image_utils.ssh_user(self.image_ref),
private_key=keypair['private_key'])
diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py
index 378ae9d..77de47e 100644
--- a/tempest/scenario/test_shelve_instance.py
+++ b/tempest/scenario/test_shelve_instance.py
@@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo_log import log
import testtools
from tempest.common import waiters
@@ -23,8 +22,6 @@
CONF = config.CONF
-LOG = log.getLogger(__name__)
-
class TestShelveInstance(manager.ScenarioTest):
"""This test shelves then unshelves a Nova instance
@@ -80,7 +77,7 @@
security_groups=security_groups,
wait_until='ACTIVE')
- instance_ip = self.get_server_or_ip(server)
+ instance_ip = self.get_server_ip(server)
timestamp = self.create_timestamp(instance_ip,
private_key=keypair['private_key'])
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index f3b6558..d6528a3 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo_log import log
import testtools
from tempest import config
@@ -22,8 +21,6 @@
CONF = config.CONF
-LOG = log.getLogger(__name__)
-
class TestSnapshotPattern(manager.ScenarioTest):
"""This test is for snapshotting an instance and booting with it.
@@ -52,7 +49,7 @@
security_groups=[{'name': security_group['name']}],
wait_until='ACTIVE')
- instance_ip = self.get_server_or_ip(server)
+ instance_ip = self.get_server_ip(server)
timestamp = self.create_timestamp(instance_ip,
private_key=keypair['private_key'])
@@ -67,7 +64,7 @@
wait_until='ACTIVE')
# check the existence of the timestamp file in the second instance
- server_from_snapshot_ip = self.get_server_or_ip(server_from_snapshot)
+ server_from_snapshot_ip = self.get_server_ip(server_from_snapshot)
timestamp2 = self.get_timestamp(server_from_snapshot_ip,
private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp2)
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index f88fb14..1d09fe7 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -25,10 +25,8 @@
from tempest import exceptions
from tempest.scenario import manager
from tempest import test
-import tempest.test
CONF = config.CONF
-
LOG = logging.getLogger(__name__)
@@ -80,25 +78,25 @@
self.assertEqual(snapshot_name, snapshot['display_name'])
return snapshot
- def _wait_for_volume_available_on_the_system(self, server_or_ip,
+ def _wait_for_volume_available_on_the_system(self, ip_address,
private_key):
- ssh = self.get_remote_client(server_or_ip, private_key=private_key)
+ ssh = self.get_remote_client(ip_address, private_key=private_key)
def _func():
part = ssh.get_partitions()
LOG.debug("Partitions:%s" % part)
return CONF.compute.volume_device_name in part
- if not tempest.test.call_until_true(_func,
- CONF.compute.build_timeout,
- CONF.compute.build_interval):
+ if not test.call_until_true(_func,
+ CONF.compute.build_timeout,
+ CONF.compute.build_interval):
raise exceptions.TimeoutException
@decorators.skip_because(bug="1205344")
@test.idempotent_id('10fd234a-515c-41e5-b092-8323060598c5')
@testtools.skipUnless(CONF.compute_feature_enabled.snapshot,
'Snapshotting is not available.')
- @tempest.test.services('compute', 'network', 'volume', 'image')
+ @test.services('compute', 'network', 'volume', 'image')
def test_stamp_pattern(self):
# prepare for booting an instance
keypair = self.create_keypair()
@@ -113,7 +111,7 @@
wait_until='ACTIVE')
# create and add floating IP to server1
- ip_for_server = self.get_server_or_ip(server)
+ ip_for_server = self.get_server_ip(server)
self.nova_volume_attach(server, volume)
self._wait_for_volume_available_on_the_system(ip_for_server,
@@ -140,7 +138,7 @@
security_groups=security_group)
# create and add floating IP to server_from_snapshot
- ip_for_snapshot = self.get_server_or_ip(server_from_snapshot)
+ ip_for_snapshot = self.get_server_ip(server_from_snapshot)
# attach volume2 to instance2
self.nova_volume_attach(server_from_snapshot, volume_from_snapshot)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 7b88025..4ce57db 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo_log import log
-
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
@@ -20,8 +18,6 @@
CONF = config.CONF
-LOG = log.getLogger(__name__)
-
class TestVolumeBootPattern(manager.ScenarioTest):
@@ -114,7 +110,7 @@
keypair, security_group)
# write content to volume on instance
- ip_instance_1st = self.get_server_or_ip(instance_1st)
+ ip_instance_1st = self.get_server_ip(instance_1st)
timestamp = self.create_timestamp(ip_instance_1st,
private_key=keypair['private_key'])
@@ -126,7 +122,7 @@
keypair, security_group)
# check the content of written file
- ip_instance_2nd = self.get_server_or_ip(instance_2nd)
+ ip_instance_2nd = self.get_server_ip(instance_2nd)
timestamp2 = self.get_timestamp(ip_instance_2nd,
private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp2)
@@ -141,7 +137,7 @@
keypair, security_group))
# check the content of written file
- server_from_snapshot_ip = self.get_server_or_ip(server_from_snapshot)
+ server_from_snapshot_ip = self.get_server_ip(server_from_snapshot)
timestamp3 = self.get_timestamp(server_from_snapshot_ip,
private_key=keypair['private_key'])
self.assertEqual(timestamp, timestamp3)
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index ede5edb..8ab7464 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -61,3 +61,10 @@
resp_header, resp_body = self.delete('endpoints/%s' % endpoint_id)
self.expected_success(204, resp_header.status)
return service_client.ResponseBody(resp_header, resp_body)
+
+ def show_endpoint(self, endpoint_id):
+ """Get endpoint."""
+ resp_header, resp_body = self.get('endpoints/%s' % endpoint_id)
+ self.expected_success(200, resp_header.status)
+ resp_body = json.loads(resp_body)
+ return service_client.ResponseBody(resp_header, resp_body)
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index fba26d4..15f0577 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -149,7 +149,7 @@
return service_client.ResponseBody(resp, body)
def update_project(self, project_id, **kwargs):
- body = self.get_project(project_id)['project']
+ body = self.show_project(project_id)['project']
name = kwargs.get('name', body['name'])
desc = kwargs.get('description', body['description'])
en = kwargs.get('enabled', body['enabled'])
@@ -167,7 +167,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_project(self, project_id):
+ def show_project(self, project_id):
"""GET a Project."""
resp, body = self.get("projects/%s" % project_id)
self.expected_success(200, resp.status)
@@ -264,7 +264,7 @@
def update_domain(self, domain_id, **kwargs):
"""Updates a domain."""
- body = self.get_domain(domain_id)['domain']
+ body = self.show_domain(domain_id)['domain']
description = kwargs.get('description', body['description'])
en = kwargs.get('enabled', body['enabled'])
name = kwargs.get('name', body['name'])
@@ -279,7 +279,7 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_domain(self, domain_id):
+ def show_domain(self, domain_id):
"""Get Domain details."""
resp, body = self.get('domains/%s' % domain_id)
self.expected_success(200, resp.status)
@@ -446,7 +446,7 @@
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
- def get_trusts(self, trustor_user_id=None, trustee_user_id=None):
+ def list_trusts(self, trustor_user_id=None, trustee_user_id=None):
"""GET trusts."""
if trustor_user_id:
resp, body = self.get("OS-TRUST/trusts?trustor_user_id=%s"
@@ -460,21 +460,21 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_trust(self, trust_id):
+ def show_trust(self, trust_id):
"""GET trust."""
resp, body = self.get("OS-TRUST/trusts/%s" % trust_id)
self.expected_success(200, resp.status)
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_trust_roles(self, trust_id):
+ def list_trust_roles(self, trust_id):
"""GET roles delegated by a trust."""
resp, body = self.get("OS-TRUST/trusts/%s/roles" % trust_id)
self.expected_success(200, resp.status)
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def get_trust_role(self, trust_id, role_id):
+ def show_trust_role(self, trust_id, role_id):
"""GET role delegated by a trust."""
resp, body = self.get("OS-TRUST/trusts/%s/roles/%s"
% (trust_id, role_id))
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 6b0b1f9..c6b22df 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -180,25 +180,23 @@
"""
return self._update_router(router_id, set_enable_snat=True, **kwargs)
- def add_router_interface_with_subnet_id(self, router_id, subnet_id):
+ def add_router_interface(self, router_id, **kwargs):
+ """Add router interface.
+
+ Available params: see http://developer.openstack.org/
+ api-ref-networking-v2-ext.html#addRouterInterface
+ """
uri = '/routers/%s/add_router_interface' % router_id
- update_body = {"subnet_id": subnet_id}
- return self.update_resource(uri, update_body)
+ return self.update_resource(uri, kwargs)
- def add_router_interface_with_port_id(self, router_id, port_id):
- uri = '/routers/%s/add_router_interface' % router_id
- update_body = {"port_id": port_id}
- return self.update_resource(uri, update_body)
+ def remove_router_interface(self, router_id, **kwargs):
+ """Remove router interface.
- def remove_router_interface_with_subnet_id(self, router_id, subnet_id):
+ Available params: see http://developer.openstack.org/
+ api-ref-networking-v2-ext.html#removeRouterInterface
+ """
uri = '/routers/%s/remove_router_interface' % router_id
- update_body = {"subnet_id": subnet_id}
- return self.update_resource(uri, update_body)
-
- def remove_router_interface_with_port_id(self, router_id, port_id):
- uri = '/routers/%s/remove_router_interface' % router_id
- update_body = {"port_id": port_id}
- return self.update_resource(uri, update_body)
+ return self.update_resource(uri, kwargs)
def list_router_interfaces(self, uuid):
uri = '/ports?device_id=%s' % uuid
diff --git a/tempest/services/network/resources.py b/tempest/services/network/resources.py
index 10911f7..0a7da92 100644
--- a/tempest/services/network/resources.py
+++ b/tempest/services/network/resources.py
@@ -89,14 +89,13 @@
def add_to_router(self, router_id):
self._router_ids.add(router_id)
- self.network_client.add_router_interface_with_subnet_id(
- router_id, subnet_id=self.id)
+ self.network_client.add_router_interface(router_id,
+ subnet_id=self.id)
def delete(self):
for router_id in self._router_ids.copy():
- self.network_client.remove_router_interface_with_subnet_id(
- router_id,
- subnet_id=self.id)
+ self.network_client.remove_router_interface(router_id,
+ subnet_id=self.id)
self._router_ids.remove(router_id)
self.subnets_client.delete_subnet(self.id)
diff --git a/tempest/test.py b/tempest/test.py
index dfed947..9c04ea1 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -293,7 +293,7 @@
LOG.exception("teardown of %s failed: %s" % (name, te))
if not etype:
etype, value, trace = sys_exec_info
- # If exceptions were raised during teardown, an not before, re-raise
+ # If exceptions were raised during teardown, and not before, re-raise
# the first one
if re_raise and etype is not None:
try:
@@ -600,7 +600,7 @@
networks_client = cls.get_client_manager().compute_networks_client
cred_provider = cls._get_credentials_provider()
# In case of nova network, isolated tenants are not able to list the
- # network configured in fixed_network_name, even if the can use it
+ # network configured in fixed_network_name, even if they can use it
# for their servers, so using an admin network client to validate
# the network name
if (not CONF.service_available.neutron and
@@ -790,9 +790,9 @@
@classmethod
def set_resource(cls, name, resource):
- """Register a resoruce for a test
+ """Register a resource for a test
- This function can be used in setUpClass context to register a resoruce
+ This function can be used in setUpClass context to register a resource
for a test.
:param name: The name of the kind of resource such as "flavor", "role",
diff --git a/tempest/tests/common/test_api_version_utils.py b/tempest/tests/common/test_api_version_utils.py
index a24bc65..501f954 100644
--- a/tempest/tests/common/test_api_version_utils.py
+++ b/tempest/tests/common/test_api_version_utils.py
@@ -51,11 +51,11 @@
self._test_version('2.8', '2.9', '2.3', '2.7', expected_skip=True)
def test_version_min_greater_than_max(self):
- self.assertRaises(exceptions.InvalidConfiguration,
+ self.assertRaises(exceptions.InvalidAPIVersionRange,
self._test_version, '2.8', '2.7', '2.3', '2.7')
def test_cfg_version_min_greater_than_max(self):
- self.assertRaises(exceptions.InvalidConfiguration,
+ self.assertRaises(exceptions.InvalidAPIVersionRange,
self._test_version, '2.2', '2.7', '2.9', '2.7')
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index 4379756..de2000d 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -322,9 +322,9 @@
self._mock_router_create('1234', 'fake_router')
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClient.'
- 'add_router_interface_with_subnet_id')
+ 'add_router_interface')
primary_creds = creds.get_primary_creds()
- router_interface_mock.assert_called_once_with('1234', '1234')
+ router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
network = primary_creds.network
subnet = primary_creds.subnet
router = primary_creds.router
@@ -354,9 +354,9 @@
self._mock_router_create('1234', 'fake_router')
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClient.'
- 'add_router_interface_with_subnet_id')
+ 'add_router_interface')
creds.get_primary_creds()
- router_interface_mock.assert_called_once_with('1234', '1234')
+ router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
router_interface_mock.reset_mock()
# Create alternate tenant and network
self._mock_user_create('12345', 'fake_alt_user')
@@ -365,7 +365,8 @@
self._mock_subnet_create(creds, '12345', 'fake_alt_subnet')
self._mock_router_create('12345', 'fake_alt_router')
creds.get_alt_creds()
- router_interface_mock.assert_called_once_with('12345', '12345')
+ router_interface_mock.assert_called_once_with('12345',
+ subnet_id='12345')
router_interface_mock.reset_mock()
# Create admin tenant and networks
self._mock_user_create('123456', 'fake_admin_user')
@@ -390,7 +391,7 @@
router_mock = router.start()
remove_router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClient.'
- 'remove_router_interface_with_subnet_id')
+ 'remove_router_interface')
return_values = ({'status': 200}, {'ports': []})
port_list_mock = mock.patch.object(creds.ports_admin_client,
'list_ports',
@@ -419,11 +420,11 @@
# Verify remove router interface calls
calls = remove_router_interface_mock.mock_calls
self.assertEqual(len(calls), 3)
- args = map(lambda x: x[1], calls)
+ args = map(lambda x: (x[1][0], x[2]), calls)
args = list(args)
- self.assertIn(('1234', '1234'), args)
- self.assertIn(('12345', '12345'), args)
- self.assertIn(('123456', '123456'), args)
+ self.assertIn(('1234', {'subnet_id': '1234'}), args)
+ self.assertIn(('12345', {'subnet_id': '12345'}), args)
+ self.assertIn(('123456', {'subnet_id': '123456'}), args)
# Verify network delete calls
calls = net_mock.mock_calls
self.assertEqual(len(calls), 3)
@@ -461,9 +462,9 @@
self._mock_router_create('1234', 'fake_alt_router')
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClient.'
- 'add_router_interface_with_subnet_id')
+ 'add_router_interface')
alt_creds = creds.get_alt_creds()
- router_interface_mock.assert_called_once_with('1234', '1234')
+ router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
network = alt_creds.network
subnet = alt_creds.subnet
router = alt_creds.router
@@ -485,10 +486,10 @@
self._mock_router_create('1234', 'fake_admin_router')
router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClient.'
- 'add_router_interface_with_subnet_id')
+ 'add_router_interface')
self._mock_list_roles('123456', 'admin')
admin_creds = creds.get_admin_creds()
- router_interface_mock.assert_called_once_with('1234', '1234')
+ router_interface_mock.assert_called_once_with('1234', subnet_id='1234')
network = admin_creds.network
subnet = admin_creds.subnet
router = admin_creds.router
diff --git a/tempest/tests/test_microversions.py b/tempest/tests/test_microversions.py
index fc37af4..6738641 100644
--- a/tempest/tests/test_microversions.py
+++ b/tempest/tests/test_microversions.py
@@ -141,7 +141,7 @@
'2.5', group='compute-feature-enabled')
cfg.CONF.set_default('max_microversion',
'2.1', group='compute-feature-enabled')
- self.assertRaises(exceptions.InvalidConfiguration,
+ self.assertRaises(exceptions.InvalidAPIVersionRange,
VersionTestNoneTolatest.skip_checks)
def test_config_version_invalid_test_version(self):
@@ -149,5 +149,5 @@
None, group='compute-feature-enabled')
cfg.CONF.set_default('max_microversion',
'2.13', group='compute-feature-enabled')
- self.assertRaises(exceptions.InvalidConfiguration,
+ self.assertRaises(exceptions.InvalidAPIVersionRange,
InvalidVersionTest.skip_checks)
diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py
index d1643f8..e279159 100644
--- a/tools/install_venv_common.py
+++ b/tools/install_venv_common.py
@@ -113,7 +113,7 @@
# First things first, make sure our venv has the latest pip and
# setuptools and pbr
- self.pip_install('pip<8,>=1.4')
+ self.pip_install('pip>=1.4')
self.pip_install('setuptools')
self.pip_install('pbr')