Skip to content

Commit

Permalink
fix #375 body_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Lvov committed Jul 14, 2016
1 parent 0c64bac commit 698efc2
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions tempesta_fw/t/functional/tests/test_frang.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,39 @@ def header_timeout(self):
data = self.s.recv(1024)
print(data)

def body_timeout(self):
print("body_timeout")
part1 = b"POST /a.html HTTP/1.0\r\nHost: loc\r\n" +\
b"Content-Type: text/html\r\n" +\
b"Content-Length: 20\r\n\r\n" +\
b"<html>content"
part2 = b"</html>\r\n\r\n"

self.__init__()
self.cfg.add_section('frang_limits')
self.cfg.add_option('client_body_timeout', '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)
time.sleep(1)
self.s.send(part2)
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.field_len()]
tests = [self.field_len(), self.body_len(),\
# tests = [self.body_timeout()]
tests = [self.body_timeout(), self.field_len(),\
self.body_len(),\
self.host_required(), \
self.ct_required(), self.req_method(), self.ct_vals(), self.uri_len(),\
self.request_rate(),\
Expand Down

0 comments on commit 698efc2

Please sign in to comment.