Merge "Remove unnecessary class variables"
diff --git a/.mailmap b/.mailmap
index 3ea6ab0..7898e69 100644
--- a/.mailmap
+++ b/.mailmap
@@ -13,9 +13,10 @@
Ken'ichi Ohmichi <ken-oomichi@wx.jp.nec.com> <oomichi@mxs.nes.nec.co.jp>
Ken'ichi Ohmichi <ken-oomichi@wx.jp.nec.com> <ken1ohmichi@gmail.com>
Marc Koderer <marc@koderer.com> <m.koderer@telekom.de>
-Masayuki Igawa <masayuki@igawa.me> <igawa@mxs.nes.nec.co.jp>
-Masayuki Igawa <masayuki@igawa.me> <mas-igawa@ut.jp.nec.com>
-Masayuki Igawa <masayuki@igawa.me> <masayuki.igawa@gmail.com>
+Masayuki Igawa <masayuki@igawa.io> <igawa@mxs.nes.nec.co.jp>
+Masayuki Igawa <masayuki@igawa.io> <mas-igawa@ut.jp.nec.com>
+Masayuki Igawa <masayuki@igawa.io> <masayuki.igawa@gmail.com>
+Masayuki Igawa <masayuki@igawa.io> <masayuki@igawa.me>
Matthew Treinish <mtreinish@kortar.org> <treinish@linux.vnet.ibm.com>
Nayna Patel <nayna.patel@hp.com> <nayna.patel@hp.com>
ravikumar-venkatesan <ravikumar.venkatesan@hp.com> <ravikumar.venkatesan@hp.com>
diff --git a/tempest/api/compute/admin/test_delete_server.py b/tempest/api/compute/admin/test_delete_server.py
index 83444b9..58cac57 100644
--- a/tempest/api/compute/admin/test_delete_server.py
+++ b/tempest/api/compute/admin/test_delete_server.py
@@ -15,11 +15,8 @@
from tempest.api.compute import base
from tempest.common import waiters
-from tempest import config
from tempest.lib import decorators
-CONF = config.CONF
-
class DeleteServersAdminTestJSON(base.BaseV2ComputeAdminTest):
# NOTE: Server creations of each test class should be under 10
diff --git a/tempest/api/compute/admin/test_server_diagnostics_negative.py b/tempest/api/compute/admin/test_server_diagnostics_negative.py
index d5b6674..6215c37 100644
--- a/tempest/api/compute/admin/test_server_diagnostics_negative.py
+++ b/tempest/api/compute/admin/test_server_diagnostics_negative.py
@@ -18,8 +18,6 @@
class ServerDiagnosticsNegativeTest(base.BaseV2ComputeAdminTest):
- min_microversion = None
- max_microversion = '2.47'
@classmethod
def setup_clients(cls):
@@ -33,8 +31,3 @@
server_id = self.create_test_server(wait_until='ACTIVE')['id']
self.assertRaises(lib_exc.Forbidden,
self.client.show_server_diagnostics, server_id)
-
-
-class ServerDiagnosticsNegativeV248Test(ServerDiagnosticsNegativeTest):
- min_microversion = '2.48'
- max_microversion = 'latest'
diff --git a/tempest/api/identity/admin/v3/test_application_credentials.py b/tempest/api/identity/admin/v3/test_application_credentials.py
index 4a74ef8..7e802c6 100644
--- a/tempest/api/identity/admin/v3/test_application_credentials.py
+++ b/tempest/api/identity/admin/v3/test_application_credentials.py
@@ -15,13 +15,9 @@
# under the License.
from tempest.api.identity import base
-from tempest import config
from tempest.lib import decorators
-CONF = config.CONF
-
-
class ApplicationCredentialsV3AdminTest(base.BaseApplicationCredentialsV3Test,
base.BaseIdentityV3AdminTest):
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index bc94a8e..6ddf42e 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -14,12 +14,9 @@
# under the License.
from tempest.api.identity import base
-from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
-CONF = config.CONF
-
class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index 62ced19..47f663c 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -14,14 +14,11 @@
# under the License.
from tempest.api.identity import base
-from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-CONF = config.CONF
-
class RolesV3TestJSON(base.BaseIdentityV3AdminTest):
diff --git a/tempest/api/identity/v3/test_application_credentials.py b/tempest/api/identity/v3/test_application_credentials.py
index caf0b1e..1cee902 100644
--- a/tempest/api/identity/v3/test_application_credentials.py
+++ b/tempest/api/identity/v3/test_application_credentials.py
@@ -19,13 +19,9 @@
from oslo_utils import timeutils
from tempest.api.identity import base
-from tempest import config
from tempest.lib import decorators
-CONF = config.CONF
-
-
class ApplicationCredentialsV3Test(base.BaseApplicationCredentialsV3Test):
def _list_app_creds(self, name=None):
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index 206d867..033bf55 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -14,11 +14,9 @@
from tempest.api.network import base
from tempest.common import utils
-from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
-CONF = config.CONF
AGENT_TYPE = 'L3 agent'
AGENT_MODES = (
'legacy',
diff --git a/tempest/api/network/admin/test_ports.py b/tempest/api/network/admin/test_ports.py
index 483b405..05363db 100644
--- a/tempest/api/network/admin/test_ports.py
+++ b/tempest/api/network/admin/test_ports.py
@@ -14,11 +14,8 @@
# under the License.
from tempest.api.network import base
-from tempest import config
from tempest.lib import decorators
-CONF = config.CONF
-
class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index 3075047..dec3413 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -17,11 +17,8 @@
from tempest.api.network import base
from tempest.common import utils
-from tempest import config
from tempest.lib import decorators
-CONF = config.CONF
-
class AllowedAddressPairTestJSON(base.BaseNetworkTest):
"""Tests the Neutron Allowed Address Pair API extension
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 246a5c3..2c9159c 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -22,13 +22,10 @@
from tempest.api.network import base_security_groups as sec_base
from tempest.common import custom_matchers
from tempest.common import utils
-from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions
-CONF = config.CONF
-
class PortsTestJSON(sec_base.BaseSecGroupTest):
"""Test the following operations for ports:
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index ddd7d3a..0b61860 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -15,13 +15,10 @@
from tempest.api.network import base
from tempest.common import utils
-from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-CONF = config.CONF
-
class RoutersNegativeTest(base.BaseNetworkTest):
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index 24bd8ea..ffc1fca 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -15,12 +15,9 @@
from tempest.api.network import base_security_groups as base
from tempest.common import utils
-from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
-CONF = config.CONF
-
class SecGroupTest(base.BaseSecGroupTest):
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index e6d77e6..053a7d9 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -22,28 +22,28 @@
QUOTA_USAGE_KEYS = ['reserved', 'limit', 'in_use']
-class BaseVolumeQuotasAdminTestJSON(base.BaseVolumeAdminTest):
+class VolumeQuotasAdminTestJSON(base.BaseVolumeAdminTest):
credentials = ['primary', 'alt', 'admin']
def setUp(self):
# NOTE(jeremy.zhang): Avoid conflicts with volume quota class tests.
self.useFixture(fixtures.LockFixture('volume_quotas'))
- super(BaseVolumeQuotasAdminTestJSON, self).setUp()
+ super(VolumeQuotasAdminTestJSON, self).setUp()
@classmethod
def setup_credentials(cls):
- super(BaseVolumeQuotasAdminTestJSON, cls).setup_credentials()
+ super(VolumeQuotasAdminTestJSON, cls).setup_credentials()
cls.demo_tenant_id = cls.os_primary.credentials.tenant_id
@classmethod
def setup_clients(cls):
- super(BaseVolumeQuotasAdminTestJSON, cls).setup_clients()
+ super(VolumeQuotasAdminTestJSON, cls).setup_clients()
cls.transfer_client = cls.os_primary.volume_transfers_client_latest
cls.alt_transfer_client = cls.os_alt.volume_transfers_client_latest
@classmethod
def resource_setup(cls):
- super(BaseVolumeQuotasAdminTestJSON, cls).resource_setup()
+ super(VolumeQuotasAdminTestJSON, cls).resource_setup()
# Save the current set of quotas so that some tests may use it
# to restore the quotas to their original values after they are
diff --git a/tempest/api/volume/admin/test_volume_quotas_negative.py b/tempest/api/volume/admin/test_volume_quotas_negative.py
index 7b5cd68..915aeec 100644
--- a/tempest/api/volume/admin/test_volume_quotas_negative.py
+++ b/tempest/api/volume/admin/test_volume_quotas_negative.py
@@ -23,16 +23,16 @@
'backup_gigabytes', 'per_volume_gigabytes']
-class BaseVolumeQuotasNegativeTestJSON(base.BaseVolumeAdminTest):
+class VolumeQuotasNegativeTestJSON(base.BaseVolumeAdminTest):
@classmethod
def setup_credentials(cls):
- super(BaseVolumeQuotasNegativeTestJSON, cls).setup_credentials()
+ super(VolumeQuotasNegativeTestJSON, cls).setup_credentials()
cls.demo_tenant_id = cls.os_primary.credentials.tenant_id
@classmethod
def resource_setup(cls):
- super(BaseVolumeQuotasNegativeTestJSON, cls).resource_setup()
+ super(VolumeQuotasNegativeTestJSON, cls).resource_setup()
# Save the current set of quotas, then set up the cleanup method
# to restore the quotas to their original values after the tests
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 4b97b80..1855386 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -130,54 +130,39 @@
# Delete the snapshot
self.delete_snapshot(snapshot['id'])
+ def _create_volume_from_snapshot(self, extra_size=0):
+ src_size = CONF.volume.volume_size
+ size = src_size + extra_size
+
+ src_vol = self.create_volume(size=src_size)
+ src_snap = self.create_snapshot(src_vol['id'])
+
+ dst_vol = self.create_volume(snapshot_id=src_snap['id'],
+ size=size)
+ # NOTE(zhufl): dst_vol is created based on snapshot, so dst_vol
+ # should be deleted before deleting snapshot, otherwise deleting
+ # snapshot will end with status 'error-deleting'. This depends on
+ # the implementation mechanism of vendors, generally speaking,
+ # some verdors will use "virtual disk clone" which will promote
+ # disk clone speed, and in this situation the "disk clone"
+ # is just a relationship between volume and snapshot.
+ self.addCleanup(self.delete_volume, self.volumes_client, dst_vol['id'])
+
+ volume = self.volumes_client.show_volume(dst_vol['id'])['volume']
+ # Should allow
+ self.assertEqual(volume['snapshot_id'], src_snap['id'])
+ self.assertEqual(volume['size'], size)
+
@decorators.idempotent_id('677863d1-3142-456d-b6ac-9924f667a7f4')
def test_volume_from_snapshot(self):
# Creates a volume from a snapshot passing a size
# different from the source
- src_size = CONF.volume.volume_size
-
- src_vol = self.create_volume(size=src_size)
- src_snap = self.create_snapshot(src_vol['id'])
- # Destination volume bigger than source snapshot
- dst_vol = self.create_volume(snapshot_id=src_snap['id'],
- size=src_size + 1)
- # NOTE(zhufl): dst_vol is created based on snapshot, so dst_vol
- # should be deleted before deleting snapshot, otherwise deleting
- # snapshot will end with status 'error-deleting'. This depends on
- # the implementation mechanism of vendors, generally speaking,
- # some verdors will use "virtual disk clone" which will promote
- # disk clone speed, and in this situation the "disk clone"
- # is just a relationship between volume and snapshot.
- self.addCleanup(self.delete_volume, self.volumes_client, dst_vol['id'])
-
- volume = self.volumes_client.show_volume(dst_vol['id'])['volume']
- # Should allow
- self.assertEqual(volume['snapshot_id'], src_snap['id'])
- self.assertEqual(volume['size'], src_size + 1)
+ self._create_volume_from_snapshot(extra_size=1)
@decorators.idempotent_id('053d8870-8282-4fff-9dbb-99cb58bb5e0a')
def test_volume_from_snapshot_no_size(self):
# Creates a volume from a snapshot defaulting to original size
- src_size = CONF.volume.volume_size
-
- src_vol = self.create_volume(size=src_size)
- src_snap = self.create_snapshot(src_vol['id'])
- # Destination volume without specifying a size
- dst_vol = self.create_volume(snapshot_id=src_snap['id'])
-
- # NOTE(zhufl): dst_vol is created based on snapshot, so dst_vol
- # should be deleted before deleting snapshot, otherwise deleting
- # snapshot will end with status 'error-deleting'. This depends on
- # the implementation mechanism of vendors, generally speaking,
- # some verdors will use "virtual disk clone" which will promote
- # disk clone speed, and in this situation the "disk clone"
- # is just a relationship between volume and snapshot.
- self.addCleanup(self.delete_volume, self.volumes_client, dst_vol['id'])
-
- volume = self.volumes_client.show_volume(dst_vol['id'])['volume']
- # Should allow
- self.assertEqual(volume['snapshot_id'], src_snap['id'])
- self.assertEqual(volume['size'], src_size)
+ self._create_volume_from_snapshot()
@decorators.idempotent_id('bbcfa285-af7f-479e-8c1a-8c34fc16543c')
@testtools.skipUnless(CONF.volume_feature_enabled.backup,
diff --git a/tempest/api/volume/test_volumes_snapshots_list.py b/tempest/api/volume/test_volumes_snapshots_list.py
index f12bfd8..8a416ea 100644
--- a/tempest/api/volume/test_volumes_snapshots_list.py
+++ b/tempest/api/volume/test_volumes_snapshots_list.py
@@ -160,3 +160,11 @@
# marker(second snapshot), therefore only the first snapshot
# should displayed.
self.assertEqual(snapshot_id_list[:1], fetched_list_id)
+
+ @decorators.idempotent_id('ca96d551-17c6-4e11-b0e8-52d3bb8a63c7')
+ def test_snapshot_list_param_offset(self):
+ params = {'offset': 2, 'limit': 3}
+ snap_list = self.snapshots_client.list_snapshots(**params)['snapshots']
+ # Verify the list of snapshots skip offset=2 from the first element
+ # (total 3 elements), therefore only one snapshot should display
+ self.assertEqual(1, len(snap_list))
diff --git a/tempest/cmd/run.py b/tempest/cmd/run.py
index a27425c..84c6d9a 100644
--- a/tempest/cmd/run.py
+++ b/tempest/cmd/run.py
@@ -160,8 +160,6 @@
sys.exit(2)
if parsed_args.state:
self._init_state()
- else:
- pass
regex = self._build_regex(parsed_args)
return_code = 0