Merge "update whitebox testing for deleted type change"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 3cbe1b5..fc20d0b 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -7,18 +7,11 @@
# custom Keystone service catalog implementation, you probably want to leave
# this value as "identity"
catalog_type = identity
-# Set to True if your test environment's Keystone authentication service should
-# be accessed over HTTPS
-use_ssl = False
-# This is the main host address of the authentication service API
-host = 127.0.0.1
-# Port that the authentication service API is running on
-port = 5000
-# Version of the authentication service API (a string)
-api_version = v2.0
-# Path to the authentication service tokens resource (do not modify unless you
-# have a custom authentication API and are not using Keystone)
-path = tokens
+# Ignore SSL certificate validation failures? Use when in testing
+# environments that have self-signed SSL certs.
+disable_ssl_certificate_validation = False
+# URL for where to find the OpenStack Identity API endpoint (Keystone)
+uri = http://127.0.0.1:5000/v2.0/
# Should typically be left as keystone unless you have a non-Keystone
# authentication API service
strategy = keystone
@@ -162,13 +155,6 @@
# Port that the Image API is running on
port = 9292
-# This should be the username of a user WITHOUT administrative privileges
-username = demo
-# The above non-administrative user's password
-password = pass
-# The above non-administrative user's tenant name
-tenant_name = demo
-
[compute-admin]
# This section contains configuration options for an administrative
# user of the Compute API. These options are used in tests that stress
@@ -217,29 +203,6 @@
# for each tenant to have their own router.
public_router_id = {$PUBLIC_ROUTER_ID}
-[network-admin]
-# This section contains configuration options for an administrative
-# user of the Network API.
-
-# This should be the username of a user WITH administrative privileges
-username = admin
-# The above administrative user's password
-password = pass
-# The above administrative user's tenant name
-tenant_name = admin
-
-[identity-admin]
-# This section contains configuration options for an administrative
-# user of the Compute API. These options are used in tests that stress
-# the admin-only parts of the Compute API
-
-# This should be the username of a user WITH administrative privileges
-username = admin
-# The above administrative user's password
-password = pass
-# The above administrative user's tenant name
-tenant_name = admin
-
[volume]
# This section contains the configuration options used when executing tests
# against the OpenStack Block Storage API service
@@ -269,6 +232,12 @@
# The object-store region
region = RegionOne
+# Number of seconds to time on waiting for a container to container
+# synchronization complete
+container_sync_timeout = 120
+# Number of seconds to wait while looping to check the status of a
+# container to container synchronization
+container_sync_interval = 5
[boto]
# This section contains configuration options used when executing tests
diff --git a/stress/tools/nova_destroy_all.py b/stress/tools/nova_destroy_all.py
index 21cac11..0070e72 100755
--- a/stress/tools/nova_destroy_all.py
+++ b/stress/tools/nova_destroy_all.py
@@ -24,7 +24,7 @@
compute = tempest.config.TempestConfig().compute
nt = client.Client(compute.username, compute.password,
- compute.tenant_name, identity.auth_url)
+ compute.tenant_name, identity.uri)
flavor_list = nt.flavors.list()
server_list = nt.servers.list()
diff --git a/stress/tools/nova_status.py b/stress/tools/nova_status.py
index d413d7a..f9bc707 100755
--- a/stress/tools/nova_status.py
+++ b/stress/tools/nova_status.py
@@ -23,10 +23,10 @@
identity = tempest.config.TempestConfig().identity
compute = tempest.config.TempestConfig().compute
print compute.username, compute.password,\
- compute.tenant_name, identity.auth_url
+ compute.tenant_name, identity.uri
nt = client.Client(compute.username, compute.password,
- compute.tenant_name, identity.auth_url)
+ compute.tenant_name, identity.uri)
flavor_list = nt.flavors.list()
server_list = nt.servers.list()
diff --git a/tempest/clients.py b/tempest/clients.py
index 0bb1752..801bdcf 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -51,10 +51,10 @@
VolumesExtensionsClientXML
from tempest.services.compute.xml.console_output_client import \
ConsoleOutputsClientXML
-from tempest.services.identity.json.admin_client import AdminClientJSON
-from tempest.services.identity.json.admin_client import TokenClientJSON
-from tempest.services.identity.xml.admin_client import AdminClientXML
-from tempest.services.identity.xml.admin_client import TokenClientXML
+from tempest.services.identity.json.identity_client import IdentityClientJSON
+from tempest.services.identity.json.identity_client import TokenClientJSON
+from tempest.services.identity.xml.identity_client import IdentityClientXML
+from tempest.services.identity.xml.identity_client import TokenClientXML
from tempest.services.image import service as image_service
from tempest.services.network.json.network_client import NetworkClient
from tempest.services.object_storage.account_client import AccountClient
@@ -64,6 +64,8 @@
from tempest.services.volume.xml.volumes_client import VolumesClientXML
from tempest.services.object_storage.object_client import \
ObjectClientCustomizedHeader
+from tempest.services.object_storage.account_client import \
+ AccountClientCustomizedHeader
LOG = logging.getLogger(__name__)
@@ -112,9 +114,9 @@
"xml": VolumesClientXML,
}
-ADMIN_CLIENT = {
- "json": AdminClientJSON,
- "xml": AdminClientXML,
+IDENTITY_CLIENT = {
+ "json": IdentityClientJSON,
+ "xml": IdentityClientXML,
}
TOKEN_CLIENT = {
@@ -164,7 +166,7 @@
"tenant_name: %(tenant_name)s") % locals()
raise exceptions.InvalidConfiguration(msg)
- self.auth_url = self.config.identity.auth_url
+ self.auth_url = self.config.identity.uri
if self.config.identity.strategy == 'keystone':
client_args = (self.config, self.username, self.password,
@@ -185,7 +187,7 @@
self.volumes_extensions_client = vol_ext_cli
self.floating_ips_client = FLOAT_CLIENTS[interface](*client_args)
self.volumes_client = VOLUMES_CLIENTS[interface](*client_args)
- self.admin_client = ADMIN_CLIENT[interface](*client_args)
+ self.identity_client = IDENTITY_CLIENT[interface](*client_args)
self.token_client = TOKEN_CLIENT[interface](self.config)
self.security_groups_client = \
SECURITY_GROUPS_CLIENT[interface](*client_args)
@@ -202,6 +204,23 @@
self.ec2api_client = APIClientEC2(*client_args)
self.s3_client = ObjectClientS3(*client_args)
self.custom_object_client = ObjectClientCustomizedHeader(*client_args)
+ self.custom_account_client = \
+ AccountClientCustomizedHeader(*client_args)
+
+
+class NonAdminManager(Manager):
+
+ """
+ Manager object that uses the alt_XXX credentials for its
+ managed client objects
+ """
+
+ def __init__(self, interface='json'):
+ conf = config.TempestConfig()
+ super(NonAdminManager, self).__init__(conf.compute.username,
+ conf.compute.password,
+ conf.compute.tenant_name,
+ interface=interface)
class AltManager(Manager):
@@ -244,33 +263,3 @@
self.services = {}
self.services['image'] = image_service.Service(self.config)
self.images = self.services['image']
-
-
-class IdentityManager(Manager):
-
- """
- Manager object that uses the alt_XXX credentials for its
- managed client objects
- """
-
- def __init__(self, interface='json'):
- conf = config.TempestConfig()
- super(IdentityManager, self).__init__(conf.identity_admin.username,
- conf.identity_admin.password,
- conf.identity_admin.tenant_name,
- interface)
-
-
-class IdentityNaManager(Manager):
-
- """
- Manager object that uses the alt_XXX credentials for its
- managed client objects
- """
-
- def __init__(self, interface='json'):
- conf = config.TempestConfig()
- super(IdentityNaManager, self).__init__(conf.compute.username,
- conf.compute.password,
- conf.compute.tenant_name,
- interface)
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 287ef56..4213b10 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -103,7 +103,8 @@
params['headers'] = {'User-Agent': 'Test-Client', 'X-Auth-User': user,
'X-Auth-Key': password}
- self.http_obj = httplib2.Http(disable_ssl_certificate_validation=True)
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ self.http_obj = httplib2.Http(disable_ssl_certificate_validation=dscv)
resp, body = self.http_obj.request(auth_url, 'GET', **params)
try:
return resp['x-auth-token'], resp['x-server-management-url']
@@ -115,6 +116,10 @@
Provides authentication via Keystone
"""
+ # Normalize URI to ensure /tokens is in it.
+ if 'tokens' not in auth_url:
+ auth_url = auth_url.rstrip('/') + '/tokens'
+
creds = {
'auth': {
'passwordCredentials': {
@@ -125,7 +130,8 @@
}
}
- self.http_obj = httplib2.Http(disable_ssl_certificate_validation=True)
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ self.http_obj = httplib2.Http(disable_ssl_certificate_validation=dscv)
headers = {'Content-Type': 'application/json'}
body = json.dumps(creds)
resp, body = self.http_obj.request(auth_url, 'POST',
@@ -200,7 +206,8 @@
if (self.token is None) or (self.base_url is None):
self._set_auth()
- self.http_obj = httplib2.Http(disable_ssl_certificate_validation=True)
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ self.http_obj = httplib2.Http(disable_ssl_certificate_validation=dscv)
if headers is None:
headers = {}
headers['X-Auth-Token'] = self.token
diff --git a/tempest/common/utils/data_utils.py b/tempest/common/utils/data_utils.py
index 3a7661c..82982b8 100644
--- a/tempest/common/utils/data_utils.py
+++ b/tempest/common/utils/data_utils.py
@@ -27,6 +27,10 @@
return name + str(random.randint(1, 999999))
+def rand_int_id(start=0, end=999999):
+ return random.randint(start, end)
+
+
def build_url(host, port, api_version=None, path=None,
params=None, use_ssl=False):
"""Build the request URL from given host, port, path and parameters."""
@@ -60,7 +64,7 @@
def parse_image_id(image_ref):
"""Return the image id from a given image ref."""
- return image_ref.rsplit('/')[-1]
+ return image_ref.rsplit('/')[-1]
def arbitrary_string(size=4, base_text=None):
diff --git a/tempest/config.py b/tempest/config.py
index 8233dd5..e348cce 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -31,21 +31,28 @@
cfg.StrOpt('catalog_type',
default='identity',
help="Catalog type of the Identity service."),
+ cfg.BoolOpt('disable_ssl_certificate_validation',
+ default=False,
+ help="Set to True if using self-signed SSL certificates."),
+ cfg.StrOpt('uri',
+ default=None,
+ help="Full URI of the OpenStack Identity API (Keystone)"),
cfg.StrOpt('host',
default="127.0.0.1",
- help="Host IP for making Identity API requests."),
+ help="(DEPRECATED, use uri) Host IP for making Identity "
+ "API requests."),
cfg.IntOpt('port',
default=8773,
- help="Port for the Identity service."),
+ help="(DEPRECATED, use uri) Port for the Identity service."),
cfg.StrOpt('api_version',
default="v1.1",
- help="Version of the Identity API"),
+ help="(DEPRECATED, use uri) Version of the Identity API"),
cfg.StrOpt('path',
default='/',
- help="Path of API request"),
+ help="(IGNORED) Path of API request"),
cfg.BoolOpt('use_ssl',
default=False,
- help="Specifies if we are using https."),
+ help="(DEPRECATED, use uri) Specifies if we are using https."),
cfg.StrOpt('strategy',
default='keystone',
help="Which auth method does the environment use? "
@@ -61,39 +68,15 @@
for opt in IdentityGroup:
conf.register_opt(opt, group='identity')
+ # Fall back to piecemeal identity URI for legacy support
authurl = data_utils.build_url(conf.identity.host,
str(conf.identity.port),
conf.identity.api_version,
- conf.identity.path,
+ path='', # Ignore path...
use_ssl=conf.identity.use_ssl)
- auth_url = cfg.StrOpt('auth_url',
- default=authurl,
- help="The Identity URL (derived)")
- conf.register_opt(auth_url, group="identity")
-
-
-identity_admin_group = cfg.OptGroup(name='identity-admin',
- title="Identity Admin Options")
-
-IdentityAdminGroup = [
- cfg.StrOpt('username',
- default='admin',
- help="Username to use for Identity Admin API requests"),
- cfg.StrOpt('tenant_name',
- default='admin',
- help="Tenant name to use for Identity Admin API requests"),
- cfg.StrOpt('password',
- default='pass',
- help="API key to use for Identity Admin API requests",
- secret=True),
-]
-
-
-def register_identity_admin_opts(conf):
- conf.register_group(identity_admin_group)
- for opt in IdentityAdminGroup:
- conf.register_opt(opt, group='identity-admin')
+ if not conf.identity.uri:
+ conf.identity.uri = authurl
compute_group = cfg.OptGroup(name='compute',
@@ -267,18 +250,6 @@
cfg.StrOpt('api_version',
default='1',
help="Version of the API"),
- cfg.StrOpt('username',
- default='demo',
- help="Username to use for Images API requests. Defaults to "
- "'demo'."),
- cfg.StrOpt('password',
- default='pass',
- help="Password for user",
- secret=True),
- cfg.StrOpt('tenant_name',
- default="demo",
- help="Tenant to use for Images API requests. Defaults to "
- "'demo'."),
]
@@ -298,16 +269,6 @@
cfg.StrOpt('api_version',
default="v1.1",
help="Version of Quantum API"),
- cfg.StrOpt('username',
- default="demo",
- help="Username to use for Quantum API requests."),
- cfg.StrOpt('tenant_name',
- default="demo",
- help="Tenant name to use for Quantum API requests."),
- cfg.StrOpt('password',
- default="pass",
- help="API key to use when authenticating as admin.",
- secret=True),
cfg.StrOpt('tenant_network_cidr',
default="10.100.0.0/16",
help="The cidr block to allocate tenant networks from"),
@@ -334,31 +295,6 @@
for opt in NetworkGroup:
conf.register_opt(opt, group='network')
-network_admin_group = cfg.OptGroup(name='network-admin',
- title="Network Admin Options")
-
-NetworkAdminGroup = [
- cfg.StrOpt('username',
- default='admin',
- help="Administrative Username to use for Quantum API "
- "requests."),
- cfg.StrOpt('tenant_name',
- default='admin',
- help="Administrative Tenant name to use for Quantum API "
- "requests."),
- cfg.StrOpt('password',
- default='pass',
- help="API key to use when authenticating as admin.",
- secret=True),
-]
-
-
-def register_network_admin_opts(conf):
- conf.register_group(network_admin_group)
- for opt in NetworkAdminGroup:
- conf.register_opt(opt, group='network-admin')
-
-
volume_group = cfg.OptGroup(name='volume',
title='Block Storage Options')
@@ -392,6 +328,14 @@
cfg.StrOpt('region',
default=None,
help='The object-store region name to use.'),
+ cfg.StrOpt('container_sync_timeout',
+ default=120,
+ help="Number of seconds to time on waiting for a container"
+ "to container synchronization complete."),
+ cfg.StrOpt('container_sync_interval',
+ default=5,
+ help="Number of seconds to wait while looping to check the"
+ "status of a container to container synchronization"),
]
@@ -504,21 +448,17 @@
register_compute_opts(cfg.CONF)
register_identity_opts(cfg.CONF)
- register_identity_admin_opts(cfg.CONF)
register_compute_admin_opts(cfg.CONF)
register_image_opts(cfg.CONF)
register_network_opts(cfg.CONF)
- register_network_admin_opts(cfg.CONF)
register_volume_opts(cfg.CONF)
register_object_storage_opts(cfg.CONF)
register_boto_opts(cfg.CONF)
self.compute = cfg.CONF.compute
self.compute_admin = cfg.CONF['compute-admin']
self.identity = cfg.CONF.identity
- self.identity_admin = cfg.CONF['identity-admin']
self.images = cfg.CONF.image
self.network = cfg.CONF.network
- self.network_admin = cfg.CONF['network-admin']
self.volume = cfg.CONF.volume
self.object_storage = cfg.CONF['object-storage']
self.boto = cfg.CONF.boto
diff --git a/tempest/manager.py b/tempest/manager.py
index 513e5d9..ef9eed4 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -126,8 +126,8 @@
"tenant_name: %(tenant_name)s") % locals()
raise exceptions.InvalidConfiguration(msg)
- # Novaclient adds a /tokens/ part to the auth URL automatically
- auth_url = self.config.identity.auth_url.rstrip('tokens')
+ auth_url = self.config.identity.uri
+ dscv = self.config.identity.disable_ssl_certificate_validation
client_args = (username, password, tenant_name, auth_url)
@@ -136,38 +136,44 @@
return novaclient.client.Client(self.NOVACLIENT_VERSION,
*client_args,
service_type=service_type,
- no_cache=True)
+ no_cache=True,
+ insecure=dscv)
def _get_image_client(self):
keystone = self._get_identity_client()
token = keystone.auth_token
endpoint = keystone.service_catalog.url_for(service_type='image',
endpoint_type='publicURL')
- return glanceclient.Client('1', endpoint=endpoint, token=token)
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ return glanceclient.Client('1', endpoint=endpoint, token=token,
+ insecure=dscv)
def _get_identity_client(self, username=None, password=None,
tenant_name=None):
# This identity client is not intended to check the security
# of the identity service, so use admin credentials by default.
if not username:
- username = self.config.identity_admin.username
+ username = self.config.compute_admin.username
if not password:
- password = self.config.identity_admin.password
+ password = self.config.compute_admin.password
if not tenant_name:
- tenant_name = self.config.identity_admin.tenant_name
+ tenant_name = self.config.compute_admin.tenant_name
if None in (username, password, tenant_name):
msg = ("Missing required credentials for identity client. "
"username: %(username)s, password: %(password)s, "
"tenant_name: %(tenant_name)s") % locals()
raise exceptions.InvalidConfiguration(msg)
+ #TODO(afazekas): Above is a code dpulication, net to be resolved
- auth_url = self.config.identity.auth_url.rstrip('tokens')
+ auth_url = self.config.identity.uri
+ dscv = self.config.identity.disable_ssl_certificate_validation
return keystoneclient.v2_0.client.Client(username=username,
password=password,
tenant_name=tenant_name,
- auth_url=auth_url)
+ auth_url=auth_url,
+ insecure=dscv)
def _get_network_client(self):
# The intended configuration is for the network client to have
@@ -176,9 +182,9 @@
# preferable to authenticating as a specific user because
# working with certain resources (public routers and networks)
# often requires admin privileges anyway.
- username = self.config.network_admin.username
- password = self.config.network_admin.password
- tenant_name = self.config.network_admin.tenant_name
+ username = self.config.compute_admin.username
+ password = self.config.compute_admin.password
+ tenant_name = self.config.compute_admin.tenant_name
if None in (username, password, tenant_name):
msg = ("Missing required credentials for network client. "
@@ -186,12 +192,14 @@
"tenant_name: %(tenant_name)s") % locals()
raise exceptions.InvalidConfiguration(msg)
- auth_url = self.config.identity.auth_url.rstrip('tokens')
+ auth_url = self.config.identity.uri
+ dscv = self.config.identity.disable_ssl_certificate_validation
return quantumclient.v2_0.client.Client(username=username,
password=password,
tenant_name=tenant_name,
- auth_url=auth_url)
+ auth_url=auth_url,
+ insecure=dscv)
class ComputeFuzzClientManager(FuzzClientManager):
@@ -225,7 +233,11 @@
"tenant_name: %(tenant_name)s") % locals()
raise exceptions.InvalidConfiguration(msg)
- auth_url = self.config.identity.auth_url
+ auth_url = self.config.identity.uri
+
+ # Ensure /tokens is in the URL for Keystone...
+ if 'tokens' not in auth_url:
+ auth_url = auth_url.rstrip('/') + '/tokens'
if self.config.identity.strategy == 'keystone':
client_args = (self.config, username, password, auth_url,
diff --git a/tempest/services/boto/__init__.py b/tempest/services/boto/__init__.py
index 1365435..f744d9d 100644
--- a/tempest/services/boto/__init__.py
+++ b/tempest/services/boto/__init__.py
@@ -38,10 +38,6 @@
self.connection_timeout = str(config.boto.http_socket_timeout)
self.num_retries = str(config.boto.num_retries)
self.build_timeout = config.boto.build_timeout
- # We do not need the "path": "/token" part
- if auth_url:
- auth_url = re.sub("(.*)" + re.escape(config.identity.path) + "$",
- "\\1", auth_url)
self.ks_cred = {"username": username,
"password": password,
"auth_url": auth_url,
@@ -100,4 +96,4 @@
else:
raise InvalidConfiguration(
"Unable to get access and secret keys")
- return self.connect_method(**self.connection_data)
+ return self.connect_method(**self.connection_data)
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index bd339b2..955068f 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -87,3 +87,22 @@
if flavor['id'] == id:
return False
return True
+
+ def set_flavor_extra_spec(self, flavor_id, specs):
+ """Sets extra Specs to the mentioned flavor."""
+ post_body = json.dumps({'extra_specs': specs})
+ resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
+ post_body, self.headers)
+ body = json.loads(body)
+ return resp, body['extra_specs']
+
+ def get_flavor_extra_spec(self, flavor_id):
+ """Gets extra Specs details of the mentioned flavor."""
+ resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
+ body = json.loads(body)
+ return resp, body['extra_specs']
+
+ def unset_flavor_extra_spec(self, flavor_id, key):
+ """Unsets extra Specs from the mentioned flavor."""
+ return self.delete('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
+ key))
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index c011fe4..ece362b 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -125,3 +125,25 @@
if flavor['id'] == id:
return False
return True
+
+ def set_flavor_extra_spec(self, flavor_id, specs):
+ """Sets extra Specs to the mentioned flavor."""
+ extra_specs = Element("extra_specs")
+ for key in specs.keys():
+ extra_specs.add_attr(key, specs[key])
+ resp, body = self.post('flavors/%s/os-extra_specs' % flavor_id,
+ str(Document(extra_specs)), self.headers)
+ body = xml_to_json(etree.fromstring(body))
+ return resp, body
+
+ def get_flavor_extra_spec(self, flavor_id):
+ """Gets extra Specs of the mentioned flavor."""
+ resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id,
+ self.headers)
+ body = xml_to_json(etree.fromstring(body))
+ return resp, body
+
+ def unset_flavor_extra_spec(self, flavor_id, key):
+ """Unsets an extra spec based on the mentioned flavor and key."""
+ return self.delete('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
+ key))
diff --git a/tempest/services/identity/json/admin_client.py b/tempest/services/identity/json/identity_client.py
similarity index 92%
rename from tempest/services/identity/json/admin_client.py
rename to tempest/services/identity/json/identity_client.py
index c4e6c95..9cc30d9 100644
--- a/tempest/services/identity/json/admin_client.py
+++ b/tempest/services/identity/json/identity_client.py
@@ -5,11 +5,11 @@
from tempest import exceptions
-class AdminClientJSON(RestClient):
+class IdentityClientJSON(RestClient):
def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AdminClientJSON, self).__init__(config, username, password,
- auth_url, tenant_name)
+ super(IdentityClientJSON, self).__init__(config, username, password,
+ auth_url, tenant_name)
self.service = self.config.identity.catalog_type
self.endpoint_url = 'adminURL'
@@ -206,7 +206,15 @@
class TokenClientJSON(RestClient):
def __init__(self, config):
- self.auth_url = config.identity.auth_url
+ auth_url = config.identity.uri
+
+ # TODO(jaypipes) Why is this all repeated code in here?
+ # Normalize URI to ensure /tokens is in it.
+ if 'tokens' not in auth_url:
+ auth_url = auth_url.rstrip('/') + '/tokens'
+
+ self.auth_url = auth_url
+ self.config = config
def auth(self, user, password, tenant):
creds = {
@@ -225,7 +233,8 @@
def request(self, method, url, headers=None, body=None):
"""A simple HTTP request interface."""
- self.http_obj = httplib2.Http()
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ self.http_obj = httplib2.Http(disable_ssl_certificate_validation=dscv)
if headers is None:
headers = {}
diff --git a/tempest/services/identity/xml/admin_client.py b/tempest/services/identity/xml/identity_client.py
similarity index 93%
rename from tempest/services/identity/xml/admin_client.py
rename to tempest/services/identity/xml/identity_client.py
index 60897e9..02be91e 100644
--- a/tempest/services/identity/xml/admin_client.py
+++ b/tempest/services/identity/xml/identity_client.py
@@ -33,11 +33,11 @@
XMLNS = "http://docs.openstack.org/identity/api/v2.0"
-class AdminClientXML(RestClientXML):
+class IdentityClientXML(RestClientXML):
def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AdminClientXML, self).__init__(config, username, password,
- auth_url, tenant_name)
+ super(IdentityClientXML, self).__init__(config, username, password,
+ auth_url, tenant_name)
self.service = self.config.identity.catalog_type
self.endpoint_url = 'adminURL'
@@ -242,7 +242,15 @@
class TokenClientXML(RestClientXML):
def __init__(self, config):
- self.auth_url = config.identity.auth_url
+ auth_url = config.identity.uri
+
+ # TODO(jaypipes) Why is this all repeated code in here?
+ # Normalize URI to ensure /tokens is in it.
+ if 'tokens' not in auth_url:
+ auth_url = auth_url.rstrip('/') + '/tokens'
+
+ self.auth_url = auth_url
+ self.config = config
def auth(self, user, password, tenant):
passwordCreds = Element("passwordCredentials",
@@ -257,7 +265,8 @@
def request(self, method, url, headers=None, body=None):
"""A simple HTTP request interface."""
- self.http_obj = httplib2.Http()
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ self.http_obj = httplib2.Http(disable_ssl_certificate_validation=dscv)
if headers is None:
headers = {}
diff --git a/tempest/services/image/service.py b/tempest/services/image/service.py
index 154b5b8..270bf03 100644
--- a/tempest/services/image/service.py
+++ b/tempest/services/image/service.py
@@ -41,12 +41,14 @@
import glanceclient
import keystoneclient.v2_0.client
- auth_url = self.config.identity.auth_url.rstrip('tokens')
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ auth_url = self.config.identity.uri
keystone = keystoneclient.v2_0.client.Client(
- username=config.images.username,
- password=config.images.password,
- tenant_name=config.images.tenant_name,
- auth_url=auth_url)
+ username=config.compute.username,
+ password=config.compute.password,
+ tenant_name=config.compute.tenant_name,
+ auth_url=auth_url,
+ insecure=dscv)
token = keystone.auth_token
endpoint = keystone.service_catalog.url_for(
service_type='image',
@@ -54,7 +56,8 @@
self._client = glanceclient.Client('1',
endpoint=endpoint,
- token=token)
+ token=token,
+ insecure=dscv)
else:
raise NotImplementedError
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index 26f8329..734307c 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -15,10 +15,12 @@
# License for the specific language governing permissions and limitations
# under the License.
+import httplib2
import json
import urllib
from tempest.common.rest_client import RestClient
+from tempest import exceptions
class AccountClient(RestClient):
@@ -89,3 +91,66 @@
resp, body = self.get(url)
body = json.loads(body)
return resp, body
+
+
+class AccountClientCustomizedHeader(RestClient):
+
+ def __init__(self, config, username, password, auth_url, tenant_name=None):
+ super(AccountClientCustomizedHeader, self).__init__(config, username,
+ password, auth_url,
+ tenant_name)
+ #Overwrites json-specific header encoding in RestClient
+ self.service = self.config.object_storage.catalog_type
+ self.format = 'json'
+
+ def request(self, method, url, headers=None, body=None, wait=None):
+ """A simple HTTP request interface."""
+ self.http_obj = httplib2.Http()
+ if headers is None:
+ headers = {}
+ if self.base_url is None:
+ self._set_auth()
+
+ req_url = "%s/%s" % (self.base_url, url)
+ resp, resp_body = self.http_obj.request(req_url, method,
+ headers=headers, body=body)
+
+ if resp.status == 401 or resp.status == 403:
+ self._log(req_url, body, resp, resp_body)
+ raise exceptions.Unauthorized()
+
+ return resp, resp_body
+
+ def list_account_containers(self, params=None, metadata=None):
+ """
+ GET on the (base) storage URL
+ Given the X-Storage-URL and a valid X-Auth-Token, returns
+ a list of all containers for the account.
+
+ Optional Arguments:
+ limit=[integer value N]
+ Limits the number of results to at most N values
+ DEFAULT: 10,000
+
+ marker=[string value X]
+ Given string value X, return object names greater in value
+ than the specified marker.
+ DEFAULT: No Marker
+
+ format=[string value, either 'json' or 'xml']
+ Specify either json or xml to return the respective serialized
+ response.
+ DEFAULT: Python-List returned in response body
+ """
+
+ url = '?format=%s' % self.format
+ if params:
+ url += '&%s' + urllib.urlencode(params)
+
+ headers = {}
+ if metadata:
+ for key in metadata:
+ headers[str(key)] = metadata[key]
+
+ resp, body = self.get(url, headers=headers)
+ return resp, body
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index c05c905..edfb234 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -15,11 +15,14 @@
# License for the specific language governing permissions and limitations
# under the License.
+from hashlib import sha1
+import hmac
import httplib2
import json
import re
from tempest.common.rest_client import RestClient
from tempest import exceptions
+from urlparse import urlparse
class ObjectClient(RestClient):
@@ -120,6 +123,29 @@
resp, body = self.copy(url, headers=headers)
return resp, body
+ def get_object_using_temp_url(self, container, object_name, expires, key):
+ """Retrieve object's data using temp URL."""
+
+ self._set_auth()
+ method = 'GET'
+ path = "%s/%s/%s" % (urlparse(self.base_url).path, container,
+ object_name)
+ hmac_body = '%s\n%s\n%s' % (method, expires, path)
+ sig = hmac.new(key, hmac_body, sha1).hexdigest()
+
+ url = "%s/%s?temp_url_sig=%s&temp_url_expires=%s" % (container,
+ object_name,
+ sig, expires)
+
+ resp, body = self.get(url)
+ return resp, body
+
+ def create_object_segments(self, container, object_name, segment, data):
+ """Creates object segments."""
+ url = "{0}/{1}/{2}".format(container, object_name, segment)
+ resp, body = self.put(url, data, self.headers)
+ return resp, body
+
class ObjectClientCustomizedHeader(RestClient):
@@ -133,7 +159,8 @@
def request(self, method, url, headers=None, body=None, wait=None):
"""A simple HTTP request interface."""
- self.http_obj = httplib2.Http()
+ dscv = self.config.identity.disable_ssl_certificate_validation
+ self.http_obj = httplib2.Http(disable_ssl_certificate_validation=dscv)
if headers is None:
headers = {}
if self.base_url is None:
@@ -172,9 +199,14 @@
resp, body = self.put(url, data, headers=headers)
return resp, body
- def delete_object(self, container, object_name):
+ def delete_object(self, container, object_name, metadata=None):
"""Delete storage object."""
+ headers = {}
+ if metadata:
+ for key in metadata:
+ headers[str(key)] = metadata[key]
+
url = "%s/%s" % (str(container), str(object_name))
- resp, body = self.delete(url)
+ resp, body = self.delete(url, headers=headers)
return resp, body
diff --git a/tempest/testboto.py b/tempest/testboto.py
index c38bf99..29ac3ca 100644
--- a/tempest/testboto.py
+++ b/tempest/testboto.py
@@ -22,9 +22,11 @@
import boto
from boto.exception import BotoServerError
+from boto.exception import EC2ResponseError
from boto.s3.bucket import Bucket
from boto.s3.key import Key
import nose
+import testresources
import unittest2 as unittest
from tempest.exceptions import TearDownException
@@ -121,8 +123,12 @@
return string + ")"
-class BotoTestCase(unittest.TestCase):
+class BotoTestCase(unittest.TestCase,
+ testresources.ResourcedTestCase):
"""Recommended to use as base class for boto related test."""
+
+ resources = [('boto_init', tempest.tests.boto.generic_setup_package())]
+
@classmethod
def setUpClass(cls):
# The trash contains cleanup functions and paramaters in tuples
@@ -203,26 +209,32 @@
'deleting', 'deleted', 'error'))
valid_snapshot_status = set(('pending', 'completed', 'error'))
- #TODO(afazekas): object base version for resurces supports update
- def waitImageState(self, lfunction, wait_for):
- state = state_wait(lfunction, wait_for, self.valid_image_state)
- self.assertIn(state, self.valid_image_state)
+ gone_set = set(('_GONE',))
+
+ def state_wait_gone(self, lfunction, final_set, valid_set):
+ if not isinstance(final_set, set):
+ final_set = set((final_set,))
+ final_set |= self.gone_set
+ state = state_wait(lfunction, final_set, valid_set)
+ self.assertIn(state, valid_set | self.gone_set)
return state
+ #TODO(afazekas): object based versions for resurces which supports update
+ def waitImageState(self, lfunction, wait_for):
+ return self.state_wait_gone(lfunction, wait_for,
+ self.valid_image_state)
+
def waitInstanceState(self, lfunction, wait_for):
- state = state_wait(lfunction, wait_for, self.valid_instance_state)
- self.assertIn(state, self.valid_instance_state)
- return state
+ return self.state_wait_gone(lfunction, wait_for,
+ self.valid_instance_state)
def waitVolumeStatus(self, lfunction, wait_for):
- state = state_wait(lfunction, wait_for, self.valid_volume_status)
- self.assertIn(state, self.valid_volume_status)
- return state
+ return self.state_wait_gone(lfunction, wait_for,
+ self.valid_volume_status)
def waitSnapshotStatus(self, lfunction, wait_for):
- state = state_wait(lfunction, wait_for, self.valid_snapshot_status)
- self.assertIn(state, self.valid_snapshot_status)
- return state
+ return self.state_wait_gone(lfunction, wait_for,
+ self.valid_snapshot_status)
def assertImageStateWait(self, lfunction, wait_for):
state = self.waitImageState(lfunction, wait_for)
@@ -323,13 +335,22 @@
try:
instance.update(validate=True)
except ValueError:
- return "terminated"
+ return "_GONE"
+ except EC2ResponseError as exc:
+ if cls.ec2_error_code.\
+ client.InvalidInstanceID.NotFound.match(exc):
+ return "_GONE"
+ #NOTE(afazekas): incorrect code,
+ # but the resource must be destoreyd
+ if exc.error_code == "InstanceNotFound":
+ return "_GONE"
+
return instance.state
for instance in reservation.instances:
try:
instance.terminate()
- re_search_wait(_instance_state, "terminated")
+ re_search_wait(_instance_state, "_GONE")
except BaseException as exc:
LOG.exception(exc)
exc_num += 1
@@ -345,8 +366,6 @@
Use just for teardown!
"""
#NOTE(afazekas): should wait/try until all related instance terminates
- #2. looks like it is locked even if the instance not listed
- time.sleep(1)
group.delete()
@classmethod
diff --git a/tempest/tests/boto/__init__.py b/tempest/tests/boto/__init__.py
index 62918c2..6d5149e 100644
--- a/tempest/tests/boto/__init__.py
+++ b/tempest/tests/boto/__init__.py
@@ -32,7 +32,7 @@
EC2_CAN_CONNECT_ERROR = "Unknown Error"
-def setup_package():
+def generic_setup_package():
global A_I_IMAGES_READY
global S3_CAN_CONNECT_ERROR
global EC2_CAN_CONNECT_ERROR
@@ -85,7 +85,7 @@
s3client = openstack.s3_client
try:
s3client.get_bucket("^INVALID*#()@INVALID.")
- except boto.exception.BotoServerError as exc:
+ except boto.exception.BotoServerError as exc:
if exc.status == 403:
_cred_sub_check(s3client.connection_data)
except Exception as exc:
diff --git a/tempest/tests/boto/test_ec2_instance_run.py b/tempest/tests/boto/test_ec2_instance_run.py
index 331e54c..6a8778a 100644
--- a/tempest/tests/boto/test_ec2_instance_run.py
+++ b/tempest/tests/boto/test_ec2_instance_run.py
@@ -18,6 +18,7 @@
from contextlib import closing
import logging
+from boto.exception import EC2ResponseError
from boto.s3.key import Key
import nose
from nose.plugins.attrib import attr
@@ -121,7 +122,7 @@
self.cancelResourceCleanUp(rcuk)
@attr(type='smoke')
- @unittest.skip("Skipped until the Bug #1098112 is resolved")
+ @unittest.skip("Skipped until the Bug #1098891 is resolved")
def test_run_terminate_instance(self):
# EC2 run, terminate immediately
image_ami = self.ec2_client.get_image(self.images["ami"]
@@ -132,9 +133,18 @@
for instance in reservation.instances:
instance.terminate()
-
- instance.update(validate=True)
- self.assertNotEqual(instance.state, "running")
+ try:
+ instance.update(validate=True)
+ except ValueError:
+ pass
+ except EC2ResponseError as exc:
+ if self.ec2_error_code.\
+ client.InvalidInstanceID.NotFound.match(exc):
+ pass
+ else:
+ raise
+ else:
+ self.assertNotEqual(instance.state, "running")
#NOTE(afazekas): doctored test case,
# with normal validation it would fail
diff --git a/tempest/tests/boto/test_ec2_volumes.py b/tempest/tests/boto/test_ec2_volumes.py
index 7898926..ee7fa3f 100644
--- a/tempest/tests/boto/test_ec2_volumes.py
+++ b/tempest/tests/boto/test_ec2_volumes.py
@@ -62,7 +62,7 @@
self.cancelResourceCleanUp(cuk)
@attr(type='smoke')
- def test_create_volme_from_snapshot(self):
+ def test_create_volume_from_snapshot(self):
# EC2 Create volume from snapshot
volume = self.client.create_volume(1, self.zone)
self.addResourceCleanUp(self.client.delete_volume, volume.id)
diff --git a/tempest/tests/compute/__init__.py b/tempest/tests/compute/__init__.py
index 0258708..a00ec77 100644
--- a/tempest/tests/compute/__init__.py
+++ b/tempest/tests/compute/__init__.py
@@ -21,6 +21,7 @@
from tempest import clients
from tempest import config
+from tempest.exceptions import InvalidConfiguration
LOG = logging.getLogger(__name__)
@@ -36,7 +37,7 @@
# All compute tests -- single setup function
-def setup_package():
+def generic_setup_package():
LOG.debug("Entering tempest.tests.compute.setup_package")
global MULTI_USER, DISK_CONFIG_ENABLED, FLAVOR_EXTRA_DATA_ENABLED
@@ -51,19 +52,15 @@
# Validate reference data exists
# If not, we raise the exception here and prevent
# going forward...
- try:
- image_ref = CONFIG.compute.image_ref
- image_ref_alt = CONFIG.compute.image_ref_alt
- images_client.get_image(image_ref)
- images_client.get_image(image_ref_alt)
+ image_ref = CONFIG.compute.image_ref
+ image_ref_alt = CONFIG.compute.image_ref_alt
+ images_client.get_image(image_ref)
+ images_client.get_image(image_ref_alt)
- flavor_ref = CONFIG.compute.flavor_ref
- flavor_ref_alt = CONFIG.compute.flavor_ref_alt
- flavors_client.get_flavor_details(flavor_ref)
- flavors_client.get_flavor_details(flavor_ref_alt)
- except Exception as e:
- msg = "Failed basic configuration: %s" % e
- raise nose.SkipTest(msg)
+ flavor_ref = CONFIG.compute.flavor_ref
+ flavor_ref_alt = CONFIG.compute.flavor_ref_alt
+ flavors_client.get_flavor_details(flavor_ref)
+ flavors_client.get_flavor_details(flavor_ref_alt)
# Determine if there are two regular users that can be
# used in testing. If the test cases are allowed to create
@@ -79,6 +76,7 @@
user2_tenant_name = CONFIG.compute.alt_tenant_name
if not user2_password or not user2_tenant_name:
msg = ("Alternate user specified but not alternate "
- "tenant or password")
- raise nose.SkipTest(msg)
+ "tenant or password: alt_tenant_name=%s alt_password=%s"
+ % (user2_tenant_name, user2_password))
+ raise InvalidConfiguration(msg)
MULTI_USER = True
diff --git a/tempest/tests/compute/admin/test_flavors.py b/tempest/tests/compute/admin/test_flavors.py
index 8172bd4..4859308 100644
--- a/tempest/tests/compute/admin/test_flavors.py
+++ b/tempest/tests/compute/admin/test_flavors.py
@@ -19,6 +19,8 @@
from nose.plugins.attrib import attr
import unittest2 as unittest
+from tempest.common.utils.data_utils import rand_int_id
+from tempest.common.utils.data_utils import rand_name
from tempest.tests import compute
from tempest.tests.compute import base
@@ -36,12 +38,11 @@
raise nose.SkipTest(msg)
cls.client = cls.os.flavors_client
- cls.flavor_name = 'test_flavor'
+ cls.flavor_name_prefix = 'test_flavor_'
cls.ram = 512
cls.vcpus = 1
cls.disk = 10
cls.ephemeral = 10
- cls.new_flavor_id = 1234
cls.swap = 1024
cls.rxtx = 2
@@ -49,21 +50,24 @@
def test_create_flavor(self):
# Create a flavor and ensure it is listed
# This operation requires the user to have 'admin' role
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
try:
#Create the flavor
- resp, flavor = self.client.create_flavor(self.flavor_name,
+ resp, flavor = self.client.create_flavor(flavor_name,
self.ram, self.vcpus,
self.disk,
- self.new_flavor_id,
+ new_flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
rxtx=self.rxtx)
self.assertEqual(200, resp.status)
- self.assertEqual(flavor['name'], self.flavor_name)
+ self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['vcpus'], self.vcpus)
self.assertEqual(flavor['disk'], self.disk)
self.assertEqual(flavor['ram'], self.ram)
- self.assertEqual(int(flavor['id']), self.new_flavor_id)
+ self.assertEqual(int(flavor['id']), new_flavor_id)
self.assertEqual(flavor['swap'], self.swap)
self.assertEqual(flavor['rxtx_factor'], self.rxtx)
self.assertEqual(flavor['OS-FLV-EXT-DATA:ephemeral'],
@@ -77,26 +81,29 @@
self.assertEqual(flavor['os-flavor-access:is_public'], True)
#Verify flavor is retrieved
- resp, flavor = self.client.get_flavor_details(self.new_flavor_id)
+ resp, flavor = self.client.get_flavor_details(new_flavor_id)
self.assertEqual(resp.status, 200)
- self.assertEqual(flavor['name'], self.flavor_name)
+ self.assertEqual(flavor['name'], flavor_name)
finally:
#Delete the flavor
- resp, body = self.client.delete_flavor(self.new_flavor_id)
+ resp, body = self.client.delete_flavor(new_flavor_id)
self.assertEqual(resp.status, 202)
- self.client.wait_for_resource_deletion(self.new_flavor_id)
+ self.client.wait_for_resource_deletion(new_flavor_id)
@attr(type='positive')
def test_create_flavor_verify_entry_in_list_details(self):
# Create a flavor and ensure it's details are listed
# This operation requires the user to have 'admin' role
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
try:
#Create the flavor
- resp, flavor = self.client.create_flavor(self.flavor_name,
+ resp, flavor = self.client.create_flavor(flavor_name,
self.ram, self.vcpus,
self.disk,
- self.new_flavor_id,
+ new_flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
rxtx=self.rxtx)
@@ -105,62 +112,68 @@
resp, flavors = self.client.list_flavors_with_detail()
self.assertEqual(resp.status, 200)
for flavor in flavors:
- if flavor['name'] == self.flavor_name:
+ if flavor['name'] == flavor_name:
flag = True
self.assertTrue(flag)
finally:
#Delete the flavor
- resp, body = self.client.delete_flavor(self.new_flavor_id)
+ resp, body = self.client.delete_flavor(new_flavor_id)
self.assertEqual(resp.status, 202)
- self.client.wait_for_resource_deletion(self.new_flavor_id)
+ self.client.wait_for_resource_deletion(new_flavor_id)
@attr(type='negative')
def test_get_flavor_details_for_deleted_flavor(self):
# Delete a flavor and ensure it is not listed
# Create a test flavor
- resp, flavor = self.client.create_flavor(self.flavor_name,
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
+ resp, flavor = self.client.create_flavor(flavor_name,
self.ram,
self.vcpus, self.disk,
- self.new_flavor_id,
+ new_flavor_id,
ephemeral=self.ephemeral,
swap=self.swap,
rxtx=self.rxtx)
self.assertEquals(200, resp.status)
# Delete the flavor
- resp, _ = self.client.delete_flavor(self.new_flavor_id)
+ resp, _ = self.client.delete_flavor(new_flavor_id)
self.assertEqual(resp.status, 202)
# Deleted flavors can be seen via detailed GET
- resp, flavor = self.client.get_flavor_details(self.new_flavor_id)
+ resp, flavor = self.client.get_flavor_details(new_flavor_id)
self.assertEqual(resp.status, 200)
- self.assertEqual(flavor['name'], self.flavor_name)
+ self.assertEqual(flavor['name'], flavor_name)
# Deleted flavors should not show up in a list however
resp, flavors = self.client.list_flavors_with_detail()
self.assertEqual(resp.status, 200)
flag = True
for flavor in flavors:
- if flavor['name'] == self.flavor_name:
+ if flavor['name'] == flavor_name:
flag = False
self.assertTrue(flag)
def test_create_list_flavor_without_extra_data(self):
#Create a flavor and ensure it is listed
#This operation requires the user to have 'admin' role
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
try:
#Create the flavor
- resp, flavor = self.client.create_flavor(self.flavor_name,
+ resp, flavor = self.client.create_flavor(flavor_name,
self.ram, self.vcpus,
self.disk,
- self.new_flavor_id)
+ new_flavor_id)
self.assertEqual(200, resp.status)
- self.assertEqual(flavor['name'], self.flavor_name)
+ self.assertEqual(flavor['name'], flavor_name)
self.assertEqual(flavor['ram'], self.ram)
self.assertEqual(flavor['vcpus'], self.vcpus)
self.assertEqual(flavor['disk'], self.disk)
- self.assertEqual(int(flavor['id']), self.new_flavor_id)
+ self.assertEqual(int(flavor['id']), new_flavor_id)
self.assertEqual(flavor['swap'], '')
self.assertEqual(int(flavor['rxtx_factor']), 1)
self.assertEqual(int(flavor['OS-FLV-EXT-DATA:ephemeral']), 0)
@@ -173,57 +186,63 @@
self.assertEqual(flavor['os-flavor-access:is_public'], True)
#Verify flavor is retrieved
- resp, flavor = self.client.get_flavor_details(self.new_flavor_id)
+ resp, flavor = self.client.get_flavor_details(new_flavor_id)
self.assertEqual(resp.status, 200)
- self.assertEqual(flavor['name'], self.flavor_name)
+ self.assertEqual(flavor['name'], flavor_name)
#Check if flavor is present in list
resp, flavors = self.client.list_flavors_with_detail()
self.assertEqual(resp.status, 200)
for flavor in flavors:
- if flavor['name'] == self.flavor_name:
+ if flavor['name'] == flavor_name:
flag = True
self.assertTrue(flag)
finally:
#Delete the flavor
- resp, body = self.client.delete_flavor(self.new_flavor_id)
+ resp, body = self.client.delete_flavor(new_flavor_id)
self.assertEqual(resp.status, 202)
- self.client.wait_for_resource_deletion(self.new_flavor_id)
+ self.client.wait_for_resource_deletion(new_flavor_id)
@attr(type='positive')
def test_flavor_not_public_verify_entry_not_in_list_details(self):
#Create a flavor with os-flavor-access:is_public false should not
#be present in list_details.
#This operation requires the user to have 'admin' role
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
try:
#Create the flavor
- resp, flavor = self.client.create_flavor(self.flavor_name,
+ resp, flavor = self.client.create_flavor(flavor_name,
self.ram, self.vcpus,
self.disk,
- self.new_flavor_id,
+ new_flavor_id,
is_public="False")
flag = False
#Verify flavor is retrieved
resp, flavors = self.client.list_flavors_with_detail()
self.assertEqual(resp.status, 200)
for flavor in flavors:
- if flavor['name'] == self.flavor_name:
+ if flavor['name'] == flavor_name:
flag = True
self.assertFalse(flag)
finally:
#Delete the flavor
- resp, body = self.client.delete_flavor(self.new_flavor_id)
+ resp, body = self.client.delete_flavor(new_flavor_id)
self.assertEqual(resp.status, 202)
def test_list_public_flavor_with_other_user(self):
#Create a Flavor with public access.
#Try to List/Get flavor with another user
+ flavor_name = rand_name(self.flavor_name_prefix)
+ new_flavor_id = rand_int_id(start=1000)
+
try:
#Create the flavor
- resp, flavor = self.client.create_flavor(self.flavor_name,
+ resp, flavor = self.client.create_flavor(flavor_name,
self.ram, self.vcpus,
self.disk,
- self.new_flavor_id,
+ new_flavor_id,
is_public="True")
flag = False
self.new_client = self.flavors_client
@@ -231,14 +250,14 @@
resp, flavors = self.new_client.list_flavors_with_detail()
self.assertEqual(resp.status, 200)
for flavor in flavors:
- if flavor['name'] == self.flavor_name:
+ if flavor['name'] == flavor_name:
flag = True
self.assertTrue(flag)
finally:
#Delete the flavor
- resp, body = self.client.delete_flavor(self.new_flavor_id)
+ resp, body = self.client.delete_flavor(new_flavor_id)
self.assertEqual(resp.status, 202)
- self.client.wait_for_resource_deletion(self.new_flavor_id)
+ self.client.wait_for_resource_deletion(new_flavor_id)
class FlavorsAdminTestXML(base.BaseComputeAdminTestXML,
diff --git a/tempest/tests/compute/admin/test_flavors_extra_specs.py b/tempest/tests/compute/admin/test_flavors_extra_specs.py
new file mode 100644
index 0000000..2645153
--- /dev/null
+++ b/tempest/tests/compute/admin/test_flavors_extra_specs.py
@@ -0,0 +1,158 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2012 OpenStack, LLC
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import nose
+from nose.plugins.attrib import attr
+
+from tempest import exceptions
+from tempest.tests import compute
+from tempest.tests.compute import base
+import unittest2 as unittest
+
+
+class FlavorsExtraSpecsTestBase(object):
+
+ """
+ Tests Flavor Extra Spec API extension.
+ SET, UNSET Flavor Extra specs require admin privileges.
+ GET Flavor Extra specs can be performed even by without admin privileges.
+ """
+
+ @classmethod
+ def setUpClass(self, cls):
+ if not compute.FLAVOR_EXTRA_DATA_ENABLED:
+ msg = "FlavorExtraData extension not enabled."
+ raise nose.SkipTest(msg)
+
+ cls.client = cls.os.flavors_client
+ flavor_name = 'test_flavor2'
+ ram = 512
+ vcpus = 1
+ disk = 10
+ ephemeral = 10
+ cls.new_flavor_id = 12345
+ swap = 1024
+ rxtx = 1
+ #Create a flavor so as to set/get/unset extra specs
+ resp, cls.flavor = cls.client.create_flavor(flavor_name,
+ ram, vcpus,
+ disk,
+ cls.new_flavor_id,
+ ephemeral=ephemeral,
+ swap=swap, rxtx=rxtx)
+
+ @classmethod
+ def tearDownClass(self, cls):
+ resp, body = cls.client.delete_flavor(cls.flavor['id'])
+
+ def test_flavor_set_get_unset_keys(self):
+ #Test to SET, GET UNSET flavor extra spec as a user
+ #with admin privileges.
+ #Assigning extra specs values that are to be set
+ specs = {"key1": "value1", "key2": "value2"}
+ #SET extra specs to the flavor created in setUp
+ set_resp, set_body = \
+ self.client.set_flavor_extra_spec(self.flavor['id'], specs)
+ self.assertEqual(set_resp.status, 200)
+ self.assertEqual(set_body, specs)
+ #GET extra specs and verify
+ get_resp, get_body = \
+ self.client.get_flavor_extra_spec(self.flavor['id'])
+ self.assertEqual(get_resp.status, 200)
+ self.assertEqual(get_body, specs)
+ #UNSET extra specs that were set in this test
+ unset_resp, _ = \
+ self.client.unset_flavor_extra_spec(self.flavor['id'], "key1")
+ self.assertEqual(unset_resp.status, 200)
+
+ @unittest.skip('Until bug 1094142 is resolved.')
+ def test_flavor_non_admin_set_get_unset_keys(self):
+ #Test to SET, GET UNSET flavor extra spec as a user
+ #with out admin privileges.
+ self.nonadmin_client = self.flavors_client
+ #Assigning extra specs values that are to be set
+ specs = {"key1": "value1", "key2": "value2"}
+ msg = None
+
+ #Verify if able to SET flavor extraspec with non-admin user
+ try:
+ set_resp, set_body = \
+ self.nonadmin_client.set_flavor_extra_spec(
+ self.flavor['id'], specs)
+ except exceptions.Unauthorized:
+ pass
+ else:
+ msg = "Flavor extra specs is being SET"
+ msg += " by unauthorized non-admin user.\n"
+ #SET flavor extra specs with admin user
+ #so as to check GET/UNSET flavor extra specs with non-admin
+ set_resp, set_body =\
+ self.client.set_flavor_extra_spec(self.flavor['id'], specs)
+ #Verify if able to GET flavor extraspec with non-admin user
+ try:
+ get_resp, get_body = \
+ self.nonadmin_client.get_flavor_extra_spec('')
+ self.assertEqual(get_resp.status, 200)
+ except Exception as e:
+ msg += "Got an exception when GET Flavor extra specs"
+ msg += " by non-admin user. Exception is: %s\n" % e
+ #Verify if able to UNSET flavor extraspec with non-admin user
+ try:
+ unset_resp, _ = \
+ self.nonadmin_client.unset_flavor_extra_spec(self.flavor['id'],
+ "key1")
+ except exceptions.Unauthorized:
+ pass
+ else:
+ msg += "Flavor extra specs is being UNSET"
+ msg += " by unauthorized non-admin user.\n"
+ #Verification to check if actions failed.
+ #msg variable would contain the message according to the failures.
+ if msg is not None:
+ self.fail(msg)
+
+
+class FlavorsExtraSpecsTestXML(base.BaseComputeAdminTestXML,
+ base.BaseComputeTestXML,
+ FlavorsExtraSpecsTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(FlavorsExtraSpecsTestXML, cls).setUpClass()
+ base.BaseComputeTestXML.setUpClass()
+ FlavorsExtraSpecsTestBase.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ FlavorsExtraSpecsTestBase.tearDownClass(cls)
+ super(FlavorsExtraSpecsTestXML, cls).tearDownClass()
+
+
+class FlavorsExtraSpecsTestJSON(base.BaseComputeAdminTestJSON,
+ base.BaseComputeTestJSON,
+ FlavorsExtraSpecsTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(FlavorsExtraSpecsTestJSON, cls).setUpClass()
+ base.BaseComputeTestJSON.setUpClass()
+ FlavorsExtraSpecsTestBase.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ FlavorsExtraSpecsTestBase.tearDownClass(cls)
+ super(FlavorsExtraSpecsTestJSON, cls).tearDownClass()
diff --git a/tempest/tests/compute/admin/test_quotas.py b/tempest/tests/compute/admin/test_quotas.py
index 452de80..eaf245a 100644
--- a/tempest/tests/compute/admin/test_quotas.py
+++ b/tempest/tests/compute/admin/test_quotas.py
@@ -30,7 +30,7 @@
adm_user = cls.config.compute_admin.username
adm_pass = cls.config.compute_admin.password
adm_tenant = cls.config.compute_admin.tenant_name
- auth_url = cls.config.identity.auth_url
+ auth_url = cls.config.identity.uri
cls.adm_client = adm_quotas.AdminQuotasClient(cls.config, adm_user,
adm_pass, auth_url,
diff --git a/tempest/tests/compute/base.py b/tempest/tests/compute/base.py
index 8044d01..3f3b3e8 100644
--- a/tempest/tests/compute/base.py
+++ b/tempest/tests/compute/base.py
@@ -19,12 +19,14 @@
import time
import nose
+import testresources
import unittest2 as unittest
from tempest import clients
from tempest.common.utils.data_utils import rand_name
from tempest import config
from tempest import exceptions
+from tempest.tests import compute
__all__ = ['BaseComputeTest', 'BaseComputeTestJSON', 'BaseComputeTestXML',
'BaseComputeAdminTestJSON', 'BaseComputeAdminTestXML']
@@ -32,10 +34,13 @@
LOG = logging.getLogger(__name__)
-class BaseCompTest(unittest.TestCase):
+class BaseCompTest(unittest.TestCase,
+ testresources.ResourcedTestCase):
"""Base test case class for all Compute API tests."""
+ resources = [('compute_init', compute.generic_setup_package())]
+
@classmethod
def setUpClass(cls):
cls.config = config.TempestConfig()
@@ -78,8 +83,8 @@
"""
Returns an instance of the Identity Admin API client
"""
- os = clients.IdentityManager(interface=cls._interface)
- admin_client = os.admin_client
+ os = clients.AdminManager(interface=cls._interface)
+ admin_client = os.identity_client
return admin_client
@classmethod
@@ -87,9 +92,9 @@
return (
cls.config,
- cls.config.identity_admin.username,
- cls.config.identity_admin.password,
- cls.config.identity.auth_url
+ cls.config.compute_admin.username,
+ cls.config.compute_admin.password,
+ cls.config.identity.uri
)
@classmethod
diff --git a/tempest/tests/compute/flavors/test_flavors.py b/tempest/tests/compute/flavors/test_flavors.py
index 53cad65..298984f 100644
--- a/tempest/tests/compute/flavors/test_flavors.py
+++ b/tempest/tests/compute/flavors/test_flavors.py
@@ -104,7 +104,7 @@
flavors = sorted(flavors, key=lambda k: k['ram'])
flavor_id = flavors[0]['id']
- params = {'minRam': flavors[1]['ram']}
+ params = {'minRam': flavors[0]['ram'] + 1}
resp, flavors = self.client.list_flavors_with_detail(params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
@@ -126,7 +126,7 @@
flavors = sorted(flavors, key=lambda k: k['ram'])
flavor_id = flavors[0]['id']
- params = {'minRam': flavors[1]['ram']}
+ params = {'minRam': flavors[0]['ram'] + 1}
resp, flavors = self.client.list_flavors(params)
self.assertFalse(any([i for i in flavors if i['id'] == flavor_id]))
diff --git a/tempest/tests/compute/images/test_images.py b/tempest/tests/compute/images/test_images.py
index 95678a2..2557f16 100644
--- a/tempest/tests/compute/images/test_images.py
+++ b/tempest/tests/compute/images/test_images.py
@@ -42,40 +42,6 @@
self.client.delete_image(image_id)
self.image_ids.remove(image_id)
- @attr(type='smoke')
- @unittest.skipUnless(compute.CREATE_IMAGE_ENABLED,
- 'Environment unable to create images.')
- def test_create_delete_image(self):
- # An image for the provided server should be created
- server_name = rand_name('server')
- resp, server = self.servers_client.create_server(server_name,
- self.image_ref,
- self.flavor_ref)
- self.servers_client.wait_for_server_status(server['id'], 'ACTIVE')
-
- # Create a new image
- name = rand_name('image')
- meta = {'image_type': 'test'}
- resp, body = self.client.create_image(server['id'], name, meta)
- self.assertEqual(202, resp.status)
- image_id = parse_image_id(resp['location'])
- self.client.wait_for_image_resp_code(image_id, 200)
- self.client.wait_for_image_status(image_id, 'ACTIVE')
-
- # Verify the image was created correctly
- resp, image = self.client.get_image(image_id)
- self.assertEqual(name, image['name'])
- self.assertEqual('test', image['metadata']['image_type'])
-
- # Verify minRAM and minDisk values are the same as the original image
- resp, original_image = self.client.get_image(self.image_ref)
- self.assertEqual(original_image['minRam'], image['minRam'])
- self.assertEqual(original_image['minDisk'], image['minDisk'])
-
- # Teardown
- self.client.delete_image(image['id'])
- self.servers_client.delete_server(server['id'])
-
@attr(type='negative')
def test_create_image_from_deleted_server(self):
# An image should not be created if the server instance is removed
@@ -126,13 +92,13 @@
"with invalid server id")
@attr(type='negative')
- @unittest.skipUnless(compute.MULTI_USER, 'Second user not configured')
- def test_create_image_for_server_in_another_tenant(self):
- # Creating image of another tenant's server should be return error
+ def test_create_image_when_server_is_terminating(self):
+ # Return an error when creating image of server that is terminating
server = self.create_server()
+ self.servers_client.delete_server(server['id'])
snapshot_name = rand_name('test-snap-')
- self.assertRaises(exceptions.NotFound, self.alt_client.create_image,
+ self.assertRaises(exceptions.Duplicate, self.client.create_image,
server['id'], snapshot_name)
@attr(type='negative')
@@ -159,52 +125,6 @@
server['id'], snapshot_name)
@attr(type='negative')
- def test_create_image_when_server_is_terminating(self):
- # Return an error when creating image of server that is terminating
- server = self.create_server()
- self.servers_client.delete_server(server['id'])
-
- snapshot_name = rand_name('test-snap-')
- self.assertRaises(exceptions.Duplicate, self.client.create_image,
- server['id'], snapshot_name)
-
- @attr(type='negative')
- def test_create_second_image_when_first_image_is_being_saved(self):
- # Disallow creating another image when first image is being saved
- server = self.create_server()
-
- try:
- # Create first snapshot
- snapshot_name = rand_name('test-snap-')
- resp, body = self.client.create_image(server['id'], snapshot_name)
- image_id = parse_image_id(resp['location'])
- self.image_ids.append(image_id)
-
- # Create second snapshot
- alt_snapshot_name = rand_name('test-snap-')
- self.client.create_image(server['id'], alt_snapshot_name)
- except exceptions.Duplicate:
- pass
-
- else:
- self.fail("Should allow creating an image when another image of"
- "the server is still being saved")
-
- @attr(type='negative')
- @unittest.skip("Until Bug 1004564 is fixed")
- def test_create_image_specify_name_over_256_chars(self):
- # Return an error if snapshot name over 256 characters is passed
- server = self.create_server()
-
- try:
- snapshot_name = rand_name('a' * 260)
- self.assertRaises(exceptions.BadRequest, self.client.create_image,
- server['id'], snapshot_name)
- except Exception:
- self.fail("Should return 400 Bad Request if image name is over 256"
- " characters")
-
- @attr(type='negative')
def test_create_image_specify_uuid_35_characters_or_less(self):
# Return an error if Image ID passed is 35 characters or less
try:
@@ -229,51 +149,6 @@
" characters or more")
@attr(type='negative')
- @unittest.skip("Until Bug 1006725 is fixed")
- def test_create_image_specify_multibyte_character_image_name(self):
- # Return an error if the image name has multi-byte characters
- server = self.create_server()
-
- try:
- snapshot_name = rand_name('\xef\xbb\xbf')
- self.assertRaises(exceptions.BadRequest,
- self.client.create_image, server['id'],
- snapshot_name)
- except Exception:
- self.fail("Should return 400 Bad Request if multi byte characters"
- " are used for image name")
-
- @attr(type='negative')
- @unittest.skip("Until Bug 1005423 is fixed")
- def test_create_image_specify_invalid_metadata(self):
- # Return an error when creating image with invalid metadata
- server = self.create_server()
-
- try:
- snapshot_name = rand_name('test-snap-')
- meta = {'': ''}
- self.assertRaises(exceptions.BadRequest, self.client.create_image,
- server['id'], snapshot_name, meta)
-
- except Exception:
- self.fail("Should raise 400 Bad Request if meta data is invalid")
-
- @attr(type='negative')
- @unittest.skip("Until Bug 1005423 is fixed")
- def test_create_image_specify_metadata_over_limits(self):
- # Return an error when creating image with meta data over 256 chars
- server = self.create_server()
-
- try:
- snapshot_name = rand_name('test-snap-')
- meta = {'a' * 260: 'b' * 260}
- self.assertRaises(exceptions.OverLimit, self.client.create_image,
- server['id'], snapshot_name, meta)
-
- except Exception:
- self.fail("Should raise 413 Over Limit if meta data was too long")
-
- @attr(type='negative')
def test_delete_image_with_invalid_image_id(self):
# An image should not be deleted with invalid image id
try:
@@ -337,42 +212,6 @@
self.fail("Did not return HTTP 404 NotFound for image id that "
"exceeds 35 character ID length limit")
- @attr(type='negative')
- @unittest.skipUnless(compute.MULTI_USER, 'Second user not configured')
- def test_delete_image_of_another_tenant(self):
- # Return an error while trying to delete another tenant's image
-
- server = self.create_server()
-
- snapshot_name = rand_name('test-snap-')
- resp, body = self.client.create_image(server['id'], snapshot_name)
- image_id = parse_image_id(resp['location'])
- self.image_ids.append(image_id)
- self.client.wait_for_image_resp_code(image_id, 200)
- self.client.wait_for_image_status(image_id, 'ACTIVE')
-
- # Delete image
- self.assertRaises(exceptions.NotFound,
- self.alt_client.delete_image, image_id)
-
- @attr(type='negative')
- def test_delete_image_that_is_not_yet_active(self):
- # Return an error while trying to delete an active that is creating
-
- server = self.create_server()
-
- snapshot_name = rand_name('test-snap-')
- resp, body = self.client.create_image(server['id'], snapshot_name)
- image_id = parse_image_id(resp['location'])
- self.image_ids.append(image_id)
-
- # Do not wait, attempt to delete the image, ensure it's successful
- resp, body = self.client.delete_image(image_id)
- self.assertEqual('204', resp['status'])
- self.image_ids.remove(image_id)
-
- self.assertRaises(exceptions.NotFound, self.client.get_image, image_id)
-
class ImagesTestJSON(base.BaseComputeTestJSON,
ImagesTestBase):
@@ -381,7 +220,6 @@
@classmethod
def setUpClass(cls):
- raise nose.SkipTest("Until Bug 1046870 is fixed")
super(ImagesTestJSON, cls).setUpClass()
cls.client = cls.images_client
cls.servers_client = cls.servers_client
@@ -408,7 +246,6 @@
@classmethod
def setUpClass(cls):
- raise nose.SkipTest("Until Bug 1046870 is fixed")
super(ImagesTestXML, cls).setUpClass()
cls.client = cls.images_client
cls.servers_client = cls.servers_client
diff --git a/tempest/tests/compute/images/test_images_oneserver.py b/tempest/tests/compute/images/test_images_oneserver.py
new file mode 100644
index 0000000..f8b560b
--- /dev/null
+++ b/tempest/tests/compute/images/test_images_oneserver.py
@@ -0,0 +1,243 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2012 OpenStack, LLC
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import nose
+from nose.plugins.attrib import attr
+import unittest2 as unittest
+
+from tempest import clients
+from tempest.common.utils.data_utils import parse_image_id
+from tempest.common.utils.data_utils import rand_name
+import tempest.config
+from tempest import exceptions
+from tempest.tests import compute
+from tempest.tests.compute import base
+
+
+class ImagesOneServerTestBase(object):
+ def tearDownClass(cls):
+ """Terminate test instances created after a test is executed."""
+ resp, body = self.servers_client.delete_server(cls.server['id'])
+ if resp['status'] == '204':
+ self.servers.remove(server)
+ self.servers_client.wait_for_server_termination(cls.server['id'])
+
+ def tearDown(self):
+ """Terminate test instances created after a test is executed."""
+ for image_id in self.image_ids:
+ self.client.delete_image(image_id)
+ self.image_ids.remove(image_id)
+
+ @attr(type='negative')
+ @unittest.skip("Until Bug 1006725 is fixed")
+ def test_create_image_specify_multibyte_character_image_name(self):
+ # Return an error if the image name has multi-byte characters
+ try:
+ snapshot_name = rand_name('\xef\xbb\xbf')
+ self.assertRaises(exceptions.BadRequest,
+ self.client.create_image, self.server['id'],
+ snapshot_name)
+ except Exception:
+ self.fail("Should return 400 Bad Request if multi byte characters"
+ " are used for image name")
+
+ @attr(type='negative')
+ @unittest.skip("Until Bug 1005423 is fixed")
+ def test_create_image_specify_invalid_metadata(self):
+ # Return an error when creating image with invalid metadata
+ try:
+ snapshot_name = rand_name('test-snap-')
+ meta = {'': ''}
+ self.assertRaises(exceptions.BadRequest, self.client.create_image,
+ self.server['id'], snapshot_name, meta)
+
+ except Exception:
+ self.fail("Should raise 400 Bad Request if meta data is invalid")
+
+ @attr(type='negative')
+ @unittest.skip("Until Bug 1005423 is fixed")
+ def test_create_image_specify_metadata_over_limits(self):
+ # Return an error when creating image with meta data over 256 chars
+ try:
+ snapshot_name = rand_name('test-snap-')
+ meta = {'a' * 260: 'b' * 260}
+ self.assertRaises(exceptions.OverLimit, self.client.create_image,
+ self.server['id'], snapshot_name, meta)
+
+ except Exception:
+ self.fail("Should raise 413 Over Limit if meta data was too long")
+
+ @attr(type='negative')
+ @unittest.skipUnless(compute.MULTI_USER,
+ 'Need multiple users for this test.')
+ def test_delete_image_of_another_tenant(self):
+ # Return an error while trying to delete another tenant's image
+ self.servers_client.wait_for_server_status(self.server['id'], 'ACTIVE')
+ snapshot_name = rand_name('test-snap-')
+ resp, body = self.client.create_image(self.server['id'], snapshot_name)
+ image_id = parse_image_id(resp['location'])
+ self.image_ids.append(image_id)
+ self.client.wait_for_image_resp_code(image_id, 200)
+ self.client.wait_for_image_status(image_id, 'ACTIVE')
+
+ # Delete image
+ self.assertRaises(exceptions.NotFound,
+ self.alt_client.delete_image, image_id)
+
+ @attr(type='smoke')
+ @unittest.skipUnless(compute.CREATE_IMAGE_ENABLED,
+ 'Environment unable to create images.')
+ def test_create_delete_image(self):
+
+ # Create a new image
+ name = rand_name('image')
+ meta = {'image_type': 'test'}
+ resp, body = self.client.create_image(self.server['id'], name, meta)
+ self.assertEqual(202, resp.status)
+ image_id = parse_image_id(resp['location'])
+ self.client.wait_for_image_resp_code(image_id, 200)
+ self.client.wait_for_image_status(image_id, 'ACTIVE')
+
+ # Verify the image was created correctly
+ resp, image = self.client.get_image(image_id)
+ self.assertEqual(name, image['name'])
+ self.assertEqual('test', image['metadata']['image_type'])
+
+ # Verify minRAM and minDisk values are the same as the original image
+ resp, original_image = self.client.get_image(self.image_ref)
+ self.assertEqual(original_image['minRam'], image['minRam'])
+ self.assertEqual(original_image['minDisk'], image['minDisk'])
+
+ @attr(type='negative')
+ @unittest.skipUnless(compute.MULTI_USER,
+ 'Need multiple users for this test.')
+ def test_create_image_for_server_in_another_tenant(self):
+ # Creating image of another tenant's server should be return error
+
+ snapshot_name = rand_name('test-snap-')
+ self.assertRaises(exceptions.NotFound, self.alt_client.create_image,
+ self.server['id'], snapshot_name)
+
+ @attr(type='negative')
+ def test_create_second_image_when_first_image_is_being_saved(self):
+ # Disallow creating another image when first image is being saved
+
+ try:
+ # Create first snapshot
+ snapshot_name = rand_name('test-snap-')
+ resp, body = self.client.create_image(self.server['id'],
+ snapshot_name)
+ self.assertEqual(202, resp.status)
+ image_id = parse_image_id(resp['location'])
+ self.image_ids.append(image_id)
+
+ # Create second snapshot
+ alt_snapshot_name = rand_name('test-snap-')
+ self.client.create_image(self.server['id'],
+ alt_snapshot_name)
+ except exceptions.Duplicate:
+ self.client.wait_for_image_status(image_id, 'ACTIVE')
+
+ else:
+ self.fail("Should not allow creating an image when another image "
+ "of the server is still being saved")
+
+ @attr(type='negative')
+ @unittest.skip("Until Bug 1004564 is fixed")
+ def test_create_image_specify_name_over_256_chars(self):
+ # Return an error if snapshot name over 256 characters is passed
+
+ try:
+ snapshot_name = rand_name('a' * 260)
+ self.assertRaises(exceptions.BadRequest, self.client.create_image,
+ self.server['id'], snapshot_name)
+ except Exception:
+ self.fail("Should return 400 Bad Request if image name is over 256"
+ " characters")
+
+ @attr(type='negative')
+ def test_delete_image_that_is_not_yet_active(self):
+ # Return an error while trying to delete an image what is creating
+
+ snapshot_name = rand_name('test-snap-')
+ resp, body = self.client.create_image(self.server['id'], snapshot_name)
+ self.assertEqual(202, resp.status)
+ image_id = parse_image_id(resp['location'])
+ self.image_ids.append(image_id)
+
+ # Do not wait, attempt to delete the image, ensure it's successful
+ resp, body = self.client.delete_image(image_id)
+ self.assertEqual('204', resp['status'])
+ self.image_ids.remove(image_id)
+
+ self.assertRaises(exceptions.NotFound, self.client.get_image, image_id)
+
+
+class ImagesOneServerTestJSON(base.BaseComputeTestJSON,
+ ImagesOneServerTestBase):
+
+ def tearDown(self):
+ ImagesOneServerTestBase.tearDown(self)
+
+ @classmethod
+ def setUpClass(cls):
+ super(ImagesOneServerTestJSON, cls).setUpClass()
+ cls.client = cls.images_client
+ cls.servers_client = cls.servers_client
+ cls.server = cls.create_server()
+
+ cls.image_ids = []
+
+ if compute.MULTI_USER:
+ if cls.config.compute.allow_tenant_isolation:
+ creds = cls._get_isolated_creds()
+ username, tenant_name, password = creds
+ cls.alt_manager = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name)
+ else:
+ # Use the alt_XXX credentials in the config file
+ cls.alt_manager = clients.AltManager()
+ cls.alt_client = cls.alt_manager.images_client
+
+
+class ImagesOneServerTestXML(base.BaseComputeTestXML,
+ ImagesOneServerTestBase):
+
+ def tearDown(self):
+ ImagesOneServerTestBase.tearDown(self)
+
+ @classmethod
+ def setUpClass(cls):
+ super(ImagesOneServerTestXML, cls).setUpClass()
+ cls.client = cls.images_client
+ cls.servers_client = cls.servers_client
+ cls.server = cls.create_server()
+
+ cls.image_ids = []
+
+ if compute.MULTI_USER:
+ if cls.config.compute.allow_tenant_isolation:
+ creds = cls._get_isolated_creds()
+ username, tenant_name, password = creds
+ cls.alt_manager = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name)
+ else:
+ # Use the alt_XXX credentials in the config file
+ cls.alt_manager = clients.AltManager()
+ cls.alt_client = cls.alt_manager.images_client
diff --git a/tempest/tests/compute/servers/test_list_server_filters.py b/tempest/tests/compute/servers/test_list_server_filters.py
index 5eea24f..d943e5d 100644
--- a/tempest/tests/compute/servers/test_list_server_filters.py
+++ b/tempest/tests/compute/servers/test_list_server_filters.py
@@ -208,7 +208,6 @@
ListServerFiltersTest):
@classmethod
def setUpClass(cls):
- raise nose.SkipTest("Until Bug 1039753 is fixed")
super(ListServerFiltersTestJSON, cls).setUpClass()
ListServerFiltersTest.setUpClass(cls)
@@ -222,7 +221,6 @@
ListServerFiltersTest):
@classmethod
def setUpClass(cls):
- raise nose.SkipTest("Until Bug 1039753 is fixed")
super(ListServerFiltersTestXML, cls).setUpClass()
ListServerFiltersTest.setUpClass(cls)
diff --git a/tempest/tests/compute/servers/test_list_servers_negative.py b/tempest/tests/compute/servers/test_list_servers_negative.py
index e98d8f0..035ffe8 100644
--- a/tempest/tests/compute/servers/test_list_servers_negative.py
+++ b/tempest/tests/compute/servers/test_list_servers_negative.py
@@ -131,7 +131,6 @@
self.assertEqual('200', resp['status'])
self.assertEqual([], servers)
- @unittest.skip("Skip until bug 1061712 is resolved")
def test_list_servers_status_non_existing(self):
# Return an empty list when invalid status is specified
non_existing_status = 'BALONEY'
diff --git a/tempest/tests/compute/servers/test_server_actions.py b/tempest/tests/compute/servers/test_server_actions.py
index 91f0674..2fe8464 100644
--- a/tempest/tests/compute/servers/test_server_actions.py
+++ b/tempest/tests/compute/servers/test_server_actions.py
@@ -34,18 +34,6 @@
resize_available = tempest.config.TempestConfig().compute.resize_available
run_ssh = tempest.config.TempestConfig().compute.run_ssh
- def setUp(self):
- self.name = rand_name('server')
- resp, server = self.create_server_with_extras(self.name,
- self.image_ref,
- self.flavor_ref)
- self.server_id = server['id']
- self.password = server['adminPass']
- self.client.wait_for_server_status(self.server_id, 'ACTIVE')
-
- def tearDown(self):
- self.clear_servers()
-
@attr(type='smoke')
@unittest.skipUnless(compute.CHANGE_PASSWORD_AVAILABLE,
'Change password not available.')
@@ -207,27 +195,69 @@
class ServerActionsTestXML(base.BaseComputeTestXML,
ServerActionsTestBase):
+ def setUp(self):
+ super(ServerActionsTestXML, self).setUp()
+ # Check if the server is in a clean state after test
+ try:
+ self.client.wait_for_server_status(self.server_id, 'ACTIVE')
+ except exceptions:
+ # Rebuild server if something happened to it during a test
+ self.clear_servers()
+ resp, server = self.create_server_with_extras(self.name,
+ self.image_ref,
+ self.flavor_ref)
+ self.server_id = server['id']
+ self.password = server['adminPass']
+ self.client.wait_for_server_status(self.server_id, 'ACTIVE')
+
@classmethod
def setUpClass(cls):
super(ServerActionsTestXML, cls).setUpClass()
cls.client = cls.servers_client
+ cls.name = rand_name('server')
+ resp, server = cls.create_server_with_extras(cls.name,
+ cls.image_ref,
+ cls.flavor_ref)
+ cls.server_id = server['id']
+ cls.password = server['adminPass']
+ cls.client.wait_for_server_status(cls.server_id, 'ACTIVE')
- def setUp(self):
- ServerActionsTestBase.setUp(self)
-
- def tearDown(self):
- ServerActionsTestBase.tearDown(self)
+ @classmethod
+ def tearDownClass(cls):
+ cls.clear_servers()
+ super(ServerActionsTestXML, cls).tearDownClass()
class ServerActionsTestJSON(base.BaseComputeTestJSON,
ServerActionsTestBase):
+ def setUp(self):
+ super(ServerActionsTestJSON, self).setUp()
+ # Check if the server is in a clean state after test
+ try:
+ self.client.wait_for_server_status(self.server_id, 'ACTIVE')
+ except exceptions:
+ # Rebuild server if something happened to it during a test
+ self.clear_servers()
+ resp, server = self.create_server_with_extras(self.name,
+ self.image_ref,
+ self.flavor_ref)
+ self.server_id = server['id']
+ self.password = server['adminPass']
+ self.client.wait_for_server_status(self.server_id, 'ACTIVE')
+
@classmethod
def setUpClass(cls):
super(ServerActionsTestJSON, cls).setUpClass()
cls.client = cls.servers_client
+ cls.name = rand_name('server')
+ resp, server = cls.create_server_with_extras(cls.name,
+ cls.image_ref,
+ cls.flavor_ref)
+ cls.server_id = server['id']
+ cls.password = server['adminPass']
+ cls.client.wait_for_server_status(cls.server_id, 'ACTIVE')
- def setUp(self):
- ServerActionsTestBase.setUp(self)
-
- def tearDown(self):
- ServerActionsTestBase.tearDown(self)
+ @classmethod
+ def tearDownClass(cls):
+ cls.clear_servers()
+ super(ServerActionsTestJSON, cls).tearDownClass()
diff --git a/tempest/tests/compute/servers/test_server_basic_ops.py b/tempest/tests/compute/servers/test_server_basic_ops.py
index 3453d86..2183193 100644
--- a/tempest/tests/compute/servers/test_server_basic_ops.py
+++ b/tempest/tests/compute/servers/test_server_basic_ops.py
@@ -37,7 +37,7 @@
* Terminate the instance
"""
- def test_001_create_keypair(self):
+ def create_keypair(self):
kp_name = rand_name('keypair-smoke')
self.keypair = self.compute_client.keypairs.create(kp_name)
try:
@@ -46,7 +46,7 @@
except AttributeError:
self.fail("Keypair object not successfully created.")
- def test_002_create_security_group(self):
+ def create_security_group(self):
sg_name = rand_name('secgroup-smoke')
sg_desc = sg_name + " description"
self.secgroup = self.compute_client.security_groups.create(sg_name,
@@ -82,7 +82,7 @@
except Exception:
self.fail("Failed to create rule in security group.")
- def test_003_boot_instance(self):
+ def boot_instance(self):
i_name = rand_name('instance')
flavor_id = self.config.compute.flavor_ref
base_image_id = self.config.compute.image_ref
@@ -99,11 +99,11 @@
self.assertEqual(self.instance.status, 'BUILD')
- def test_004_wait_on_active(self):
+ def wait_on_active(self):
instance_id = self.get_resource('instance').id
self.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
- def test_005_pause_server(self):
+ def pause_server(self):
instance = self.get_resource('instance')
instance_id = instance.id
LOG.debug("Pausing instance %s. Current status: %s",
@@ -111,7 +111,7 @@
instance.pause()
self.status_timeout(self.compute_client.servers, instance_id, 'PAUSED')
- def test_006_unpause_server(self):
+ def unpause_server(self):
instance = self.get_resource('instance')
instance_id = instance.id
LOG.debug("Unpausing instance %s. Current status: %s",
@@ -119,7 +119,7 @@
instance.unpause()
self.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
- def test_007_suspend_server(self):
+ def suspend_server(self):
instance = self.get_resource('instance')
instance_id = instance.id
LOG.debug("Suspending instance %s. Current status: %s",
@@ -128,7 +128,7 @@
self.status_timeout(self.compute_client.servers,
instance_id, 'SUSPENDED')
- def test_008_resume_server(self):
+ def resume_server(self):
instance = self.get_resource('instance')
instance_id = instance.id
LOG.debug("Resuming instance %s. Current status: %s",
@@ -136,7 +136,18 @@
instance.resume()
self.status_timeout(self.compute_client.servers, instance_id, 'ACTIVE')
- def test_099_terminate_instance(self):
+ def terminate_instance(self):
instance = self.get_resource('instance')
instance.delete()
self.remove_resource('instance')
+
+ def test_server_basicops(self):
+ self.create_keypair()
+ self.create_security_group()
+ self.boot_instance()
+ self.wait_on_active()
+ self.pause_server()
+ self.unpause_server()
+ self.suspend_server()
+ self.resume_server()
+ self.terminate_instance()
diff --git a/tempest/tests/compute/servers/test_servers_negative.py b/tempest/tests/compute/servers/test_servers_negative.py
index 970f6bc..f7624b3 100644
--- a/tempest/tests/compute/servers/test_servers_negative.py
+++ b/tempest/tests/compute/servers/test_servers_negative.py
@@ -176,7 +176,7 @@
# Pass invalid network uuid while creating a server
server_name = rand_name('server')
- networks = [{'fixed_ip': '10.0.1.1', 'uuid':'a-b-c-d-e-f-g-h-i-j'}]
+ networks = [{'fixed_ip': '10.0.1.1', 'uuid': 'a-b-c-d-e-f-g-h-i-j'}]
self.assertRaises(exceptions.BadRequest,
self.create_server_with_extras,
@@ -194,7 +194,6 @@
server_name, self.image_ref, self.flavor_ref,
key_name=key_name)
- @unittest.skip("Until Bug 1004007 is fixed")
@attr(type='negative')
def test_create_server_metadata_exceeds_length_limit(self):
# Pass really long metadata while creating a server
diff --git a/tempest/tests/compute/test_live_block_migration.py b/tempest/tests/compute/test_live_block_migration.py
index 915868c..eceaaba 100644
--- a/tempest/tests/compute/test_live_block_migration.py
+++ b/tempest/tests/compute/test_live_block_migration.py
@@ -43,7 +43,7 @@
def setUpClass(cls):
super(LiveBlockMigrationTest, cls).setUpClass()
- tenant_name = cls.config.identity_admin.tenant_name
+ tenant_name = cls.config.compute_admin.tenant_name
cls.admin_hosts_client = HostsClientJSON(
*cls._get_client_args(), tenant_name=tenant_name)
diff --git a/tempest/tests/identity/admin/test_users.py b/tempest/tests/identity/admin/test_users.py
index 27a214c..7ad932b 100644
--- a/tempest/tests/identity/admin/test_users.py
+++ b/tempest/tests/identity/admin/test_users.py
@@ -60,7 +60,6 @@
self.alt_email)
@attr(type='negative')
- @unittest.skip("Until Bug 966251 is fixed")
def test_create_user_with_name_length_over_64(self):
# Length of user name filed should be restricted to 64 characters
self.data.setup_test_tenant()
@@ -172,7 +171,6 @@
self.data.test_tenant)
@attr(type='negative')
- @unittest.skip('Until Bug 988920 is fixed')
def test_authentication_when_tenant_is_disabled(self):
# User's token for a disabled tenant should not be authenticated
self.data.setup_test_user()
@@ -183,10 +181,9 @@
self.data.test_tenant)
@attr(type='negative')
- @unittest.skip('Until Bug 988920 is fixed')
def test_authentication_with_invalid_tenant(self):
# User's token for an invalid tenant should not be authenticated
- self.data.setup_one_user()
+ self.data.setup_test_user()
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
self.data.test_user,
self.data.test_password,
@@ -195,6 +192,7 @@
@attr(type='negative')
def test_authentication_with_invalid_username(self):
# Non-existent user's token should not get authenticated
+ self.data.setup_test_user()
self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
'junkuser123', self.data.test_password,
self.data.test_tenant)
diff --git a/tempest/tests/identity/base.py b/tempest/tests/identity/base.py
index ce160da..125e46c 100644
--- a/tempest/tests/identity/base.py
+++ b/tempest/tests/identity/base.py
@@ -26,8 +26,8 @@
@classmethod
def setUpClass(cls):
- os = clients.IdentityManager(interface=cls._interface)
- cls.client = os.admin_client
+ os = clients.AdminManager(interface=cls._interface)
+ cls.client = os.identity_client
cls.token_client = os.token_client
if not cls.client.has_admin_extensions():
@@ -35,8 +35,8 @@
cls.data = DataGenerator(cls.client)
- os = clients.IdentityNaManager(interface=cls._interface)
- cls.non_admin_client = os.admin_client
+ os = clients.NonAdminManager(interface=cls._interface)
+ cls.non_admin_client = os.identity_client
@classmethod
def tearDownClass(cls):
@@ -48,7 +48,7 @@
def disable_tenant(self, tenant_name):
tenant = self.get_tenant_by_name(tenant_name)
- self.client.update_tenant(tenant['id'], tenant['description'], False)
+ self.client.update_tenant(tenant['id'], enabled=False)
def get_user_by_name(self, name):
_, users = self.client.get_users()
diff --git a/tempest/tests/network/test_network_basic_ops.py b/tempest/tests/network/test_network_basic_ops.py
index 1d88759..3c99f77 100644
--- a/tempest/tests/network/test_network_basic_ops.py
+++ b/tempest/tests/network/test_network_basic_ops.py
@@ -195,6 +195,8 @@
cls.keypairs = {}
cls.security_groups = {}
cls.networks = []
+ cls.subnets = []
+ cls.routers = []
cls.servers = []
cls.floating_ips = {}
@@ -301,6 +303,18 @@
self.set_resource(name, network)
return network
+ def _list_networks(self):
+ nets = self.network_client.list_networks()
+ return nets['networks']
+
+ def _list_subnets(self):
+ subnets = self.network_client.list_subnets()
+ return subnets['subnets']
+
+ def _list_routers(self):
+ routers = self.network_client.list_routers()
+ return routers['routers']
+
def _create_subnet(self, network):
"""
Create a subnet for the given network within the cidr block
@@ -406,8 +420,43 @@
subnet = self._create_subnet(network)
subnet.add_to_router(router.id)
self.networks.append(network)
+ self.subnets.append(subnet)
+ self.routers.append(router)
- def test_004_create_servers(self):
+ def test_004_check_networks(self):
+ #Checks that we see the newly created network/subnet/router via
+ #checking the result of list_[networks,routers,subnets]
+ seen_nets = self._list_networks()
+ seen_names = [n['name'] for n in seen_nets]
+ seen_ids = [n['id'] for n in seen_nets]
+ for mynet in self.networks:
+ assert mynet.name in seen_names, \
+ "Did not see expected network with name %s" % mynet.name
+ assert mynet.id in seen_ids, \
+ "Did not see expected network with id %s" % mynet.id
+ seen_subnets = self._list_subnets()
+ seen_net_ids = [n['network_id'] for n in seen_subnets]
+ seen_subnet_ids = [n['id'] for n in seen_subnets]
+ for mynet in self.networks:
+ assert mynet.id in seen_net_ids, \
+ "Did not see subnet belonging to network %s/%s" % \
+ (mynet.name, mynet.id)
+ for mysubnet in self.subnets:
+ assert mysubnet.id in seen_subnet_ids, \
+ "Did not see expected subnet with id %s" % \
+ mysubnet.id
+ seen_routers = self._list_routers()
+ seen_router_ids = [n['id'] for n in seen_routers]
+ seen_router_names = [n['name'] for n in seen_routers]
+ for myrouter in self.routers:
+ assert myrouter.name in seen_router_names, \
+ "Did not see expected router with name %s" % \
+ myrouter.name
+ assert myrouter.id in seen_router_ids, \
+ "Did not see expected router with id %s" % \
+ myrouter.id
+
+ def test_005_create_servers(self):
if not (self.keypairs or self.security_groups or self.networks):
raise nose.SkipTest('Necessary resources have not been defined')
for i, network in enumerate(self.networks):
@@ -419,7 +468,7 @@
name, keypair_name, security_groups)
self.servers.append(server)
- def test_005_check_tenant_network_connectivity(self):
+ def test_006_check_tenant_network_connectivity(self):
if not self.config.network.tenant_networks_reachable:
msg = 'Tenant networks not configured to be reachable.'
raise nose.SkipTest(msg)
@@ -432,7 +481,7 @@
"Timed out waiting for %s's ip to become "
"reachable" % server.name)
- def test_006_assign_floating_ips(self):
+ def test_007_assign_floating_ips(self):
public_network_id = self.config.network.public_network_id
if not public_network_id:
raise nose.SkipTest('Public network not configured')
@@ -443,7 +492,7 @@
self.floating_ips.setdefault(server, [])
self.floating_ips[server].append(floating_ip)
- def test_007_check_public_network_connectivity(self):
+ def test_008_check_public_network_connectivity(self):
if not self.floating_ips:
raise nose.SkipTest('No floating ips have been allocated.')
for server, floating_ips in self.floating_ips.iteritems():
diff --git a/tempest/tests/object_storage/base.py b/tempest/tests/object_storage/base.py
index 3992b13..5e3d0bc 100644
--- a/tempest/tests/object_storage/base.py
+++ b/tempest/tests/object_storage/base.py
@@ -21,6 +21,7 @@
from tempest import clients
import tempest.config
from tempest import exceptions
+from tempest.tests.identity.base import DataGenerator
class BaseObjectTest(unittest.TestCase):
@@ -33,6 +34,16 @@
cls.account_client = cls.os.account_client
cls.config = cls.os.config
cls.custom_object_client = cls.os.custom_object_client
+ cls.os_admin = clients.AdminManager()
+ cls.token_client = cls.os_admin.token_client
+ cls.identity_admin_client = cls.os_admin.identity_client
+ cls.custom_account_client = cls.os.custom_account_client
+ cls.os_alt = clients.AltManager()
+ cls.object_client_alt = cls.os_alt.object_client
+ cls.container_client_alt = cls.os_alt.container_client
+ cls.identity_client_alt = cls.os_alt.identity_client
+
+ cls.data = DataGenerator(cls.identity_admin_client)
try:
cls.account_client.list_account_containers()
diff --git a/tempest/tests/object_storage/test_account_services.py b/tempest/tests/object_storage/test_account_services.py
index cae2da1..e34e349 100644
--- a/tempest/tests/object_storage/test_account_services.py
+++ b/tempest/tests/object_storage/test_account_services.py
@@ -17,6 +17,7 @@
from nose.plugins.attrib import attr
from tempest.common.utils.data_utils import rand_name
+from tempest import exceptions
from tempest.tests.object_storage import base
@@ -80,3 +81,30 @@
resp, metadata = self.account_client.list_account_metadata()
self.assertNotIn('x-account-meta-test-account-meta', resp)
+
+ @attr(type='negative')
+ def test_list_containers_with_non_authorized_user(self):
+ #Listing containers with using non authorized user
+
+ # Randomly creating user
+ self.data.setup_test_user()
+
+ resp, body = \
+ self.token_client.auth(self.data.test_user,
+ self.data.test_password,
+ self.data.test_tenant)
+ new_token = \
+ self.token_client.get_token(self.data.test_user,
+ self.data.test_password,
+ self.data.test_tenant)
+
+ custom_headers = {'X-Auth-Token': new_token}
+
+ params = {'format': 'json'}
+ # Trying to list containers with non authorized user token
+ self.assertRaises(exceptions.Unauthorized,
+ self.custom_account_client.list_account_containers,
+ params=params, metadata=custom_headers)
+
+ #Attempt to the delete the user setup created
+ self.data.teardown_all()
diff --git a/tempest/tests/object_storage/test_container_sync.py b/tempest/tests/object_storage/test_container_sync.py
new file mode 100644
index 0000000..3dea259
--- /dev/null
+++ b/tempest/tests/object_storage/test_container_sync.py
@@ -0,0 +1,126 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2012 OpenStack, LLC
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from nose.plugins.attrib import attr
+from tempest.common.utils.data_utils import arbitrary_string
+from tempest.common.utils.data_utils import rand_name
+from tempest.tests.object_storage import base
+import unittest2 as unittest
+
+
+class ContainerSyncTest(base.BaseObjectTest):
+
+ @classmethod
+ def setUpClass(cls):
+ super(ContainerSyncTest, cls).setUpClass()
+
+ cls.containers = []
+ cls.objects = []
+ container_sync_timeout = \
+ int(cls.config.object_storage.container_sync_timeout)
+ cls.container_sync_interval = \
+ int(cls.config.object_storage.container_sync_interval)
+ cls.attempts = \
+ int(container_sync_timeout / cls.container_sync_interval)
+
+ # Define container and object clients
+ cls.clients = {}
+ cls.clients[rand_name(name='TestContainerSync')] = \
+ (cls.container_client, cls.object_client)
+ cls.clients[rand_name(name='TestContainerSync')] = \
+ (cls.container_client_alt, cls.object_client_alt)
+ for cont_name, client in cls.clients.items():
+ client[0].create_container(cont_name)
+ cls.containers.append(cont_name)
+
+ @classmethod
+ def tearDownClass(cls):
+ for cont_name, client in cls.clients.items():
+ #Get list of all object in the container
+ objlist = client[0].list_all_container_objects(cont_name)
+
+ #Attempt to delete every object in the container
+ if objlist:
+ for obj in objlist:
+ resp, _ = client[1].delete_object(cont_name, obj['name'])
+
+ #Attempt to delete the container
+ resp, _ = client[0].delete_container(cont_name)
+
+ @unittest.skip('Until Bug 1093743 is resolved.')
+ @attr(type='positive')
+ def test_container_synchronization(self):
+ #Container to container synchronization
+ #To allow/accept sync requests to/from other accounts
+
+ #Switch container synchronization on and create objects in a containers
+ for cont in (self.containers, self.containers[::-1]):
+ cont_client = [self.clients[c][0] for c in cont]
+ obj_client = [self.clients[c][1] for c in cont]
+
+ #tell first container to syncronize to a second
+ headers = {'X-Container-Sync-Key': 'sync_key',
+ 'X-Container-Sync-To': "%s/%s" %
+ (cont_client[1].base_url, str(cont[1]))}
+ resp, body = \
+ cont_client[0].put(str(cont[0]), body=None, headers=headers)
+ self.assertTrue(resp['status'] in ('202', '201'),
+ 'Error installing X-Container-Sync-To '
+ 'for the container "%s"' % (cont[0]))
+
+ #Create Object in container
+ object_name = rand_name(name='TestSyncObject')
+ data = object_name[::-1] # arbitrary_string()
+ resp, _ = obj_client[0].create_object(cont[0], object_name, data)
+ self.assertEqual(resp['status'], '201',
+ 'Error creating the object "%s" in'
+ 'the container "%s"'
+ % (object_name, cont[0]))
+ self.objects.append(object_name)
+
+ #Wait for Container contents list json format will be not empty
+ cont_client = [self.clients[c][0] for c in self.containers]
+ params = {'format': 'json'}
+ while self.attempts > 0:
+ # get first container content
+ resp, object_list_0 = \
+ cont_client[0].\
+ list_container_contents(self.containers[0], params=params)
+ self.assertEqual(resp['status'], '200',
+ 'Error listing the destination container`s'
+ ' "%s" contents' % (self.containers[0]))
+ object_list_0 = {obj['name']: obj for obj in object_list_0}
+ # get second container content
+ resp, object_list_1 = \
+ cont_client[1].\
+ list_container_contents(self.containers[1], params=params)
+ self.assertEqual(resp['status'], '200',
+ 'Error listing the destination container`s'
+ ' "%s" contents' % (self.containers[1]))
+ object_list_1 = {obj['name']: obj for obj in object_list_1}
+ # check that containers is not empty and has equal keys()
+ # or wait for next attepmt
+ if not object_list_0 or not object_list_1 or \
+ set(object_list_0.keys()) != set(object_list_1.keys()):
+ time.sleep(self.container_sync_interval)
+ self.attempts -= 1
+ else:
+ break
+
+ # Check for synchronization
+ self.assertEqual(object_list_0, object_list_1,
+ 'Different object lists in containers.')
diff --git a/tempest/tests/object_storage/test_object_services.py b/tempest/tests/object_storage/test_object_services.py
index 8b87ad6..a65401c 100644
--- a/tempest/tests/object_storage/test_object_services.py
+++ b/tempest/tests/object_storage/test_object_services.py
@@ -21,6 +21,8 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.tests.object_storage import base
+from time import time
+import unittest2 as unittest
class ObjectTest(base.BaseObjectTest):
@@ -33,11 +35,23 @@
cls.container_name = rand_name(name='TestContainer')
cls.container_client.create_container(cls.container_name)
+ # Randomly creating user
+ cls.data.setup_test_user()
+
+ resp, body = cls.token_client.auth(cls.data.test_user,
+ cls.data.test_password,
+ cls.data.test_tenant)
+ cls.new_token = cls.token_client.get_token(cls.data.test_user,
+ cls.data.test_password,
+ cls.data.test_tenant)
+
+ cls.custom_headers = {'X-Auth-Token': cls.new_token}
+
@classmethod
def tearDownClass(cls):
#Get list of all object in the container
- objlist = \
- cls.container_client.list_all_container_objects(cls.container_name)
+ objlist = cls.container_client.list_all_container_objects(
+ cls.container_name)
#Attempt to delete every object in the container
for obj in objlist:
@@ -47,6 +61,9 @@
#Attempt to delete the container
resp, _ = cls.container_client.delete_container(cls.container_name)
+ #Attempt to the delete the user setup created
+ cls.data.teardown_all()
+
@attr(type='smoke')
def test_create_object(self):
# Create storage object, test response
@@ -93,16 +110,15 @@
meta_value = rand_name(name='MetaValue-')
orig_metadata = {meta_key: meta_value}
- resp, _ = \
- self.object_client.update_object_metadata(self.container_name,
- object_name,
- orig_metadata)
+ resp, _ = self.object_client.update_object_metadata(
+ self.container_name, object_name,
+ orig_metadata)
self.assertEqual(resp['status'], '202')
#Get Object Metadata
- resp, resp_metadata = \
- self.object_client.list_object_metadata(self.container_name,
- object_name)
+ resp, resp_metadata = self.object_client.list_object_metadata(
+ self.container_name, object_name)
+
self.assertEqual(resp['status'], '200')
actual_meta_key = 'x-object-meta-' + meta_key
self.assertTrue(actual_meta_key in resp)
@@ -229,10 +245,9 @@
meta_value = rand_name(name='MetaValue-')
orig_metadata = {meta_key: meta_value}
- resp, _ = \
- self.object_client.update_object_metadata(src_container_name,
- object_name,
- orig_metadata)
+ resp, _ = self.object_client.update_object_metadata(src_container_name,
+ object_name,
+ orig_metadata)
self.assertEqual(resp['status'], '202')
try:
@@ -274,10 +289,9 @@
resp_meta = None
# Update Container Metadata to make public readable
cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
- resp_meta, body = \
- self.container_client.update_container_metadata(
- self.container_name, metadata=cont_headers,
- metadata_prefix='')
+ resp_meta, body = self.container_client.update_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
self.assertEqual(resp_meta['status'], '204')
# Create Object
@@ -289,37 +303,195 @@
self.assertEqual(resp['status'], '201')
# List container metadata
- resp_meta, _ = \
- self.container_client.list_container_metadata(
- self.container_name)
+ resp_meta, _ = self.container_client.list_container_metadata(
+ self.container_name)
self.assertEqual(resp_meta['status'], '204')
self.assertIn('x-container-read', resp_meta)
self.assertEqual(resp_meta['x-container-read'], '.r:*,.rlistings')
# Trying to Get Object with empty Headers as it is public readable
- resp, body = \
- self.custom_object_client.get_object(self.container_name,
- object_name, metadata={})
+ resp, body = self.custom_object_client.get_object(
+ self.container_name, object_name,
+ metadata={})
self.assertEqual(body, data)
finally:
if resp_meta['status'] == '204':
# Delete updated container metadata, to revert back.
- resp, body = \
- self.container_client.delete_container_metadata(
- self.container_name, metadata=cont_headers,
- metadata_prefix='')
+ resp, body = self.container_client.delete_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
- resp, _ = \
- self.container_client.list_container_metadata(
- self.container_name)
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
self.assertEqual(resp['status'], '204')
self.assertIn('x-container-read', resp)
self.assertEqual(resp['x-container-read'], 'x')
+ @unittest.skip('Until Bug 1091669 is resolved.')
+ @attr(type='smoke')
+ def test_access_public_object_with_another_user_creds(self):
+ #Make container public-readable, and access the object
+ #anonymously, e.g. using another user credentials
+
+ try:
+ resp_meta = None
+ cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
+ resp_meta, body = self.container_client.update_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
+ self.assertEqual(resp_meta['status'], '204')
+ # Create Object
+ object_name = rand_name(name='Object')
+ data = arbitrary_string(size=len(object_name) * 1,
+ base_text=object_name)
+ resp, _ = self.object_client.create_object(self.container_name,
+ object_name, data)
+ self.assertEqual(resp['status'], '201')
+
+ # List container metadata
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
+ self.assertEqual(resp['status'], '204')
+ self.assertIn('x-container-read', resp)
+ self.assertEqual(resp['x-container-read'], '.r:*,.rlistings')
+
+ # Trying to GET Auth Token of Alternate user
+ token = self.identity_client_alt.get_auth()
+ headers = {'X-Auth-Token': token}
+
+ # Trying to create object with Alternate user creds
+ resp, body = self.custom_object_client.get_object(
+ self.container_name, object_name,
+ metadata=headers)
+ self.assertEqual(body, data)
+
+ except Exception as e:
+ self.fail("Failed to get public readable object with another"
+ " user creds raised exception is %s" % e)
+
+ finally:
+ if resp_meta['status'] == '204':
+ # Delete updated container metadata, to revert back.
+ resp, body = self.container_client.delete_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
+
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
+ self.assertEqual(resp['status'], '204')
+ self.assertIn('x-container-read', resp)
+ self.assertEqual(resp['x-container-read'], 'x')
+
+ @unittest.skip('Until Bug #1020722 is resolved.')
+ @attr(type='smoke')
+ def test_write_public_object_without_using_creds(self):
+ #Make container public-writable, and create object
+ #anonymously, e.g. without using credentials
+ try:
+ resp_meta = None
+ # Update Container Metadata to make public readable
+ cont_headers = {'X-Container-Write': '-*'}
+ resp_meta, body = self.container_client.update_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
+ self.assertEqual(resp_meta['status'], '204')
+ # List container metadata
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
+
+ self.assertEqual(resp['status'], '204')
+ self.assertIn('x-container-write', resp)
+ self.assertEqual(resp['x-container-write'], '-*')
+
+ object_name = rand_name(name='Object')
+ data = arbitrary_string(size=len(object_name),
+ base_text=object_name)
+
+ headers = {'Content-Type': 'application/json',
+ 'Accept': 'application/json'}
+
+ #Trying to Create object without using creds
+ resp, body = self.custom_object_client.create_object(
+ self.container_name, object_name,
+ data, metadata=headers)
+ self.assertEqual(resp['status'], '201')
+
+ except Exception as e:
+ self.fail("Failed to create public writable object without using"
+ " creds raised exception is %s" % e)
+
+ finally:
+ if resp_meta['status'] == '204':
+ # Delete updated container metadata, to revert back.
+ resp, body = self.container_client.delete_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
+
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
+ self.assertEqual(resp['status'], '204')
+ self.assertIn('x-container-write', resp)
+ self.assertEqual(resp['x-container-write'], 'x')
+
+ @unittest.skip('Until Bug #1020722 is resolved.')
+ @attr(type='smoke')
+ def test_write_public_with_another_user_creds(self):
+ #Make container public-writable, and create object
+ #anonymously, e.g. with another user credentials
+
+ try:
+ resp_meta = None
+ # Update Container Metadata to make public readable
+ cont_headers = {'X-Container-Write': '-*'}
+ resp_meta, body = self.container_client.update_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
+ self.assertEqual(resp_meta['status'], '204')
+ # List container metadata
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
+
+ self.assertEqual(resp['status'], '204')
+ self.assertIn('x-container-write', resp)
+ self.assertEqual(resp['x-container-write'], '-*')
+
+ #Trying to GET auth token of Alternate user
+ token = self.identity_client_alt.get_auth()
+
+ headers = {'Content-Type': 'application/json',
+ 'Accept': 'application/json',
+ 'X-Auth-Token': token}
+
+ #Trying to Create an object with another user creds
+ object_name = rand_name(name='Object')
+ data = arbitrary_string(size=len(object_name),
+ base_text=object_name)
+ resp, body = self.custom_object_client.create_object(
+ self.container_name, object_name,
+ data, metadata=headers)
+ self.assertEqual(resp['status'], '201')
+
+ except Exception as e:
+ self.fail("Failed to create public writable object with another"
+ " user creds raised exception is %s" % e)
+
+ finally:
+ if resp_meta['status'] == '204':
+ # Delete updated container metadata, to revert back.
+ resp, body = self.container_client.delete_container_metadata(
+ self.container_name, metadata=cont_headers,
+ metadata_prefix='')
+
+ resp, _ = self.container_client.list_container_metadata(
+ self.container_name)
+ self.assertEqual(resp['status'], '204')
+ self.assertIn('x-container-write', resp)
+ self.assertEqual(resp['x-container-write'], 'x')
+
@attr(type='negative')
def test_access_object_without_using_creds(self):
# Attempt to access the object anonymously, e.g.
- # not using any credentials
+ # not using any credentials
# Create Object
object_name = rand_name(name='Object')
@@ -354,7 +526,7 @@
@attr(type='negative')
def test_delete_object_without_using_creds(self):
# Attempt to delete the object anonymously,
- # e.g. not using any credentials
+ # e.g. not using any credentials
# Create Object
object_name = rand_name(name='Object')
@@ -367,3 +539,133 @@
self.assertRaises(exceptions.Unauthorized,
self.custom_object_client.delete_object,
self.container_name, object_name)
+
+ @attr(type='negative')
+ def test_write_object_with_non_authorized_user(self):
+ #Attempt to upload another file using non authorized user
+
+ object_name = rand_name(name='Object')
+ data = arbitrary_string(size=len(object_name) * 5,
+ base_text=object_name)
+
+ # Trying to Create Object with non authorized user token
+ self.assertRaises(exceptions.Unauthorized,
+ self.custom_object_client.create_object,
+ self.container_name, object_name, data,
+ metadata=self.custom_headers)
+
+ @attr(type='negative')
+ def test_read_object_with_non_authorized_user(self):
+ #Attempt to download the file using non authorized user
+
+ object_name = rand_name(name='Object')
+ data = arbitrary_string(size=len(object_name) * 5,
+ base_text=object_name)
+
+ resp, body = self.object_client.create_object(
+ self.container_name, object_name,
+ data)
+ self.assertEqual(resp['status'], '201')
+
+ # Trying to Get Object with non authorized user token
+ self.assertRaises(exceptions.Unauthorized,
+ self.custom_object_client.get_object,
+ self.container_name, object_name,
+ metadata=self.custom_headers)
+
+ @attr(type='negative')
+ def test_delete_object_with_non_authorized_user(self):
+ #Attempt to delete container using non authorized user
+
+ object_name = rand_name(name='Object')
+ data = arbitrary_string(size=len(object_name) * 5,
+ base_text=object_name)
+
+ resp, body = self.object_client.create_object(
+ self.container_name, object_name,
+ data)
+ self.assertEqual(resp['status'], '201')
+
+ # Trying to Delete Object with non authorized user token
+ self.assertRaises(exceptions.Unauthorized,
+ self.custom_object_client.delete_object,
+ self.container_name, object_name,
+ metadata=self.custom_headers)
+
+ @unittest.skip('Until bug 1097137 is resolved.')
+ @attr(type='positive')
+ def test_get_object_using_temp_url(self):
+ #Access object using temp url within expiry time
+
+ try:
+ #Update Account Metadata
+ # Flag to check if account metadata got updated
+ flag = False
+ key = 'Meta'
+ metadata = {'Temp-URL-Key': key}
+ resp, _ = self.account_client.create_account_metadata(
+ metadata=metadata)
+ self.assertEqual(resp['status'], '204')
+ flag = True
+
+ resp, _ = self.account_client.list_account_metadata()
+ self.assertIn('x-account-meta-temp-url-key', resp)
+ self.assertEqual(resp['x-account-meta-temp-url-key'], key)
+
+ # Create Object
+ object_name = rand_name(name='ObjectTemp')
+ data = arbitrary_string(size=len(object_name),
+ base_text=object_name)
+ self.object_client.create_object(self.container_name,
+ object_name, data)
+
+ expires = int(time() + 10)
+
+ #Trying to GET object using temp URL with in expiry time
+ _, body = self.object_client.get_object_using_temp_url(
+ self.container_name, object_name,
+ expires, key)
+
+ self.assertEqual(body, data)
+
+ finally:
+ if flag:
+ resp, _ = self.account_client.delete_account_metadata(
+ metadata=metadata)
+ resp, _ = self.account_client.list_account_metadata()
+ self.assertNotIn('x-account-meta-temp-url-key', resp)
+
+ @attr(type='positive')
+ def test_object_upload_in_segments(self):
+ #Attempt to upload object in segments
+
+ #Create Object
+ object_name = rand_name(name='LObject')
+ data = arbitrary_string(size=len(object_name),
+ base_text=object_name)
+ segments = 10
+ self.object_client.create_object(self.container_name,
+ object_name, data)
+ #Uploading 10 segments
+ for i in range(segments):
+ resp, _ = self.object_client.create_object_segments(
+ self.container_name, object_name,
+ i, data)
+ # Creating a Manifest File (Metadata Update)
+
+ metadata = {'X-Object-Manifest': '%s/%s/'
+ % (self.container_name, object_name)}
+ resp, _ = self.object_client.update_object_metadata(
+ self.container_name, object_name,
+ metadata, metadata_prefix='')
+ resp, _ = self.object_client.list_object_metadata(
+ self.container_name, object_name)
+ self.assertIn('x-object-manifest', resp)
+ self.assertEqual(resp['x-object-manifest'],
+ '%s/%s/' % (self.container_name, object_name))
+
+ #Downloading the object
+ resp, body = self.object_client.get_object(
+ self.container_name, object_name)
+
+ self.assertEqual(data * segments, body)
diff --git a/tempest/tests/volume/admin/base.py b/tempest/tests/volume/admin/base.py
index 81c7c78..d35efbc 100644
--- a/tempest/tests/volume/admin/base.py
+++ b/tempest/tests/volume/admin/base.py
@@ -35,7 +35,7 @@
cls.adm_user = cls.config.compute_admin.username
cls.adm_pass = cls.config.compute_admin.password
cls.adm_tenant = cls.config.compute_admin.tenant_name
- cls.auth_url = cls.config.identity.auth_url
+ cls.auth_url = cls.config.identity.uri
if not cls.adm_user and cls.adm_pass and cls.adm_tenant:
msg = ("Missing Volume Admin API credentials "
diff --git a/tempest/tests/volume/admin/test_volume_types.py b/tempest/tests/volume/admin/test_volume_types.py
index 65c975a..a907a79 100644
--- a/tempest/tests/volume/admin/test_volume_types.py
+++ b/tempest/tests/volume/admin/test_volume_types.py
@@ -28,7 +28,7 @@
adm_user = cls.config.compute_admin.username
adm_pass = cls.config.compute_admin.password
adm_tenant = cls.config.compute_admin.tenant_name
- auth_url = cls.config.identity.auth_url
+ auth_url = cls.config.identity.uri
cls.client = volume_types_client.VolumeTypesClientJSON(cls.config,
adm_user,
diff --git a/tempest/tests/volume/admin/test_volume_types_extra_specs.py b/tempest/tests/volume/admin/test_volume_types_extra_specs.py
index 9734c42..c5a1fa9 100644
--- a/tempest/tests/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/tests/volume/admin/test_volume_types_extra_specs.py
@@ -29,7 +29,7 @@
adm_user = cls.config.compute_admin.username
adm_pass = cls.config.compute_admin.password
adm_tenant = cls.config.compute_admin.tenant_name
- auth_url = cls.config.identity.auth_url
+ auth_url = cls.config.identity.uri
cls.client = volume_types_client.VolumeTypesClientJSON(cls.config,
adm_user,
diff --git a/tempest/tests/volume/base.py b/tempest/tests/volume/base.py
index 8657db8..1b35170 100644
--- a/tempest/tests/volume/base.py
+++ b/tempest/tests/volume/base.py
@@ -73,8 +73,8 @@
"""
Returns an instance of the Identity Admin API client
"""
- os = clients.IdentityManager()
- return os.admin_client
+ os = clients.AdminManager()
+ return os.identity_client
@classmethod
def _get_isolated_creds(cls):
diff --git a/tools/install_venv.py b/tools/install_venv.py
index 42ed32c..28275ba 100644
--- a/tools/install_venv.py
+++ b/tools/install_venv.py
@@ -95,9 +95,9 @@
class Fedora(Distro):
- """This covers all Fedora-based distributions.
+ """This covers Fedora-based distributions.
- Includes: Fedora, RHEL, CentOS, Scientific Linux"""
+ Includes: Fedora, RHEL, Scientific Linux"""
def check_pkg(self, pkg):
return run_command_with_code(['rpm', '-q', pkg],
@@ -141,12 +141,25 @@
'contrib/redhat-eventlet.patch')
+class CentOS(Fedora):
+ """This covers CentOS."""
+
+ def post_process(self):
+ if not self.check_pkg('openssl-devel'):
+ self.yum.install('openssl-devel', check_exit_code=False)
+
+
def get_distro():
- if (os.path.exists('/etc/fedora-release') or
- os.path.exists('/etc/redhat-release')):
+ if os.path.exists('/etc/redhat-release'):
+ with open('/etc/redhat-release') as rh_release:
+ if 'CentOS' in rh_release.read():
+ return CentOS()
return Fedora()
- else:
- return Distro()
+
+ if os.path.exists('/etc/fedora-release'):
+ return Fedora()
+
+ return Distro()
def check_dependencies():
diff --git a/tools/pip-requires b/tools/pip-requires
index 061eff6..fcf1690 100644
--- a/tools/pip-requires
+++ b/tools/pip-requires
@@ -10,3 +10,4 @@
python-keystoneclient>=0.2.0
python-novaclient>=2.10.0
python-quantumclient>=2.1
+testresources
diff --git a/tools/tempest_coverage.py b/tools/tempest_coverage.py
index 73dcfbc..6e7ac04 100755
--- a/tools/tempest_coverage.py
+++ b/tools/tempest_coverage.py
@@ -139,7 +139,7 @@
def main(argv):
CLI = parse_opts(argv)
client_args = (CONF, CONF.compute_admin.username,
- CONF.compute_admin.password, CONF.identity.auth_url,
+ CONF.compute_admin.password, CONF.identity.uri,
CONF.compute_admin.tenant_name)
coverage_client = CoverageClientJSON(*client_args)
diff --git a/tools/test-requires b/tools/test-requires
index fa98918..d3c7a1e 100644
--- a/tools/test-requires
+++ b/tools/test-requires
@@ -1,5 +1,4 @@
pep8==1.3.3
pylint==0.19
# Needed for whitebox testing
-paramiko
sqlalchemy