tests: Get test_handoff_non_durable passing with encryption enabled
Can't make assertions on object-meta values when we're making direct requests; those have all been shifted to transient sysmeta. Use Content-Type instead, since we don't encrypt it. Change-Id: If2bb773cf428dfa3c23c634b3c046ba282053c02
This commit is contained in:
parent
e2beaefd7b
commit
91a6b52a4f
@ -338,7 +338,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
# PUT object at t1
|
||||
contents = Body(total=3.5 * 2 ** 20)
|
||||
headers = {'x-object-meta-foo': 'meta-foo'}
|
||||
headers_post = {'x-object-meta-bar': 'meta-bar'}
|
||||
headers_post = {'content-type': 'meta/bar'}
|
||||
client.put_object(self.url, self.token, self.container_name,
|
||||
self.object_name, contents=contents,
|
||||
headers=headers)
|
||||
@ -360,7 +360,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
# make sure we can GET the object; there's 5 primaries and 1 handoff
|
||||
headers, older_obj_etag = self.proxy_get()
|
||||
self.assertEqual(contents.etag, older_obj_etag)
|
||||
self.assertEqual('meta-bar', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar', headers.get('content-type'))
|
||||
|
||||
# PUT object at t2; make all frags non-durable so that the previous
|
||||
# durable frags at t1 remain on object server; use InternalClient so
|
||||
@ -369,7 +369,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
contents2 = Body(total=2.5 * 2 ** 20) # different content
|
||||
self.assertNotEqual(contents2.etag, older_obj_etag) # sanity check
|
||||
headers = {'x-backend-no-commit': 'True',
|
||||
'x-object-meta-bar': 'meta-bar-new'}
|
||||
'content-type': 'meta/bar-new'}
|
||||
internal_client.upload_object(contents2, self.account,
|
||||
self.container_name.decode('utf8'),
|
||||
self.object_name.decode('utf8'),
|
||||
@ -377,7 +377,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
# GET should still return the older durable object
|
||||
headers, obj_etag = self.proxy_get()
|
||||
self.assertEqual(older_obj_etag, obj_etag)
|
||||
self.assertEqual('meta-bar', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar', headers.get('content-type'))
|
||||
# on handoff we have older durable and newer non-durable
|
||||
_hdrs, frag_etag = self.assert_direct_get_succeeds(hnodes[0], opart)
|
||||
self.assertEqual(older_frag_etag, frag_etag)
|
||||
@ -391,7 +391,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
headers, newer_obj_etag = self.proxy_get()
|
||||
self.assertEqual(contents2.etag, newer_obj_etag)
|
||||
self.assertNotEqual(older_obj_etag, newer_obj_etag)
|
||||
self.assertEqual('meta-bar-new', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar-new', headers.get('content-type'))
|
||||
|
||||
# fix the 507'ing primary
|
||||
self.revive_drive(pdevs[0])
|
||||
@ -415,7 +415,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
headers, frag_etag = self.assert_direct_get_succeeds(
|
||||
hnodes[0], opart, require_durable=False)
|
||||
self.assertEqual(older_frag_etag, frag_etag)
|
||||
self.assertEqual('meta-bar', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar', headers.get('content-type'))
|
||||
|
||||
# fire up reconstructor on handoff node only, again
|
||||
self.reconstructor.once(number=hnode_id)
|
||||
@ -423,11 +423,11 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
# primary now has the newer non-durable frag and the older durable frag
|
||||
headers, frag_etag = self.assert_direct_get_succeeds(onodes[0], opart)
|
||||
self.assertEqual(older_frag_etag, frag_etag)
|
||||
self.assertEqual('meta-bar', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar', headers.get('content-type'))
|
||||
headers, frag_etag = self.assert_direct_get_succeeds(
|
||||
onodes[0], opart, require_durable=False)
|
||||
self.assertEqual(newer_frag_etag, frag_etag)
|
||||
self.assertEqual('meta-bar-new', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar-new', headers.get('content-type'))
|
||||
|
||||
# handoff has nothing
|
||||
self.assert_direct_get_fails(hnodes[0], opart, 404,
|
||||
@ -445,7 +445,7 @@ class TestReconstructorRevert(ECProbeTest):
|
||||
# sync the non-durable!
|
||||
headers, frag_etag = self.assert_direct_get_succeeds(onodes[0], opart)
|
||||
self.assertEqual(newer_frag_etag, frag_etag)
|
||||
self.assertEqual('meta-bar-new', headers.get('x-object-meta-bar'))
|
||||
self.assertEqual('meta/bar-new', headers.get('content-type'))
|
||||
|
||||
# revive primaries (in case we want to debug)
|
||||
for pdev in pdevs[2:]:
|
||||
|
Loading…
Reference in New Issue
Block a user