-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mekhanik evgenii/fix bug with access already freed mem #760
base: master
Are you sure you want to change the base?
Mekhanik evgenii/fix bug with access already freed mem #760
Conversation
3f3abd4
to
e7e74a2
Compare
http_general/test_headers.py
Outdated
return | ||
|
||
self.assertEqual(server.last_request.headers.get('trailer'), tr1 + " " + tr2) | ||
if not self.__is_hbp(tr1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably you should add checks if trailer is hbp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes fixed
http_general/test_headers.py
Outdated
self, name, method, tr1, tr1_val, tr2, tr2_val, expected_status_code | ||
): | ||
self.start_all_services() | ||
self.disable_deproxy_auto_parser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you disable the parser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
http_general/test_headers.py
Outdated
tr1_val="keep-alive", | ||
tr2="Keep-Alive", | ||
tr2_val="timeout=5, max=100", | ||
expected_status_code="200" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove expected_status_code
from test params. You always use 200
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
http_general/test_headers.py
Outdated
if not isinstance(client, DeproxyClientH2): | ||
if method != "HEAD" and not self.__is_hbp(tr1): | ||
self.assertEqual( | ||
client.last_response.trailer.get(tr1), | ||
tr1_val, | ||
"Moved trailer header value mismatch the original one", | ||
) | ||
else: | ||
self.assertFalse(client.last_response.trailer.get(tr1)) | ||
if method != "HEAD" and not self.__is_hbp(tr2): | ||
self.assertEqual( | ||
client.last_response.trailer.get(tr2), | ||
tr2_val, | ||
"Moved trailer header value mismatch the original one", | ||
) | ||
else: | ||
self.assertFalse(client.last_response.trailer.get(tr2)) | ||
self.assertEqual(client.last_response.headers.get("Transfer-Encoding"), "chunked") | ||
self.assertEqual(client.last_response.headers.get("Trailer"), tr1 + " " + tr2) | ||
self.assertIsNone(client.last_response.headers.get(tr1)) | ||
self.assertIsNone(client.last_response.headers.get(tr2)) | ||
else: | ||
if method != "HEAD" and not self.__is_hbp(tr1): | ||
self.assertEqual( | ||
client.last_response.headers.get(tr1), | ||
tr1_val, | ||
"Moved trailer header value mismatch the original one", | ||
) | ||
if method != "HEAD" and not self.__is_hbp(tr2): | ||
self.assertEqual( | ||
client.last_response.headers.get(tr2), | ||
tr2_val, | ||
"Moved trailer header value mismatch the original one", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add checks like test params. For example:
def assert_HEAD_http2_request(self, response):
self.assertIsNone(response.trailer.get(tr1))
self.assertIsNone(response.trailer.get(tr2))
@marks.Parameterize.expand(
[
marks.Param(
name="no_hbp_GET",
method="GET",
tr1="X-Token1",
tr1_val="value1",
tr2="X-Token2",
tr2_val="value2",
assert_func=assert_HEAD_http2_request,
),
...
]
def test_trailers_in_response(
self, name, method, tr1, tr1_val, tr2, tr2_val, assert_func
...
assert_func(self, client.last_response)
):
Also you can move this checks to DeproxyAutoParser, or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
e7e74a2
to
9fa396a
Compare
Now Tempesta blocks all bodyless methods requests if body is present (in case of chunked body also). So change method to POST in tests.
Linux reset ipv6 address if we set mtu less then 1500, so we should restore it ater test finished.
678f1f1
to
ba962c8
Compare
ba962c8
to
6e0ff3d
Compare
I also think about using |
No description provided.