Merge "Update .mailmap for ghanshyam emails"
diff --git a/README.rst b/README.rst
index 0a130dc..307ceb3 100644
--- a/README.rst
+++ b/README.rst
@@ -198,21 +198,21 @@
is ``test_path=./tempest/test_discover`` which will only run test discover on the
Tempest suite.
-Alternatively, there are the py27 and py35 tox jobs which will run the unit
+Alternatively, there are the py27 and py36 tox jobs which will run the unit
tests with the corresponding version of python.
One common activity is to just run a single test, you can do this with tox
-simply by specifying to just run py27 or py35 tests against a single test::
+simply by specifying to just run py27 or py36 tests against a single test::
- $ tox -e py27 -- -n tempest.tests.test_microversions.TestMicroversionsTestsClass.test_config_version_none_23
+ $ tox -e py36 -- -n tempest.tests.test_microversions.TestMicroversionsTestsClass.test_config_version_none_23
Or all tests in the test_microversions.py file::
- $ tox -e py27 -- -n tempest.tests.test_microversions
+ $ tox -e py36 -- -n tempest.tests.test_microversions
You may also use regular expressions to run any matching tests::
- $ tox -e py27 -- test_microversions
+ $ tox -e py36 -- test_microversions
Additionally, when running a single test, or test-file, the ``-n/--no-discover``
argument is no longer required, however it may perform faster if included.
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 14f51e9..9822c26 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -79,7 +79,8 @@
for hyper in hypers:
details = (self.client.show_hypervisor(hyper['id'])
['hypervisor'])
- if details['hypervisor_type'] != 'ironic':
+ if (details['hypervisor_type'] != 'ironic' and
+ details['state'] == 'up'):
hypers_without_ironic.append(hyper)
ironic_only = False
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index e4a2ffd..1b62249 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -31,27 +31,11 @@
@decorators.idempotent_id('25319919-33d9-424f-9f99-2c203ee48b9d')
def test_list_instance_usage_audit_logs(self):
# list instance usage audit logs
- body = (self.adm_client.list_instance_usage_audit_logs()
- ["instance_usage_audit_logs"])
- expected_items = ['total_errors', 'total_instances', 'log',
- 'num_hosts_running', 'num_hosts_done',
- 'num_hosts', 'hosts_not_run', 'overall_status',
- 'period_ending', 'period_beginning',
- 'num_hosts_not_run']
- for item in expected_items:
- self.assertIn(item, body)
+ self.adm_client.list_instance_usage_audit_logs()
@decorators.idempotent_id('6e40459d-7c5f-400b-9e83-449fbc8e7feb')
def test_get_instance_usage_audit_log(self):
# Get instance usage audit log before specified time
now = datetime.datetime.now()
- body = (self.adm_client.show_instance_usage_audit_log(
+ self.adm_client.show_instance_usage_audit_log(
urllib.quote(now.strftime("%Y-%m-%d %H:%M:%S")))
- ["instance_usage_audit_log"])
-
- expected_items = ['total_errors', 'total_instances', 'log',
- 'num_hosts_running', 'num_hosts_done', 'num_hosts',
- 'hosts_not_run', 'overall_status', 'period_ending',
- 'period_beginning', 'num_hosts_not_run']
- for item in expected_items:
- self.assertIn(item, body)
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index 61a6df4..053a7d9 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -22,37 +22,36 @@
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
# done.
- cls.original_quota_set = (cls.admin_quotas_client.show_quota_set(
+ original_quota_set = (cls.admin_quotas_client.show_quota_set(
cls.demo_tenant_id)['quota_set'])
cls.cleanup_quota_set = dict(
- (k, v) for k, v in cls.original_quota_set.items()
- if k in QUOTA_KEYS)
+ (k, v) for k, v in original_quota_set.items() if k in QUOTA_KEYS)
@decorators.idempotent_id('59eada70-403c-4cef-a2a3-a8ce2f1b07a0')
def test_list_quotas(self):
diff --git a/tempest/api/volume/admin/test_volume_quotas_negative.py b/tempest/api/volume/admin/test_volume_quotas_negative.py
index f50f336..915aeec 100644
--- a/tempest/api/volume/admin/test_volume_quotas_negative.py
+++ b/tempest/api/volume/admin/test_volume_quotas_negative.py
@@ -23,29 +23,27 @@
'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
# from this class are done. This is needed just in case Tempest is
# configured to use pre-provisioned projects/user accounts.
- cls.original_quota_set = (cls.admin_quotas_client.show_quota_set(
+ original_quota_set = (cls.admin_quotas_client.show_quota_set(
cls.demo_tenant_id)['quota_set'])
- cls.cleanup_quota_set = dict(
- (k, v) for k, v in cls.original_quota_set.items()
- if k in QUOTA_KEYS)
+ cleanup_quota_set = dict(
+ (k, v) for k, v in original_quota_set.items() if k in QUOTA_KEYS)
cls.addClassResourceCleanup(cls.admin_quotas_client.update_quota_set,
- cls.demo_tenant_id,
- **cls.cleanup_quota_set)
+ cls.demo_tenant_id, **cleanup_quota_set)
cls.shared_quota_set = {'gigabytes': 2 * CONF.volume.volume_size,
'volumes': 1}
diff --git a/tempest/api/volume/admin/test_volume_snapshot_quotas_negative.py b/tempest/api/volume/admin/test_volume_snapshot_quotas_negative.py
index 74eb792..ff5e7e2 100644
--- a/tempest/api/volume/admin/test_volume_snapshot_quotas_negative.py
+++ b/tempest/api/volume/admin/test_volume_snapshot_quotas_negative.py
@@ -44,14 +44,12 @@
# to restore the quotas to their original values after the tests
# from this class are done. This is needed just in case Tempest is
# configured to use pre-provisioned projects/user accounts.
- cls.original_quota_set = (cls.admin_quotas_client.show_quota_set(
+ original_quota_set = (cls.admin_quotas_client.show_quota_set(
cls.demo_tenant_id)['quota_set'])
- cls.cleanup_quota_set = dict(
- (k, v) for k, v in cls.original_quota_set.items()
- if k in QUOTA_KEYS)
+ cleanup_quota_set = dict(
+ (k, v) for k, v in original_quota_set.items() if k in QUOTA_KEYS)
cls.addClassResourceCleanup(cls.admin_quotas_client.update_quota_set,
- cls.demo_tenant_id,
- **cls.cleanup_quota_set)
+ cls.demo_tenant_id, **cleanup_quota_set)
cls.default_volume_size = CONF.volume.volume_size
cls.shared_quota_set = {'gigabytes': 3 * cls.default_volume_size,
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/tox.ini b/tox.ini
index 970f415..65960b0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = pep8,py35,py27,pip-check-reqs
+envlist = pep8,py36,py27,pip-check-reqs
minversion = 2.3.1
skipsdist = True