forked from espressif/esp-idf
fix bug in test case TCPIP_TCP_5101
test time is not set in test case and not used to control test time
This commit is contained in:
@@ -4367,7 +4367,7 @@ test cases:
|
|||||||
- TCPStress/TCPAPNSTA
|
- TCPStress/TCPAPNSTA
|
||||||
- - send_len = 1460
|
- - send_len = 1460
|
||||||
- [dummy]
|
- [dummy]
|
||||||
- - test_count = 0xFFFFFF
|
- - test_time = 720
|
||||||
- ['']
|
- ['']
|
||||||
- - server_port = "<test_tcp_port1>"
|
- - server_port = "<test_tcp_port1>"
|
||||||
- ['']
|
- ['']
|
||||||
@@ -4377,8 +4377,6 @@ test cases:
|
|||||||
- ['']
|
- ['']
|
||||||
- - send_delay = 50
|
- - send_delay = 50
|
||||||
- ['']
|
- ['']
|
||||||
- - pass_standard = (4*3600)
|
|
||||||
- ['']
|
|
||||||
- - ap_ip = "<target_ap_ip>"
|
- - ap_ip = "<target_ap_ip>"
|
||||||
- ['']
|
- ['']
|
||||||
comment: ''
|
comment: ''
|
||||||
|
@@ -12,6 +12,11 @@ class TestCase(TCActionBase.CommonTCActionBase):
|
|||||||
|
|
||||||
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
|
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
|
||||||
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
|
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
|
||||||
|
self.send_len = 1460
|
||||||
|
self.server_echo = True
|
||||||
|
self.sta_number = 4
|
||||||
|
self.test_time = 12 * 60
|
||||||
|
self.send_delay = 50
|
||||||
# load param from excel
|
# load param from excel
|
||||||
cmd_set = test_case["cmd set"]
|
cmd_set = test_case["cmd set"]
|
||||||
for i in range(1, len(cmd_set)):
|
for i in range(1, len(cmd_set)):
|
||||||
@@ -28,7 +33,6 @@ class TestCase(TCActionBase.CommonTCActionBase):
|
|||||||
try:
|
try:
|
||||||
# configurable params
|
# configurable params
|
||||||
send_len = self.send_len
|
send_len = self.send_len
|
||||||
test_count = self.test_count
|
|
||||||
server_echo = self.server_echo
|
server_echo = self.server_echo
|
||||||
sta_number = self.sta_number
|
sta_number = self.sta_number
|
||||||
test_time = self.test_time * 60
|
test_time = self.test_time * 60
|
||||||
@@ -120,19 +124,16 @@ class TestCase(TCActionBase.CommonTCActionBase):
|
|||||||
|
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
# step 4, do send/recv
|
# step 4, do send/recv
|
||||||
while test_count > 0:
|
while time.time() - start_time < test_time:
|
||||||
_tmp_count = TEST_COUNT_ONE_ROUND if test_count - TEST_COUNT_ONE_ROUND > 0 else test_count
|
|
||||||
test_count -= TEST_COUNT_ONE_ROUND
|
|
||||||
|
|
||||||
checker_stings = []
|
checker_stings = []
|
||||||
test_action_string = []
|
test_action_string = []
|
||||||
for i in range(sta_number):
|
for i in range(sta_number):
|
||||||
checker_stings.append("P SSC%d RE \+SEND:\d+,OK NC CLOSED" % (i+2))
|
checker_stings.append("P SSC%d RE \+SEND:\d+,OK NC CLOSED" % (i+2))
|
||||||
test_action_string.append("SSC SSC%d soc -S -s <client_sock%d> -l %d -n %d -j %d" %
|
test_action_string.append("SSC SSC%d soc -S -s <client_sock%d> -l %d -n %d -j %d" %
|
||||||
(i+2, i+2, send_len, _tmp_count, send_delay))
|
(i+2, i+2, send_len, TEST_COUNT_ONE_ROUND, send_delay))
|
||||||
if server_echo is True:
|
if server_echo is True:
|
||||||
test_action_string.append("SSC SSC1 soc -S -s <accept_sock%d> -l %d -n %d -j %d" %
|
test_action_string.append("SSC SSC1 soc -S -s <accept_sock%d> -l %d -n %d -j %d" %
|
||||||
(i+2, send_len, _tmp_count, send_delay))
|
(i+2, send_len, TEST_COUNT_ONE_ROUND, send_delay))
|
||||||
checker_stings.append("P SSC1 RE \"\+SEND:%%%%s,OK\"%%%%(<accept_sock%d>) NC CLOSED)" %
|
checker_stings.append("P SSC1 RE \"\+SEND:%%%%s,OK\"%%%%(<accept_sock%d>) NC CLOSED)" %
|
||||||
(i+2))
|
(i+2))
|
||||||
|
|
||||||
@@ -146,6 +147,8 @@ class TestCase(TCActionBase.CommonTCActionBase):
|
|||||||
if (time.time() - start_time) >= test_time:
|
if (time.time() - start_time) >= test_time:
|
||||||
self.result_cntx.set_result("Succeed")
|
self.result_cntx.set_result("Succeed")
|
||||||
else:
|
else:
|
||||||
|
self.result_cntx.set_result("Failed")
|
||||||
|
# TODO: create a function to create TCP connections. reuse not copy paste code
|
||||||
checker_stings = []
|
checker_stings = []
|
||||||
test_action_string = []
|
test_action_string = []
|
||||||
for i in range(sta_number + 1):
|
for i in range(sta_number + 1):
|
||||||
@@ -186,8 +189,6 @@ class TestCase(TCActionBase.CommonTCActionBase):
|
|||||||
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
|
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.result_cntx.set_result("Failed")
|
|
||||||
|
|
||||||
# finally, execute done
|
# finally, execute done
|
||||||
|
|
||||||
def result_check(self, port_name, data):
|
def result_check(self, port_name, data):
|
||||||
|
Reference in New Issue
Block a user