From a274ddea7161da09251a43c82fa62070a745115b Mon Sep 17 00:00:00 2001 From: whd <7058128+superwhd@users.noreply.github.com> Date: Thu, 1 Apr 2021 13:22:34 +0800 Subject: [PATCH] [tests] fix wrong usage of ping timeouts (#6381) In tests/scripts/thread-cert/node.py, the timeout parameter of ping() function is in seconds. However, in some test cases they called ping() with a timeout in milliseconds. I used the following command to list ping() usages with a specified timeout: grep -rn "ping.*timeout=" tests/scripts/thread-cert/* --- ..._LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py | 2 +- .../thread-cert/v1_2_LowPower_7_2_01_ForwardTrackingSeries.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scripts/thread-cert/v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py b/tests/scripts/thread-cert/v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py index 6166b2463..b4d95a9b4 100755 --- a/tests/scripts/thread-cert/v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py +++ b/tests/scripts/thread-cert/v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py @@ -85,7 +85,7 @@ class LowPower_7_1_01(thread_cert.TestCase): leader_addr = self.nodes[LEADER].get_ip6_address(ADDRESS_TYPE.LINK_LOCAL) # Step 3 - Verify connectivity by instructing each device to sending an ICMPv6 Echo Request to the DUT - self.assertTrue(self.nodes[SED_1].ping(leader_addr, timeout=POLL_PERIOD)) + self.assertTrue(self.nodes[SED_1].ping(leader_addr, timeout=POLL_PERIOD / 1000)) self.assertTrue(self.nodes[SSED_1].ping(leader_addr)) self.simulator.go(5) diff --git a/tests/scripts/thread-cert/v1_2_LowPower_7_2_01_ForwardTrackingSeries.py b/tests/scripts/thread-cert/v1_2_LowPower_7_2_01_ForwardTrackingSeries.py index 924495e1f..94c02ee8b 100755 --- a/tests/scripts/thread-cert/v1_2_LowPower_7_2_01_ForwardTrackingSeries.py +++ b/tests/scripts/thread-cert/v1_2_LowPower_7_2_01_ForwardTrackingSeries.py @@ -90,8 +90,8 @@ class LowPower_7_2_01_ForwardTrackingSeries(thread_cert.TestCase): leader_addr = self.nodes[LEADER].get_ip6_address(ADDRESS_TYPE.LINK_LOCAL) # Step 3 - Verify connectivity by instructing each device to send an ICMPv6 Echo Request to the DUT - self.assertTrue(self.nodes[SED_1].ping(leader_addr, timeout=POLL_PERIOD)) - self.assertTrue(self.nodes[SSED_1].ping(leader_addr, timeout=2 * consts.CSL_DEFAULT_PERIOD)) + self.assertTrue(self.nodes[SED_1].ping(leader_addr, timeout=POLL_PERIOD / 1000)) + self.assertTrue(self.nodes[SSED_1].ping(leader_addr, timeout=2 * consts.CSL_DEFAULT_PERIOD_IN_SECOND)) self.simulator.go(5) # Step 4 - SED_1 requests a Forward Tracking Series by sending a Link Metrics Management Request