Merge "Fix versioned_writes functional test skipping"
This commit is contained in:
commit
ce6c850258
@ -3423,6 +3423,9 @@ class TestObjectVersioningEnv(object):
|
|||||||
cls.container = cls.account.container(prefix + "-objs")
|
cls.container = cls.account.container(prefix + "-objs")
|
||||||
if not cls.container.create(
|
if not cls.container.create(
|
||||||
hdrs={'X-Versions-Location': cls.versions_container.name}):
|
hdrs={'X-Versions-Location': cls.versions_container.name}):
|
||||||
|
if cls.conn.response.status == 412:
|
||||||
|
cls.versioning_enabled = False
|
||||||
|
return
|
||||||
raise ResponseError(cls.conn.response)
|
raise ResponseError(cls.conn.response)
|
||||||
|
|
||||||
container_info = cls.container.info()
|
container_info = cls.container.info()
|
||||||
@ -3475,12 +3478,10 @@ class TestCrossPolicyObjectVersioningEnv(object):
|
|||||||
cls.multiple_policies_enabled = True
|
cls.multiple_policies_enabled = True
|
||||||
else:
|
else:
|
||||||
cls.multiple_policies_enabled = False
|
cls.multiple_policies_enabled = False
|
||||||
cls.versioning_enabled = False
|
cls.versioning_enabled = True
|
||||||
return
|
# We don't actually know the state of versioning, but without
|
||||||
|
# multiple policies the tests should be skipped anyway. Claiming
|
||||||
if cls.versioning_enabled is None:
|
# versioning support lets us report the right reason for skipping.
|
||||||
cls.versioning_enabled = 'versioned_writes' in cluster_info
|
|
||||||
if not cls.versioning_enabled:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
policy = cls.policies.select()
|
policy = cls.policies.select()
|
||||||
@ -3510,6 +3511,9 @@ class TestCrossPolicyObjectVersioningEnv(object):
|
|||||||
if not cls.container.create(
|
if not cls.container.create(
|
||||||
hdrs={'X-Versions-Location': cls.versions_container.name,
|
hdrs={'X-Versions-Location': cls.versions_container.name,
|
||||||
'X-Storage-Policy': version_policy['name']}):
|
'X-Storage-Policy': version_policy['name']}):
|
||||||
|
if cls.conn.response.status == 412:
|
||||||
|
cls.versioning_enabled = False
|
||||||
|
return
|
||||||
raise ResponseError(cls.conn.response)
|
raise ResponseError(cls.conn.response)
|
||||||
|
|
||||||
container_info = cls.container.info()
|
container_info = cls.container.info()
|
||||||
@ -3535,6 +3539,11 @@ class TestCrossPolicyObjectVersioningEnv(object):
|
|||||||
cls.storage_url3, cls.storage_token3 = cls.conn3.authenticate()
|
cls.storage_url3, cls.storage_token3 = cls.conn3.authenticate()
|
||||||
cls.account3 = cls.conn3.get_account()
|
cls.account3 = cls.conn3.get_account()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDown(cls):
|
||||||
|
cls.account.delete_containers()
|
||||||
|
cls.account2.delete_containers()
|
||||||
|
|
||||||
|
|
||||||
class TestObjectVersioning(Base):
|
class TestObjectVersioning(Base):
|
||||||
env = TestObjectVersioningEnv
|
env = TestObjectVersioningEnv
|
||||||
|
Loading…
Reference in New Issue
Block a user