Details:
I have tested server side directly by hand. I find there is 'transfer-encoding' header in response only when it is persistent connection。
I have checked the source test code, the test add "Connection:close" in the request explicitly,function as below
def request(self, url, method, *args, **kwargs):
class Response(dict):
def __init__(self, info):
for key, value in info.getheaders().items(): # We assume HTTP header name to be string, not random # bytes, thus ensure we have string keys. self[six.u(key).lower()] = value self.status = info.status self['status'] = str(self.status) self.reason = info.reason self.version = info.version self['content-location'] = url
# Follow up to 5 redirections. Don't raise an exception if
# it's exceeded but return the HTTP 3XX response instead.
retry = urllib3.util.Retry(raise_on_redirect=False, redirect=5)
r = super(ClosingHttp, self).request(method, url, retries=retry, *args, **new_kwargs)
return Response(r), r.data
function from "tempest.lib.common.http.ClosingHttp#request"
So I think it is not suitable to check 'transfer-encoding' header in test case 'tempest.api.object_storage.test_object_slo.ObjectSloTest.test_delete_large_object'
function as below:
def test_delete_large_object(self):
# delete static large object using multipart manifest
object_name = self._create_large_object()
# When deleting SLO using multipart manifest, the response contains
# not 'content-length' but 'transfer-encoding' header. This is the
# special case, therefore the existence of response headers is checked
# outside of custom matcher. self.assertIn('transfer-encoding', resp) self.assertIn('content-type', resp) self.assertIn('x-trans-id', resp) self.assertIn('date', resp)
function from "tempest.api.object_storage.test_object_slo.ObjectSloTest#test_delete_large_object"
Details:
I have tested server side directly by hand. I find there is 'transfer-encoding' header in response only when it is persistent connection。
I have checked the source test code, the test add "Connection:close" in the request explicitly,function as below
def request(self, url, method, *args, **kwargs):
class Response(dict): ().items( ):
# We assume HTTP header name to be string, not random
# bytes, thus ensure we have string keys.
self[ six.u(key) .lower( )] = value
self. status = info.status
self[ 'status' ] = str(self.status)
self. reason = info.reason
self. version = info.version
self[ 'content- location' ] = url
def __init__(self, info):
for key, value in info.getheaders
new_headers = dict(original_
new_kwargs = dict(kwargs, headers=
# Follow up to 5 redirections. Don't raise an exception if util.Retry( raise_on_ redirect= False, redirect=5) method, url, retries=retry,
*args, **new_kwargs)
# it's exceeded but return the HTTP 3XX response instead.
retry = urllib3.
r = super(ClosingHttp, self).request(
return Response(r), r.data
function from "tempest. lib.common. http.ClosingHtt p#request"
So I think it is not suitable to check 'transfer-encoding' header in test case 'tempest. api.object_ storage. test_object_ slo.ObjectSloTe st.test_ delete_ large_object' large_object( self): large_object( )
function as below:
def test_delete_
# delete static large object using multipart manifest
object_name = self._create_
params_del = {'multipart- manifest' : 'delete'} client. delete_ object(
self. container_ name,
object_ name,
params= params_ del)
resp, _ = self.object_
# When deleting SLO using multipart manifest, the response contains
self.assertIn( 'transfer- encoding' , resp)
self.assertIn( 'content- type', resp)
self.assertIn( 'x-trans- id', resp)
self.assertIn( 'date', resp)
# not 'content-length' but 'transfer-encoding' header. This is the
# special case, therefore the existence of response headers is checked
# outside of custom matcher.
function from "tempest. api.object_ storage. test_object_ slo.ObjectSloTe st#test_ delete_ large_object"
Other information: /github. com/openstack/ tempest/ releases
1.tempest version:18.0.0
https:/
2.test case name api.object_ storage. test_object_ slo.ObjectSloTe st.test_ delete_ large_object[ id-87b6dfa1- abe9-404d- 8bf0-6c3751e6aa 77]
tempest.
3.client side debug log tempest/ refstack- client/ .tempest/ tempest/ common/ utils/_ _init__ .py", line 107, in wrapper tempest/ refstack- client/ .tempest/ tempest/ api/object_ storage/ test_object_ slo.py" , line 167, in test_delete_ large_object assertIn( 'transfer- encoding' , resp) tempest/ refstack- client/ .tempest/ .venv/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 417, in assertIn assertThat( haystack, Contains(needle), message) tempest/ refstack- client/ .tempest/ .venv/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 498, in assertThat matchers. _impl.MismatchE rror: 'transfer-encoding' not in {'status': '200', 'content-location': 'https:/ /swift. eu-de.otc. t-systems. com/v1/ AUTH_e88b9cf690 8b493fa7c5fd853 f306df6/ tempest- TestContainer- 1214636738/ tempest- TestObject- 694206116? multipart- manifest= delete', u'connection': 'close', u'x-trans-id': 'tx052100000169 74ad0aa80- 3c39a872f5' , u'date': 'Wed, 13 Mar 2019 01:31:31 GMT', u'content-type': 'text/plain'}
Traceback (most recent call last):
File "/home/
return func(*func_args, **func_kwargs)
File "/home/
self.
File "/home/
self.
File "/home/
raise mismatch_error
testtools.
0^M
]
tags: -worker-0
4. server side header infomation Encoding: identity Token:< omitted> xx.xx.xx. com
Connection:close
Accept-
X-Auth-
Host:swift.