Negative test for non-empty chunked put symlink

Change-Id: I0c3a235b8905e02d2e202215f7f0b43db295b79b
Related-Change-Id: I66f2f16d7cf0b9cb0888e3b9b1a17b9112233d21
This commit is contained in:
Clay Gerrard 2019-08-01 09:31:56 -05:00
parent a1455b3a35
commit 7678e94a2c
1 changed files with 10 additions and 0 deletions

View File

@ -107,6 +107,16 @@ class TestSymlinkMiddleware(TestSymlinkMiddlewareBase):
val = hdrs.get('X-Object-Sysmeta-Container-Update-Override-Etag')
self.assertEqual(val, '%s; symlink_target=c1/o' % MD5_OF_EMPTY_STRING)
def test_symlink_chunked_put_error(self):
self.app.register('PUT', '/v1/a/c/symlink', swob.HTTPCreated, {})
req = Request.blank('/v1/a/c/symlink', method='PUT',
headers={'X-Symlink-Target': 'c1/o'},
environ={'wsgi.input':
io.BytesIO(b'this has a body')})
self.assertIsNone(req.content_length) # sanity
status, headers, body = self.call_sym(req)
self.assertEqual(status, '400 Bad Request')
def test_symlink_put_different_account(self):
self.app.register('PUT', '/v1/a/c/symlink', swob.HTTPCreated, {})
req = Request.blank('/v1/a/c/symlink', method='PUT',