Noticed on a recent test run:
http://logs.openstack.org/39/446239/5/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/0b6acd6/logs/testr_results.html.gz
ft1.2: tempest.api.volume.admin.test_volume_quota_classes.VolumeQuotaClassesTest.test_update_default_quota[id-a7644c63-2669-467a-b00e-452dd5c5397b]_StringException: Empty attachments:
stderr
stdout
pythonlogging:'': {{{
2017-04-29 03:26:52,898 27693 DEBUG [tempest.api.volume.admin.test_volume_quota_classes] Get the current default quota class values
2017-04-29 03:26:53,004 27693 INFO [tempest.lib.common.rest_client] Request (VolumeQuotaClassesTest:test_update_default_quota): 200 GET https://10.220.1.204:8776/v2/2e530cfd3b3448a689831c0831ad25ea/os-quota-class-sets/default 0.105s
2017-04-29 03:26:53,005 27693 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Accept': 'application/json', 'X-Auth-Token': '<omitted>', 'Content-Type': 'application/json'}
Body: None
Response - Headers: {u'connection': 'close', u'date': 'Sat, 29 Apr 2017 03:26:53 GMT', u'content-type': 'application/json', 'status': '200', u'x-compute-request-id': 'req-b528dce0-7fb8-40e3-adbd-68a332233fcb', u'server': 'Apache/2.4.18 (Ubuntu)', 'content-location': 'https://10.220.1.204:8776/v2/2e530cfd3b3448a689831c0831ad25ea/os-quota-class-sets/default', u'content-length': '629', u'x-openstack-request-id': 'req-b528dce0-7fb8-40e3-adbd-68a332233fcb'}
Body: {"quota_class_set": {"per_volume_gigabytes": -1, "volumes_lvmdriver-1": -1, "gigabytes_tempest-QosSpecsTestJSON-volume-type-1219921907": -1, "gigabytes": 1000, "gigabytes_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "backup_gigabytes": 1000, "snapshots_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "snapshots": 10, "gigabytes_lvmdriver-1": -1, "volumes": 10, "volumes_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "snapshots_lvmdriver-1": -1, "backups": 10, "id": "default", "volumes_tempest-QosSpecsTestJSON-volume-type-1219921907": -1, "snapshots_tempest-QosSpecsTestJSON-volume-type-1219921907": -1}}
2017-04-29 03:26:53,006 27693 DEBUG [tempest.api.volume.admin.test_volume_quota_classes] Update limits for the default quota class set
2017-04-29 03:26:53,364 27693 INFO [tempest.lib.common.rest_client] Request (VolumeQuotaClassesTest:test_update_default_quota): 200 PUT https://10.220.1.204:8776/v2/2e530cfd3b3448a689831c0831ad25ea/os-quota-class-sets/default 0.358s
2017-04-29 03:26:53,365 27693 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Accept': 'application/json', 'X-Auth-Token': '<omitted>', 'Content-Type': 'application/json'}
Body: {"quota_class_set": {"gigabytes": 1001, "snapshots_tempest-QosSpecsTestJSON-volume-type-1219921907": -1, "backups": 11, "gigabytes_tempest-QosSpecsTestJSON-volume-type-1219921907": -1, "volumes_lvmdriver-1": -1, "volumes": 11, "snapshots_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "per_volume_gigabytes": -1, "snapshots_lvmdriver-1": -1, "gigabytes_lvmdriver-1": -1, "volumes_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "gigabytes_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "backup_gigabytes": 1001, "snapshots": 11, "volumes_tempest-QosSpecsTestJSON-volume-type-1219921907": -1}}
Response - Headers: {u'connection': 'close', u'date': 'Sat, 29 Apr 2017 03:26:53 GMT', u'content-type': 'application/json', 'status': '200', u'x-compute-request-id': 'req-9aabf948-e8db-472c-80c6-eb52023b8e50', u'server': 'Apache/2.4.18 (Ubuntu)', 'content-location': 'https://10.220.1.204:8776/v2/2e530cfd3b3448a689831c0831ad25ea/os-quota-class-sets/default', u'content-length': '226', u'x-openstack-request-id': 'req-9aabf948-e8db-472c-80c6-eb52023b8e50'}
Body: {"quota_class_set": {"per_volume_gigabytes": -1, "volumes_lvmdriver-1": -1, "gigabytes": 1001, "backup_gigabytes": 1001, "snapshots": 11, "gigabytes_lvmdriver-1": -1, "volumes": 11, "snapshots_lvmdriver-1": -1, "backups": 11}}
2017-04-29 03:26:53,392 27693 DEBUG [tempest.api.volume.admin.test_volume_quota_classes] Restoring volume quota class defaults
2017-04-29 03:26:53,715 27693 INFO [tempest.lib.common.rest_client] Request (VolumeQuotaClassesTest:_run_cleanups): 200 PUT https://10.220.1.204:8776/v2/2e530cfd3b3448a689831c0831ad25ea/os-quota-class-sets/default 0.321s
2017-04-29 03:26:53,716 27693 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Accept': 'application/json', 'X-Auth-Token': '<omitted>', 'Content-Type': 'application/json'}
Body: {"quota_class_set": {"gigabytes": 1000, "snapshots_tempest-QosSpecsTestJSON-volume-type-1219921907": -1, "backups": 10, "gigabytes_tempest-QosSpecsTestJSON-volume-type-1219921907": -1, "volumes_lvmdriver-1": -1, "volumes": 10, "snapshots_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "per_volume_gigabytes": -1, "snapshots_lvmdriver-1": -1, "gigabytes_lvmdriver-1": -1, "gigabytes_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "backup_gigabytes": 1000, "snapshots": 10, "volumes_tempest-QosSpecsTestJSON-volume-type-1720475050": -1, "volumes_tempest-QosSpecsTestJSON-volume-type-1219921907": -1}}
Response - Headers: {u'connection': 'close', u'date': 'Sat, 29 Apr 2017 03:26:53 GMT', u'content-type': 'application/json', 'status': '200', u'x-compute-request-id': 'req-21d5465a-9b4e-4509-b526-562b7429279e', u'server': 'Apache/2.4.18 (Ubuntu)', 'content-location': 'https://10.220.1.204:8776/v2/2e530cfd3b3448a689831c0831ad25ea/os-quota-class-sets/default', u'content-length': '226', u'x-openstack-request-id': 'req-21d5465a-9b4e-4509-b526-562b7429279e'}
Body: {"quota_class_set": {"per_volume_gigabytes": -1, "volumes_lvmdriver-1": -1, "gigabytes": 1000, "backup_gigabytes": 1000, "snapshots": 10, "gigabytes_lvmdriver-1": -1, "volumes": 10, "snapshots_lvmdriver-1": -1, "backups": 10}}
}}}
Traceback (most recent call last):
File "tempest/api/volume/admin/test_volume_quota_classes.py", line 72, in test_update_default_quota
matchers.ContainsAll(body.items()))
File "/opt/stack/new/tempest/.tox/tempest/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
raise mismatch_error
testtools.matchers._impl.MismatchError: Differences: [
(u'snapshots_tempest-QosSpecsTestJSON-volume-type-1219921907', -1) not in [(u'gigabytes', 1001), (u'backups', 11), (u'snapshots_lvmdriver-1', -1), (u'volumes_lvmdriver-1', -1), (u'volumes', 11), (u'per_volume_gigabytes', -1), (u'backup_gigabytes', 1001), (u'gigabytes_lvmdriver-1', -1), (u'snapshots', 11)]
(u'gigabytes_tempest-QosSpecsTestJSON-volume-type-1219921907', -1) not in [(u'gigabytes', 1001), (u'backups', 11), (u'snapshots_lvmdriver-1', -1), (u'volumes_lvmdriver-1', -1), (u'volumes', 11), (u'per_volume_gigabytes', -1), (u'backup_gigabytes', 1001), (u'gigabytes_lvmdriver-1', -1), (u'snapshots', 11)]
(u'snapshots_tempest-QosSpecsTestJSON-volume-type-1720475050', -1) not in [(u'gigabytes', 1001), (u'backups', 11), (u'snapshots_lvmdriver-1', -1), (u'volumes_lvmdriver-1', -1), (u'volumes', 11), (u'per_volume_gigabytes', -1), (u'backup_gigabytes', 1001), (u'gigabytes_lvmdriver-1', -1), (u'snapshots', 11)]
(u'gigabytes_tempest-QosSpecsTestJSON-volume-type-1720475050', -1) not in [(u'gigabytes', 1001), (u'backups', 11), (u'snapshots_lvmdriver-1', -1), (u'volumes_lvmdriver-1', -1), (u'volumes', 11), (u'per_volume_gigabytes', -1), (u'backup_gigabytes', 1001), (u'gigabytes_lvmdriver-1', -1), (u'snapshots', 11)]
(u'volumes_tempest-QosSpecsTestJSON-volume-type-1720475050', -1) not in [(u'gigabytes', 1001), (u'backups', 11), (u'snapshots_lvmdriver-1', -1), (u'volumes_lvmdriver-1', -1), (u'volumes', 11), (u'per_volume_gigabytes', -1), (u'backup_gigabytes', 1001), (u'gigabytes_lvmdriver-1', -1), (u'snapshots', 11)]
(u'volumes_tempest-QosSpecsTestJSON-volume-type-1219921907', -1) not in [(u'gigabytes', 1001), (u'backups', 11), (u'snapshots_lvmdriver-1', -1), (u'volumes_lvmdriver-1', -1), (u'volumes', 11), (u'per_volume_gigabytes', -1), (u'backup_gigabytes', 1001), (u'gigabytes_lvmdriver-1', -1), (u'snapshots', 11)]
]
It appears there is a race with other tests where VolumeQuotaClassesTest.test_update_default_quota doesn't see what it expects when asserting the quota default update that it made.
The fix here is to lock the quotas test class against the Qos test class so they can't run at the same time. Normally we'd use the lock fixture for this, but to do that we'll have to reorganize the tests a bit to not do everything at a class level. It might be just easier to manually add the lock acquire in resource_setup() and the release in resource_cleanup().