diff --git a/components/idf_test/integration_test/TestCaseAll.yml b/components/idf_test/integration_test/TestCaseAll.yml index 7e91ba7cb2..092fd161c3 100644 --- a/components/idf_test/integration_test/TestCaseAll.yml +++ b/components/idf_test/integration_test/TestCaseAll.yml @@ -4367,7 +4367,7 @@ test cases: - TCPStress/TCPAPNSTA - - send_len = 1460 - [dummy] - - - test_count = 0xFFFFFF + - - test_time = 720 - [''] - - server_port = "" - [''] @@ -4377,8 +4377,6 @@ test cases: - [''] - - send_delay = 50 - [''] - - - pass_standard = (4*3600) - - [''] - - ap_ip = "" - [''] comment: '' diff --git a/components/idf_test/integration_test/TestCaseScript/TCPStress/TCPAPNSTA.py b/components/idf_test/integration_test/TestCaseScript/TCPStress/TCPAPNSTA.py index 71e3038be1..6cf5f2a7b7 100755 --- a/components/idf_test/integration_test/TestCaseScript/TCPStress/TCPAPNSTA.py +++ b/components/idf_test/integration_test/TestCaseScript/TCPStress/TCPAPNSTA.py @@ -12,6 +12,11 @@ class TestCase(TCActionBase.CommonTCActionBase): 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) + 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 cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): @@ -28,7 +33,6 @@ class TestCase(TCActionBase.CommonTCActionBase): try: # configurable params send_len = self.send_len - test_count = self.test_count server_echo = self.server_echo sta_number = self.sta_number test_time = self.test_time * 60 @@ -120,19 +124,16 @@ class TestCase(TCActionBase.CommonTCActionBase): start_time = time.time() # step 4, do send/recv - while test_count > 0: - _tmp_count = TEST_COUNT_ONE_ROUND if test_count - TEST_COUNT_ONE_ROUND > 0 else test_count - test_count -= TEST_COUNT_ONE_ROUND - + while time.time() - start_time < test_time: checker_stings = [] test_action_string = [] for i in range(sta_number): checker_stings.append("P SSC%d RE \+SEND:\d+,OK NC CLOSED" % (i+2)) test_action_string.append("SSC SSC%d soc -S -s -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: test_action_string.append("SSC SSC1 soc -S -s -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\"%%%%() NC CLOSED)" % (i+2)) @@ -146,6 +147,8 @@ class TestCase(TCActionBase.CommonTCActionBase): if (time.time() - start_time) >= test_time: self.result_cntx.set_result("Succeed") else: + self.result_cntx.set_result("Failed") + # TODO: create a function to create TCP connections. reuse not copy paste code checker_stings = [] test_action_string = [] 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: return - self.result_cntx.set_result("Failed") - # finally, execute done def result_check(self, port_name, data):