Add support of microversion in all compute service clients

Tempest implemented microversion support testing framework
which can set the microversion on service client and further
will be used to pass to API request.

To support setting of microversion on each compute service client
and passing the same in API request, we need to inherit all
compute service clients from BaseComputeClient.

BaseComputeClient class pass the microversion in API request header
and checks the correct microversion is being returned in response.

NOTE- This change to all compute service clients does not change
any interface which means no backward incompatibility is introduced.

After this change, all compute service clients will support to pass
microversion on API request.

Partially implements blueprint api-microversions-testing-support

Change-Id: I44de9db6790148148df779810c67b272a7938d56
This commit is contained in:
Ghanshyam
2016-02-25 06:12:43 +09:00
committed by Ghanshyam Mann
parent 1f47cf976b
commit ee9af30847
34 changed files with 69 additions and 33 deletions

View File

@@ -0,0 +1,3 @@
---
features:
- Compute Microversion testing support in Service Clients.

View File

@@ -17,9 +17,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import agents as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class AgentsClient(rest_client.RestClient):
class AgentsClient(base_compute_client.BaseComputeClient):
"""Tests Agents API"""
def list_agents(self, **params):

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import aggregates as schema
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import base_compute_client
class AggregatesClient(rest_client.RestClient):
class AggregatesClient(base_compute_client.BaseComputeClient):
def list_aggregates(self):
"""Get aggregate list."""

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import availability_zone \
as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class AvailabilityZoneClient(rest_client.RestClient):
class AvailabilityZoneClient(base_compute_client.BaseComputeClient):
def list_availability_zones(self, detail=False):
url = 'os-availability-zone'

View File

@@ -18,9 +18,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import baremetal_nodes \
as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class BaremetalNodesClient(rest_client.RestClient):
class BaremetalNodesClient(base_compute_client.BaseComputeClient):
"""Tests Baremetal API"""
def list_baremetal_nodes(self, **params):

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import certificates as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class CertificatesClient(rest_client.RestClient):
class CertificatesClient(base_compute_client.BaseComputeClient):
def show_certificate(self, certificate_id):
url = "os-certificates/%s" % certificate_id

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import extensions as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class ExtensionsClient(rest_client.RestClient):
class ExtensionsClient(base_compute_client.BaseComputeClient):
def list_extensions(self):
url = 'extensions'

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import fixed_ips as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class FixedIPsClient(rest_client.RestClient):
class FixedIPsClient(base_compute_client.BaseComputeClient):
def show_fixed_ip(self, fixed_ip):
url = "os-fixed-ips/%s" % fixed_ip

View File

@@ -22,9 +22,10 @@ from tempest.lib.api_schema.response.compute.v2_1 import flavors_access \
from tempest.lib.api_schema.response.compute.v2_1 import flavors_extra_specs \
as schema_extra_specs
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class FlavorsClient(rest_client.RestClient):
class FlavorsClient(base_compute_client.BaseComputeClient):
def list_flavors(self, detail=False, **params):
url = 'flavors'

View File

@@ -18,9 +18,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import floating_ips as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class FloatingIPPoolsClient(rest_client.RestClient):
class FloatingIPPoolsClient(base_compute_client.BaseComputeClient):
def list_floating_ip_pools(self, params=None):
"""Gets all floating IP Pools list."""

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import floating_ips as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class FloatingIPsBulkClient(rest_client.RestClient):
class FloatingIPsBulkClient(base_compute_client.BaseComputeClient):
def create_floating_ips_bulk(self, ip_range, pool, interface):
"""Allocate floating IPs in bulk."""

View File

@@ -19,9 +19,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import floating_ips as schema
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import base_compute_client
class FloatingIPsClient(rest_client.RestClient):
class FloatingIPsClient(base_compute_client.BaseComputeClient):
def list_floating_ips(self, **params):
"""Returns a list of all floating IPs filtered by any parameters."""

View File

@@ -17,9 +17,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import hosts as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class HostsClient(rest_client.RestClient):
class HostsClient(base_compute_client.BaseComputeClient):
def list_hosts(self, **params):
"""List all hosts."""

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import hypervisors as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class HypervisorClient(rest_client.RestClient):
class HypervisorClient(base_compute_client.BaseComputeClient):
def list_hypervisors(self, detail=False):
"""List hypervisors information."""

View File

