1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

selftest: Add new test for testing non-chunk transfer encoding

And add a known fail because there is a bug :-(

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 93709d31590d4ca25fbac813b9e499755b81ddb5)
This commit is contained in:
Noel Power 2024-03-28 09:16:33 +00:00 committed by Jule Anger
parent 30bf3d1430
commit 2fb1bf0205
2 changed files with 15 additions and 1 deletions

View File

@ -46,7 +46,10 @@ class ChunkHTTPRequestHandler(BaseHTTPRequestHandler):
self.send_response(200)
self.send_header('content-type', 'application/json; charset=UTF-8')
self.send_header('Transfer-Encoding', 'chunked')
if self.path == "usegziptransferencoding":
self.send_header('Transfer-Encoding', 'gzip')
else:
self.send_header('Transfer-Encoding', 'chunked')
self.end_headers()
resp = bytes()
for chunk in chunks:
@ -114,3 +117,13 @@ class HttpChunkBlackboxTests(BlackboxTestCase):
except BlackboxProcessError as e:
print("Failed with: %s" % e)
self.fail(str(e))
def test_gzip_transfer_encoding(self):
try:
msg = "usegziptransferencoding"
resp = self.check_output("%s -U%% -I%s --rsize 50 --uri %s" % (COMMAND, os.getenv("SERVER_IP", "localhost"), msg))
self.assertEqual(msg, resp.decode('utf-8'))
self.fail("unexpected success")
except BlackboxProcessError as e:
if "http_response_needs_body: Unsupported transfer encoding type gzip" not in e.stderr.decode('utf-8'):
self.fail(str(e))

View File

@ -0,0 +1 @@
^samba.tests.blackbox.http_chunk.samba.tests.blackbox.http_chunk.HttpChunkBlackboxTests.test_gzip_transfer_encoding