Cleanup for merging v2 and v2.1 functional tests.

All functional tests have been merged between v2 and v2.1.
This commit does the cleanup for all TODO added while merging the tests.

Partially implements blueprint test-collapse-v2-and-v21

Change-Id: I2f5a3dcc41e296c3baba6e4ea7e20079df48b43d
This commit is contained in:
ghanshyam 2015-08-26 10:56:29 +09:00
parent 764c4d467e
commit 8c4b555116
85 changed files with 10 additions and 339 deletions

View File

@ -16,7 +16,6 @@ import os
from oslo_config import cfg
import testscenarios
import testtools
from nova.api import openstack
from nova.api.openstack import API_V3_CORE_EXTENSIONS # noqa
@ -32,7 +31,7 @@ CONF = cfg.CONF
class ApiSampleTestBaseV3(testscenarios.WithScenarios,
api_samples_test_base.ApiSampleTestBase):
_api_version = 'v3'
_api_version = 'v2'
sample_dir = None
extra_extensions_to_load = None
scenarios = [('v2', {'_test': 'v2'}),
@ -40,13 +39,6 @@ class ApiSampleTestBaseV3(testscenarios.WithScenarios,
('v2_1_compatible', {'_test': 'v2.1_compatible'})]
def setUp(self):
# TODO(gmann): Below condition is to skip the tests which running
# for 'v2' and have not been merged yet. Once all tests are merged
# this condition needs to be removed.
if (hasattr(self, '_test') and
(self._test == 'v2') and
(self._api_version == 'v3')):
raise testtools.TestCase.skipException('tests are not merged yet')
self.flags(use_ipv6=False,
osapi_compute_link_prefix=self._get_host(),
osapi_glance_link_prefix=self._get_glance_host())
@ -64,14 +56,11 @@ class ApiSampleTestBaseV3(testscenarios.WithScenarios,
CONF.set_override('extensions_whitelist', whitelist,
'osapi_v3')
expected_middleware = []
# TODO(gmann): Currently redirecting only merged tests
# after merging all tests, second condition needs to be removed.
if (not hasattr(self, '_test') or
((self._test == 'v2.1') and (self._api_version == 'v2'))):
if (not hasattr(self, '_test') or (self._test == 'v2.1')):
# NOTE(gmann)For v2.1 API testing, override /v2 endpoint with v2.1
self.useFixture(api_paste_fixture.ApiPasteFixture())
expected_middleware = [compute.APIRouterV21]
elif self._test == 'v2.1_compatible' and self._api_version == 'v2':
elif self._test == 'v2.1_compatible':
self.useFixture(api_paste_fixture.ApiPasteV2CompatibleFixture())
expected_middleware = [openstack.LegacyV2CompatibleWrapper,
compute.APIRouterV21]

View File

@ -1,10 +0,0 @@
{
"server" : {
"name" : "new-server-test",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}
}
}

View File

@ -1,16 +0,0 @@
{
"server": {
"adminPass": "%(password)s",
"id": "%(id)s",
"links": [
{
"href": "http://openstack.example.com/v3/servers/%(uuid)s",
"rel": "self"
},
{
"href": "http://openstack.example.com/servers/%(uuid)s",
"rel": "bookmark"
}
]
}
}

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class AccessIPsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = 'os-access-ips'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(AccessIPsSampleJsonTest, self)._get_flags()

View File

@ -24,11 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class AdminActionsSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-admin-actions"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
extra_extensions_to_load = ["os-access-ips"]
def _get_flags(self):
f = super(AdminActionsSamplesJsonTest, self)._get_flags()

View File

@ -24,11 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class AdminPasswordJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-admin-password'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
extra_extensions_to_load = ["os-access-ips"]
def test_server_password(self):
uuid = self._post_server()

View File

@ -27,10 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class AgentsJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-agents"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(AgentsJsonTest, self)._get_flags()

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class AggregatesSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-aggregates"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(AggregatesSampleJsonTest, self)._get_flags()

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class AssistedVolumeSnapshotsJsonTests(test_servers.ServersSampleBase):
extension_name = "os-assisted-volume-snapshots"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(AssistedVolumeSnapshotsJsonTests, self)._get_flags()

View File

@ -28,11 +28,6 @@ CONF.import_opt('osapi_compute_extension',
class AttachInterfacesSampleJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-attach-interfaces'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
extra_extensions_to_load = ["os-access-ips"]
def _get_flags(self):
f = super(AttachInterfacesSampleJsonTest, self)._get_flags()

View File

@ -25,11 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class AvailabilityZoneJsonTest(test_servers.ServersSampleBase):
ADMIN_API = True
extension_name = "os-availability-zone"
extra_extensions_to_load = ["os-access-ips"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(AvailabilityZoneJsonTest, self)._get_flags()

View File

@ -51,10 +51,6 @@ class fake_client(object):
class BareMetalNodesSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-baremetal-nodes"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(BareMetalNodesSampleJsonTest, self)._get_flags()

View File

@ -26,8 +26,6 @@ CONF.import_opt('osapi_compute_extension',
class BlockDeviceMappingV1BootJsonTest(test_servers.ServersSampleBase):
extension_name = "os-block-device-mapping-v1"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def test_servers_post_with_bdm(self):
self.stubs.Set(cinder.API, 'get', fakes.stub_volume_get)

View File

@ -30,10 +30,6 @@ CONF.import_opt('osapi_compute_extension',
class CellsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-cells"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(CellsSampleJsonTest, self)._get_flags()

View File

@ -24,10 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class CertificatesSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-certificates"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(CertificatesSamplesJsonTest, self)._get_flags()

View File

@ -31,10 +31,6 @@ CONF.import_opt('osapi_compute_extension',
class CloudPipeSampleTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-cloudpipe"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(CloudPipeSampleTest, self)._get_flags()

View File

@ -26,11 +26,6 @@ CONF.import_opt('osapi_compute_extension',
class ConfigDriveSampleJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-config-drive'
extra_extensions_to_load = ["os-access-ips"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ConfigDriveSampleJsonTest, self)._get_flags()

View File

@ -28,10 +28,6 @@ class ConsoleAuthTokensSampleJsonTests(test_servers.ServersSampleBase):
ADMIN_API = True
extension_name = "os-console-auth-tokens"
extra_extensions_to_load = ["os-remote-consoles", "os-access-ips"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ConsoleAuthTokensSampleJsonTests, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ConsoleOutputSampleJsonTest(test_servers.ServersSampleBase):
extension_name = "os-console-output"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ConsoleOutputSampleJsonTest, self)._get_flags()

View File

@ -19,8 +19,6 @@ from nova.tests.functional.api_sample_tests import test_servers
class ConsolesSamplesJsonTest(test_servers.ServersSampleBase):
sample_dir = "consoles"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def setUp(self):
super(ConsolesSamplesJsonTest, self).setUp()

View File

@ -27,11 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class CreateBackupSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-create-backup"
extra_extensions_to_load = ["os-access-ips"]
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(CreateBackupSamplesJsonTest, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class DeferredDeleteSampleJsonTests(test_servers.ServersSampleBase):
extension_name = "os-deferred-delete"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(DeferredDeleteSampleJsonTests, self)._get_flags()

View File

@ -26,7 +26,6 @@ CONF.import_opt('osapi_compute_extension',
class DiskConfigJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-disk-config'
extra_extensions_to_load = ["images", "os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(DiskConfigJsonTest, self)._get_flags()

View File

@ -29,8 +29,6 @@ CONF.import_opt('osapi_compute_extension',
class EvacuateJsonTest(test_servers.ServersSampleBase):
ADMIN_API = True
extension_name = "os-evacuate"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(EvacuateJsonTest, self)._get_flags()

View File

@ -24,11 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ExtendedAvailabilityZoneJsonTests(test_servers.ServersSampleBase):
extension_name = "os-extended-availability-zone"
extra_extensions_to_load = ["os-access-ips"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ExtendedAvailabilityZoneJsonTests, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ExtendedServerAttributesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-extended-server-attributes"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ExtendedServerAttributesJsonTest, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ExtendedStatusSampleJsonTests(test_servers.ServersSampleBase):
extension_name = "os-extended-status"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ExtendedStatusSampleJsonTests, self)._get_flags()

View File

@ -29,11 +29,6 @@ CONF.import_opt('osapi_compute_extension',
class ExtendedVolumesSampleJsonTests(test_servers.ServersSampleBase):
extension_name = "os-extended-volumes"
extra_extensions_to_load = ["os-access-ips"]
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ExtendedVolumesSampleJsonTests, self)._get_flags()

View File

@ -32,10 +32,6 @@ def fake_soft_extension_authorizer(extension_name, core=False):
class ExtensionInfoAllSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
all_extensions = True
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
@mock.patch.object(api_extensions, 'os_compute_soft_authorizer')
def test_list_extensions(self, soft_auth):
@ -51,6 +47,10 @@ class ExtensionInfoAllSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
class ExtensionInfoSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
sample_dir = "extension-info"
extra_extensions_to_load = ["os-create-backup"]
# NOTE (gmann): run this tests for v21. and v2.1 compatible mode only
# as there is no 'extensions/*' API in v2.
scenarios = [('v2_1', {'_test': 'v2.1'}),
('v2_1_compatible', {'_test': 'v2.1_compatible'})]
@mock.patch.object(api_extensions, 'os_compute_soft_authorizer')
def test_get_extensions(self, soft_auth):

View File

@ -27,10 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class FixedIpTest(test_servers.ServersSampleBase):
extension_name = "os-fixed-ips"
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
request_api_version = None
@ -126,7 +122,6 @@ class FixedIpV24Test(FixedIpTest):
# so defining scenarios only for v2.4 which will run the original tests
# by appending '(v2_4)' in test_id.
scenarios = [('v2_4', {})]
_api_version = 'v2'
def test_get_fixed_ip(self):
self._test_get_fixed_ip(reserved=False)

View File

@ -24,10 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class FlavorAccessSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = 'flavor-access'
# TODO(Park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FlavorAccessSampleJsonTests, self)._get_flags()

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class FlavorExtraSpecsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = 'flavor-extra-specs'
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FlavorExtraSpecsSampleJsonTests, self)._get_flags()

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class FlavorManageSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = 'flavor-manage'
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FlavorManageSampleJsonTests, self)._get_flags()

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class FlavorRxtxJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = 'os-flavor-rxtx'
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FlavorRxtxJsonTest, self)._get_flags()

View File

@ -24,10 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class FlavorsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
sample_dir = 'flavors'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FlavorsSampleJsonTest, self)._get_flags()

View File

@ -31,10 +31,6 @@ class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV3):
project = 'project1'
dns_type = 'A'
ip = '192.168.1.1'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FloatingIpDNSTest, self)._get_flags()

View File

@ -24,10 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class FloatingIPPoolsSampleTests(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-floating-ip-pools"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FloatingIPPoolsSampleTests, self)._get_flags()

View File

@ -27,10 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-floating-ips"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FloatingIpsTest, self)._get_flags()

View File

@ -28,10 +28,6 @@ CONF.import_opt('osapi_compute_extension',
class FloatingIpsBulkTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-floating-ips-bulk"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(FloatingIpsBulkTest, self)._get_flags()

View File

@ -28,8 +28,6 @@ CONF.import_opt('osapi_compute_extension',
class FpingSampleJsonTests(test_servers.ServersSampleBase):
extension_name = "os-fping"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(FpingSampleJsonTests, self)._get_flags()

View File

@ -25,10 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class HostsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-hosts"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(HostsSampleJsonTest, self)._get_flags()

View File

@ -30,10 +30,6 @@ CONF.import_opt('osapi_compute_extension',
class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-hypervisors"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(HypervisorsSampleJsonTests, self)._get_flags()
@ -121,10 +117,6 @@ class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
class HypervisorsCellsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-hypervisors"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(HypervisorsCellsSampleJsonTests, self)._get_flags()

View File

@ -26,10 +26,6 @@ CONF.import_opt('osapi_compute_extension',
class ImageSizeSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
extension_name = "image-size"
extra_extensions_to_load = ["images", "image-metadata"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ImageSizeSampleJsonTests, self)._get_flags()

View File

@ -26,10 +26,6 @@ CONF.import_opt('osapi_compute_extension',
class ImagesSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = 'images'
extra_extensions_to_load = ["image-metadata"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def test_images_list(self):
# Get api sample of images get list request.

View File

@ -33,10 +33,6 @@ CONF.import_opt('osapi_compute_extension',
class ServerActionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = 'os-instance-actions'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ServerActionsSampleJsonTest, self)._get_flags()

View File

@ -27,10 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class InstanceUsageAuditLogJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-instance-usage-audit-log"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(InstanceUsageAuditLogJsonTest, self)._get_flags()

View File

@ -31,7 +31,6 @@ class KeyPairsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
sample_dir = "keypairs"
expected_delete_status_code = 202
expected_post_status_code = 200
_api_version = 'v2'
def _get_flags(self):
f = super(KeyPairsSampleJsonTest, self)._get_flags()
@ -117,7 +116,6 @@ class KeyPairsV22SampleJsonTest(KeyPairsSampleJsonTest):
# so defining scenarios only for v2.2 which will run the original tests
# by appending '(v2_2)' in test_id.
scenarios = [('v2_2', {})]
_api_version = 'v2'
def test_keypairs_post(self):
# NOTE(claudiub): overrides the method with the same name in
@ -177,7 +175,6 @@ class KeyPairsV210SampleJsonTest(KeyPairsSampleJsonTest):
expected_post_status_code = 201
expected_delete_status_code = 204
scenarios = [('v2_10', {})]
_api_version = 'v2'
def test_keypair_create_for_user(self):
subs = {

View File

@ -26,11 +26,6 @@ class LimitsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "limits"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def setUp(self):
super(LimitsSampleJsonTest, self).setUp()
# NOTE(gmann): We have to separate the template files between V2

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class LockServerSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-lock-server"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(LockServerSamplesJsonTest, self)._get_flags()

View File

@ -29,8 +29,6 @@ CONF.import_opt('osapi_compute_extension',
class MigrateServerSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-migrate-server"
ctype = 'json'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(MigrateServerSamplesJsonTest, self)._get_flags()

View File

@ -28,10 +28,6 @@ CONF.import_opt('osapi_compute_extension',
class MigrationsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-migrations"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(MigrationsSamplesJsonTest, self)._get_flags()

View File

@ -25,8 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class MultinicSampleJsonTest(test_servers.ServersSampleBase):
ADMIN_API = True
extension_name = "os-multinic"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(MultinicSampleJsonTest, self)._get_flags()

View File

@ -25,7 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class MultipleCreateJsonTest(test_servers.ServersSampleBase):
extension_name = "os-multiple-create"
_api_version = 'v2'
def _get_flags(self):
f = super(MultipleCreateJsonTest, self)._get_flags()

View File

@ -27,10 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-networks"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(NetworksJsonTests, self)._get_flags()

View File

@ -27,10 +27,6 @@ class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-networks-associate"
extra_extensions_to_load = ["os-networks"]
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
_sentinel = object()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class PauseServerSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-pause-server"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(PauseServerSamplesJsonTest, self)._get_flags()

View File

@ -18,8 +18,6 @@ from nova.tests.unit.image import fake
class PersonalitySampleJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-personality'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def test_servers_post(self):
self._post_server(use_common_server_api_samples=False)

View File

@ -25,8 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class PreserveEphemeralOnRebuildJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-preserve-ephemeral-rebuild'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(PreserveEphemeralOnRebuildJsonTest, self)._get_flags()

View File

@ -26,10 +26,6 @@ class QuotaClassesSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-quota-class-sets"
set_id = 'test_class'
# TODO(Park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(QuotaClassesSampleJsonTests, self)._get_flags()

View File

@ -25,7 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-quota-sets"
_api_version = 'v2'
def _get_flags(self):
f = super(QuotaSetsSampleJsonTests, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ConsolesSampleJsonTests(test_servers.ServersSampleBase):
extension_name = "os-remote-consoles"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ConsolesSampleJsonTests, self)._get_flags()
@ -86,14 +84,12 @@ class ConsolesSampleJsonTests(test_servers.ServersSampleBase):
class ConsolesV26SampleJsonTests(test_servers.ServersSampleBase):
extra_extensions_to_load = ["os-access-ips"]
request_api_version = '2.6'
extension_name = "os-remote-consoles"
# NOTE(gmann): microversion tests do not need to run for v2 API
# so defining scenarios only for v2.6 which will run the original tests
# by appending '(v2_6)' in test_id.
scenarios = [('v2_6', {})]
_api_version = 'v2'
def setUp(self):
super(ConsolesV26SampleJsonTests, self).setUp()

View File

@ -25,8 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class RescueJsonTest(test_servers.ServersSampleBase):
extension_name = "os-rescue"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(RescueJsonTest, self)._get_flags()

View File

@ -28,11 +28,6 @@ CONF.import_opt('osapi_compute_extension',
class SchedulerHintsJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-scheduler-hints"
# TODO(madhuri): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(SchedulerHintsJsonTest, self)._get_flags()
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]

View File

@ -25,10 +25,6 @@ class SecurityGroupDefaultRulesSampleJsonTest(
api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = 'os-security-group-default-rules'
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(SecurityGroupDefaultRulesSampleJsonTest, self)._get_flags()

View File

@ -65,8 +65,6 @@ def fake_create_security_group(self, context, name, description):
class SecurityGroupsJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-security-groups'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(SecurityGroupsJsonTest, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ServerDiagnosticsSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-server-diagnostics"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ServerDiagnosticsSamplesJsonTest, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ServerExternalEventsSamplesJsonTest(test_servers.ServersSampleBase):
ADMIN_API = True
extension_name = "os-server-external-events"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ServerExternalEventsSamplesJsonTest, self)._get_flags()

View File

@ -24,10 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ServerGroupsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-server-groups"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ServerGroupsSampleJsonTest, self)._get_flags()

View File

@ -25,8 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class ServersMetadataJsonTest(test_servers.ServersSampleBase):
extends_name = 'core_only'
sample_dir = 'server-metadata'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _create_and_set(self, subs):
uuid = self._post_server()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ServerPasswordSampleJsonTests(test_servers.ServersSampleBase):
extension_name = "os-server-password"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ServerPasswordSampleJsonTests, self)._get_flags()

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class ServerUsageSampleJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-server-usage'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ServerUsageSampleJsonTest, self)._get_flags()

View File

@ -24,6 +24,7 @@ CONF.import_opt('osapi_compute_extension',
class ServersSampleBase(api_sample_base.ApiSampleTestBaseV3):
extra_extensions_to_load = ["os-access-ips"]
def _post_server(self, use_common_server_api_samples=True):
# param use_common_server_api_samples: Boolean to set whether tests use
@ -44,14 +45,6 @@ class ServersSampleBase(api_sample_base.ApiSampleTestBaseV3):
try:
self.__class__._use_common_server_api_samples = (
use_common_server_api_samples)
# TODO(gmann) This is temporary hack to let other tests
# inherited from ServersSampleBase run successfully.
# Once all inherited tests are merged, below if condition
# code needs to be removed.
if ((self._api_version == 'v3') and
use_common_server_api_samples):
self.__class__._use_common_server_api_samples = False
self.__class__.sample_dir = 'servers_v21'
response = self._do_post('servers', 'server-post-req', subs)
subs = self._get_regexes()
status = self._verify_response('server-post-resp', subs,
@ -64,8 +57,6 @@ class ServersSampleBase(api_sample_base.ApiSampleTestBaseV3):
class ServersSampleJsonTest(ServersSampleBase):
sample_dir = 'servers'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
request_api_version = None
def _get_flags(self):
@ -128,8 +119,6 @@ class ServersSampleJson29Test(ServersSampleJsonTest):
class ServerSortKeysJsonTests(ServersSampleBase):
sample_dir = 'servers-sort'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ServerSortKeysJsonTests, self)._get_flags()
@ -153,8 +142,6 @@ class ServersSampleAllExtensionJsonTest(ServersSampleJsonTest):
class ServersActionsJsonTest(ServersSampleBase):
sample_dir = 'servers'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _test_server_action(self, uuid, action, req_tpl,
subs=None, resp_tpl=None, code=202):
@ -232,8 +219,6 @@ class ServersActionsAllJsonTest(ServersActionsJsonTest):
class ServerStartStopJsonTest(ServersSampleBase):
sample_dir = 'servers'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ServerStartStopJsonTest, self)._get_flags()

View File

@ -25,11 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class ServersIpsJsonTest(test_servers.ServersSampleBase):
extends_name = 'core_only'
sample_dir = 'server-ips'
extra_extensions_to_load = ["os-access-ips"]
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def test_get(self):
# Test getting a server's IP information.

View File

@ -30,11 +30,6 @@ class ServicesJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-services"
request_api_version = None
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(ServicesJsonTest, self)._get_flags()
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
@ -114,7 +109,6 @@ class ServicesJsonTest(api_sample_base.ApiSampleTestBaseV3):
class ServicesV211JsonTest(ServicesJsonTest):
request_api_version = '2.11'
_api_version = 'v2'
# NOTE(gryf): There is no need to run those tests on v2 API. Only
# scenarios for v2_9 will be run.
scenarios = [('v2_11', {})]

View File

@ -25,8 +25,6 @@ CONF.import_opt('osapi_compute_extension',
class ShelveJsonTest(test_servers.ServersSampleBase):
extension_name = "os-shelve"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(ShelveJsonTest, self)._get_flags()

View File

@ -27,8 +27,6 @@ CONF.import_opt('osapi_compute_extension',
class SimpleTenantUsageSampleJsonTest(test_servers.ServersSampleBase):
extension_name = "os-simple-tenant-usage"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(SimpleTenantUsageSampleJsonTest, self)._get_flags()

View File

@ -24,11 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class SuspendServerSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-suspend-server"
ctype = 'json'
extra_extensions_to_load = ["os-access-ips"]
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(SuspendServerSamplesJsonTest, self)._get_flags()

View File

@ -31,10 +31,6 @@ CONF.import_opt('osapi_compute_extension',
class TenantNetworksJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-tenant-networks"
# TODO(gmann): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(TenantNetworksJsonTests, self)._get_flags()

View File

@ -27,11 +27,6 @@ class UsedLimitsSamplesJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-used-limits"
extra_extensions_to_load = ["limits"]
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def setUp(self):
super(UsedLimitsSamplesJsonTest, self).setUp()
# NOTE(park): We have to separate the template files between V2

View File

@ -26,7 +26,6 @@ CONF.import_opt('osapi_compute_extension',
class UserDataJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-user-data"
_api_version = 'v2'
def _get_flags(self):
f = super(UserDataJsonTest, self)._get_flags()

View File

@ -19,7 +19,6 @@ from nova.tests.functional.api_sample_tests import api_sample_base
class VersionsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
sample_dir = 'versions'
scenarios = [('', {'_test': ''})]
_api_version = 'v2'
def test_versions_get(self):
response = self._do_get('', strip_version=True)

View File

@ -24,8 +24,6 @@ CONF.import_opt('osapi_compute_extension',
class VirtualInterfacesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-virtual-interfaces"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(VirtualInterfacesJsonTest, self)._get_flags()

View File

@ -36,10 +36,6 @@ CONF.import_opt('osapi_compute_extension',
class SnapshotsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
extension_name = "os-volumes"
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
create_subs = {
'snapshot_name': 'snap-001',
@ -105,10 +101,6 @@ class SnapshotsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
class VolumesSampleJsonTest(test_servers.ServersSampleBase):
extension_name = "os-volumes"
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(VolumesSampleJsonTest, self)._get_flags()
@ -253,12 +245,7 @@ class VolumeAttachmentsSampleBase(test_servers.ServersSampleBase):
class VolumeAttachmentsSampleJsonTest(VolumeAttachmentsSampleBase):
extra_extensions_to_load = ["os-access-ips"]
extension_name = "os-volumes"
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(VolumeAttachmentsSampleJsonTest, self)._get_flags()

View File

@ -33,4 +33,4 @@ class LoginTest(integrated_helpers._IntegratedTestBase):
class LoginTestV3(client.TestOpenStackClientV3Mixin, LoginTest):
_api_version = 'v3'
_api_version = 'v2.1'

View File

@ -510,4 +510,4 @@ class ServersTest(ServersTestBase):
class ServersTestV3(client.TestOpenStackClientV3Mixin, ServersTest):
_api_version = 'v3'
_api_version = 'v2.1'