From 88ce8f8718f0802d05a6faaacdd8701d7b62921e Mon Sep 17 00:00:00 2001 From: Sergey Lvov Date: Wed, 20 Apr 2016 15:10:18 +0300 Subject: [PATCH] fix #375 body_chunks --- tempesta_fw/t/functional/tests/test_frang.py | 34 ++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/tempesta_fw/t/functional/tests/test_frang.py b/tempesta_fw/t/functional/tests/test_frang.py index 3bfc01c04..4ea48c3ae 100755 --- a/tempesta_fw/t/functional/tests/test_frang.py +++ b/tempesta_fw/t/functional/tests/test_frang.py @@ -449,12 +449,42 @@ def body_timeout(self): time.sleep(5) tfw.stop() + def body_chunks(self): + print("body_chunks") + part1 = b"POST /a.html HTTP/1.0\r\nHost: loc\r\n" +\ +b"Content-Type: text/html\r\n" +\ +b"Content-Length: 30\r\n\r\n" +\ +b"content" + part2 = b"" + part3 = b"\r\n\r\n" + + self.__init__() + self.cfg.add_section('frang_limits') + self.cfg.add_option('http_ct_vals', '[\"text/html\"]') + self.cfg.add_option('http_body_chunk_cnt', '1') + self.cfg.add_end_of_section() + tfw.start_with_frang() + print("tfw start\n") + self.s = socket(AF_INET, SOCK_STREAM) + self.s.connect(('127.0.0.1', 8081)) + self.s.send(part1) + self.s.send(part2) + self.s.send(part3) + data = self.s.recv(1024) + if len(data) == 0: + self.res = True + print("res:", self.res) + time.sleep(5) + tfw.stop() + + def get_name(self): return 'test Frang' def run(self): -# tests = [self.header_chunks()] - tests = [self.header_chunks(), self.conn_burst(),\ +# tests = [self.body_chunks()] + tests = [self.body_chunks(), self.header_chunks(),\ + self.conn_burst(),\ self.request_burst(),\ self.body_timeout(),\ self.field_len(),\