@@ -19,9 +19,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import images as schema
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import base_compute_client
class ImagesClient(rest_client.RestClient):
class ImagesClient(base_compute_client.BaseComputeClient):
def create_image(self, server_id, **kwargs):
"""Create an image of the original server.

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import \
instance_usage_audit_logs as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class InstanceUsagesAuditLogClient(rest_client.RestClient):
class InstanceUsagesAuditLogClient(base_compute_client.BaseComputeClient):
def list_instance_usage_audit_logs(self):
url = 'os-instance_usage_audit_log'

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import interfaces as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class InterfacesClient(rest_client.RestClient):
class InterfacesClient(base_compute_client.BaseComputeClient):
def list_interfaces(self, server_id):
resp, body = self.get('servers/%s/os-interface' % server_id)

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import keypairs as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class KeyPairsClient(rest_client.RestClient):
class KeyPairsClient(base_compute_client.BaseComputeClient):
def list_keypairs(self):
resp, body = self.get("os-keypairs")

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import limits as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class LimitsClient(rest_client.RestClient):
class LimitsClient(base_compute_client.BaseComputeClient):
def show_limits(self):
resp, body = self.get("limits")

View File

@@ -17,9 +17,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import migrations as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class MigrationsClient(rest_client.RestClient):
class MigrationsClient(base_compute_client.BaseComputeClient):
def list_migrations(self, **params):
"""List all migrations.

View File

@@ -16,9 +16,10 @@
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class NetworksClient(rest_client.RestClient):
class NetworksClient(base_compute_client.BaseComputeClient):
def list_networks(self):
resp, body = self.get("os-networks")

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1\
import quota_classes as classes_schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class QuotaClassesClient(rest_client.RestClient):
class QuotaClassesClient(base_compute_client.BaseComputeClient):
def show_quota_class_set(self, quota_class_id):
"""List the quota class set for a quota class."""

View File

@@ -17,9 +17,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import quotas as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class QuotasClient(rest_client.RestClient):
class QuotasClient(base_compute_client.BaseComputeClient):
def show_quota_set(self, tenant_id, user_id=None):
"""List the quota set for a tenant."""

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import \
security_group_default_rule as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class SecurityGroupDefaultRulesClient(rest_client.RestClient):
class SecurityGroupDefaultRulesClient(base_compute_client.BaseComputeClient):
def create_security_default_group_rule(self, **kwargs):
"""Create security group default rule.

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import \
security_groups as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class SecurityGroupRulesClient(rest_client.RestClient):
class SecurityGroupRulesClient(base_compute_client.BaseComputeClient):
def create_security_group_rule(self, **kwargs):
"""Create a new security group rule.

View File

@@ -20,9 +20,10 @@ from tempest.lib.api_schema.response.compute.v2_1 import \
security_groups as schema
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import base_compute_client
class SecurityGroupsClient(rest_client.RestClient):
class SecurityGroupsClient(base_compute_client.BaseComputeClient):
def list_security_groups(self, **params):
"""List all security groups for a user."""

View File

@@ -18,9 +18,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import servers as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class ServerGroupsClient(rest_client.RestClient):
class ServerGroupsClient(base_compute_client.BaseComputeClient):
def create_server_group(self, **kwargs):
"""Create the server group.

View File

@@ -21,9 +21,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import servers as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class ServersClient(rest_client.RestClient):
class ServersClient(base_compute_client.BaseComputeClient):
def __init__(self, auth_provider, service, region,
enable_instance_password=True, **kwargs):

View File

@@ -19,9 +19,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import services as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class ServicesClient(rest_client.RestClient):
class ServicesClient(base_compute_client.BaseComputeClient):
def list_services(self, **params):
url = 'os-services'

View File

@@ -19,9 +19,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import snapshots as schema
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import base_compute_client
class SnapshotsClient(rest_client.RestClient):
class SnapshotsClient(base_compute_client.BaseComputeClient):
def create_snapshot(self, volume_id, **kwargs):
"""Create a snapshot.

View File

@@ -16,9 +16,10 @@ from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import tenant_networks
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class TenantNetworksClient(rest_client.RestClient):
class TenantNetworksClient(base_compute_client.BaseComputeClient):
def list_tenant_networks(self):
resp, body = self.get("os-tenant-networks")

View File

@@ -18,9 +18,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import tenant_usages
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class TenantUsagesClient(rest_client.RestClient):
class TenantUsagesClient(base_compute_client.BaseComputeClient):
def list_tenant_usages(self, **params):
url = 'os-simple-tenant-usage'

View File

@@ -19,9 +19,10 @@ from six.moves import urllib
from tempest.lib.api_schema.response.compute.v2_1 import versions as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class VersionsClient(rest_client.RestClient):
class VersionsClient(base_compute_client.BaseComputeClient):
def _get_base_version_url(self):
# NOTE: The URL which is got from keystone's catalog contains

View File

@@ -19,9 +19,10 @@ from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import volumes as schema
from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import base_compute_client
class VolumesClient(rest_client.RestClient):
class VolumesClient(base_compute_client.BaseComputeClient):
def list_volumes(self, detail=False, **params):
"""List all the volumes created."""