mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(iperf): fix incorrect test expectation logic
This commit is contained in:
@@ -30,6 +30,12 @@ except ImportError:
|
||||
NO_BANDWIDTH_LIMIT = -1 # iperf send bandwidth is not limited
|
||||
|
||||
|
||||
def get_ip_and_wait_prompt(dut: Dut) -> Any:
|
||||
dut_ip = dut.expect(r'esp_netif_handlers: .+ ip: (\d+\.\d+\.\d+\.\d+),').group(1)
|
||||
dut.expect('iperf>')
|
||||
return dut_ip
|
||||
|
||||
|
||||
class IperfTestUtilityEth(IperfUtility.IperfTestUtility):
|
||||
"""iperf test implementation"""
|
||||
|
||||
@@ -52,9 +58,7 @@ class IperfTestUtilityEth(IperfUtility.IperfTestUtility):
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
self.dut.write('restart')
|
||||
self.dut.expect("Type 'help' to get the list of commands.")
|
||||
self.dut.expect('iperf>')
|
||||
dut_ip = self.dut.expect(r'esp_netif_handlers: .+ ip: (\d+\.\d+\.\d+\.\d+),').group(1)
|
||||
dut_ip = get_ip_and_wait_prompt(self.dut)
|
||||
rssi = 0
|
||||
return dut_ip, rssi
|
||||
|
||||
@@ -73,12 +77,11 @@ def test_esp_eth_iperf(
|
||||
2. compare with the pre-defined pass standard
|
||||
"""
|
||||
|
||||
# 1. wait for DUT
|
||||
dut.expect_exact('iperf>')
|
||||
# 1. wait for DUT to be ready
|
||||
dut_ip = get_ip_and_wait_prompt(dut)
|
||||
|
||||
# 2. preparing
|
||||
pc_iperf_log_file = os.path.join(dut.logdir, 'pc_iperf_log.md')
|
||||
dut_ip = dut.expect(r'esp_netif_handlers: .+ ip: (\d+\.\d+\.\d+\.\d+),').group(1)
|
||||
pc_nic_ip = get_host_ip4_by_dest_ip(dut_ip)
|
||||
test_result = {
|
||||
'tcp_tx': IperfUtility.TestResult('tcp', 'tx', 'ethernet'),
|
||||
|
||||
Reference in New Issue
Block a user