Skip to content

Commit

Permalink
fix #375 field_len
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Lvov committed Apr 14, 2016
1 parent 94a2a9e commit 3ac0c80
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions tempesta_fw/t/functional/tests/test_frang.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,31 @@ def body_len(self):
time.sleep(5)
tfw.stop()

def field_len(self):
print("field_len")
self.res = False
self.__init__()
self.cfg.add_section('frang_limits')
self.cfg.add_option('http_ct_vals', '[\"text/html\"]')
self.cfg.add_option('http_field_len', '10')
self.cfg.add_end_of_section()
self.vs_get = b"POST /a.html HTTP/1.0\r\nHost: loc\r\n" +\
b"Content-Type: application/xml\r\n" +\
b"Content-Length: 20\r\n\r\n" +\
b"<html>content</html>\r\n\r\n"
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(self.vs_get)
data = self.s.recv(1024)
if len(data) == 0:
self.res = True

print("res:", self.res)
self.s.close()
time.sleep(5)
tfw.stop()


def ct_vals(self):
Expand Down Expand Up @@ -259,8 +284,9 @@ def header_timeout(self):
def get_name(self):
return 'test Frang'
def run(self):
# tests = [self.request_rate()]
tests = [self.body_len(), self.host_required(), \
# tests = [self.field_len()]
tests = [self.field_len(), self.body_len(),\
self.host_required(), \
self.ct_required(), self.req_method(), self.ct_vals(), self.uri_len(),\
self.request_rate(),\
self.conn_rate()]
Expand Down

0 comments on commit 3ac0c80

Please sign in to comment.