mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'test/change_iperf_test_env' into 'master'
test: use simplified env to test iperf cases See merge request idf/esp-idf!3554
This commit is contained in:
commit
4f4bed5e65
@ -940,7 +940,7 @@ example_test_002_01:
|
|||||||
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
|
||||||
tags:
|
tags:
|
||||||
- ESP32
|
- ESP32
|
||||||
- Example_ShieldBox
|
- Example_ShieldBox_Basic
|
||||||
|
|
||||||
example_test_003_01:
|
example_test_003_01:
|
||||||
<<: *example_test_template
|
<<: *example_test_template
|
||||||
@ -960,6 +960,16 @@ example_test_005_01:
|
|||||||
- ESP32
|
- ESP32
|
||||||
- Example_WIFI_BT
|
- Example_WIFI_BT
|
||||||
|
|
||||||
|
example_test_006_01:
|
||||||
|
<<: *example_test_template
|
||||||
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
|
||||||
|
only:
|
||||||
|
variables:
|
||||||
|
- $BOT_LABEL_IPERF_STRESS_TEST
|
||||||
|
tags:
|
||||||
|
- ESP32
|
||||||
|
- Example_ShieldBox
|
||||||
|
|
||||||
UT_001_01:
|
UT_001_01:
|
||||||
<<: *unit_test_template
|
<<: *unit_test_template
|
||||||
tags:
|
tags:
|
||||||
|
@ -483,24 +483,19 @@ def build_iperf_with_config(config_name):
|
|||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
|
||||||
def get_configs(env):
|
@IDF.idf_example_test(env_tag="Example_ShieldBox_Basic", category="stress")
|
||||||
att_port = env.get_variable("attenuator_port")
|
|
||||||
ap_list = env.get_variable("ap_list")
|
|
||||||
pc_nic_ip = env.get_pc_nic_info("pc_nic", "ipv4")["addr"]
|
|
||||||
apc_ip = env.get_variable("apc_ip")
|
|
||||||
pc_iperf_log_file = os.path.join(env.log_path, "pc_iperf_log.md")
|
|
||||||
return att_port, ap_list, pc_nic_ip, apc_ip, pc_iperf_log_file
|
|
||||||
|
|
||||||
|
|
||||||
@IDF.idf_example_test(env_tag="Example_ShieldBox", category="stress")
|
|
||||||
def test_wifi_throughput_with_different_configs(env, extra_data):
|
def test_wifi_throughput_with_different_configs(env, extra_data):
|
||||||
"""
|
"""
|
||||||
steps: |
|
steps: |
|
||||||
1. build iperf with specified configs
|
1. build iperf with specified configs
|
||||||
2. test throughput for all routers
|
2. test throughput for all routers
|
||||||
"""
|
"""
|
||||||
att_port, ap_list, pc_nic_ip, apc_ip, pc_iperf_log_file = get_configs(env)
|
pc_nic_ip = env.get_pc_nic_info("pc_nic", "ipv4")["addr"]
|
||||||
ap_info = ap_list[0]
|
pc_iperf_log_file = os.path.join(env.log_path, "pc_iperf_log.md")
|
||||||
|
ap_info = {
|
||||||
|
"ssid": env.get_variable("ap_ssid"),
|
||||||
|
"password": env.get_variable("ap_password"),
|
||||||
|
}
|
||||||
|
|
||||||
config_names_raw = subprocess.check_output(["ls", os.path.dirname(os.path.abspath(__file__))])
|
config_names_raw = subprocess.check_output(["ls", os.path.dirname(os.path.abspath(__file__))])
|
||||||
|
|
||||||
@ -529,14 +524,6 @@ def test_wifi_throughput_with_different_configs(env, extra_data):
|
|||||||
test_utility = IperfTestUtility(dut, config_name, ap_info["ssid"],
|
test_utility = IperfTestUtility(dut, config_name, ap_info["ssid"],
|
||||||
ap_info["password"], pc_nic_ip, pc_iperf_log_file, test_result[config_name])
|
ap_info["password"], pc_nic_ip, pc_iperf_log_file, test_result[config_name])
|
||||||
|
|
||||||
PowerControl.Control.control_rest(apc_ip, ap_info["outlet"], "OFF")
|
|
||||||
PowerControl.Control.control(apc_ip, {ap_info["outlet"]: "ON"})
|
|
||||||
assert Attenuator.set_att(att_port, 0) is True
|
|
||||||
|
|
||||||
if not test_utility.wait_ap_power_on():
|
|
||||||
Utility.console_log("[{}] failed to power on, skip testing this AP"
|
|
||||||
.format(ap_info["ssid"]), color="red")
|
|
||||||
|
|
||||||
for _ in range(RETRY_COUNT_FOR_BEST_PERFORMANCE):
|
for _ in range(RETRY_COUNT_FOR_BEST_PERFORMANCE):
|
||||||
test_utility.run_all_cases(0)
|
test_utility.run_all_cases(0)
|
||||||
|
|
||||||
@ -563,8 +550,10 @@ def test_wifi_throughput_vs_rssi(env, extra_data):
|
|||||||
3. set attenuator value from 0-60 for each router
|
3. set attenuator value from 0-60 for each router
|
||||||
4. test TCP tx rx and UDP tx rx throughput
|
4. test TCP tx rx and UDP tx rx throughput
|
||||||
"""
|
"""
|
||||||
att_port, ap_list, pc_nic_ip, apc_ip, pc_iperf_log_file = get_configs(env)
|
att_port = env.get_variable("attenuator_port")
|
||||||
|
ap_list = env.get_variable("ap_list")
|
||||||
|
pc_nic_ip = env.get_pc_nic_info("pc_nic", "ipv4")["addr"]
|
||||||
|
apc_ip = env.get_variable("apc_ip")
|
||||||
pc_iperf_log_file = os.path.join(env.log_path, "pc_iperf_log.md")
|
pc_iperf_log_file = os.path.join(env.log_path, "pc_iperf_log.md")
|
||||||
|
|
||||||
test_result = {
|
test_result = {
|
||||||
@ -609,15 +598,19 @@ def test_wifi_throughput_vs_rssi(env, extra_data):
|
|||||||
report.generate_report()
|
report.generate_report()
|
||||||
|
|
||||||
|
|
||||||
@IDF.idf_example_test(env_tag="Example_ShieldBox")
|
@IDF.idf_example_test(env_tag="Example_ShieldBox_Basic")
|
||||||
def test_wifi_throughput_basic(env, extra_data):
|
def test_wifi_throughput_basic(env, extra_data):
|
||||||
"""
|
"""
|
||||||
steps: |
|
steps: |
|
||||||
1. test TCP tx rx and UDP tx rx throughput
|
1. test TCP tx rx and UDP tx rx throughput
|
||||||
2. compare with the pre-defined pass standard
|
2. compare with the pre-defined pass standard
|
||||||
"""
|
"""
|
||||||
att_port, ap_list, pc_nic_ip, apc_ip, pc_iperf_log_file = get_configs(env)
|
pc_nic_ip = env.get_pc_nic_info("pc_nic", "ipv4")["addr"]
|
||||||
ap_info = ap_list[0]
|
pc_iperf_log_file = os.path.join(env.log_path, "pc_iperf_log.md")
|
||||||
|
ap_info = {
|
||||||
|
"ssid": env.get_variable("ap_ssid"),
|
||||||
|
"password": env.get_variable("ap_password"),
|
||||||
|
}
|
||||||
|
|
||||||
# 1. build iperf with best config
|
# 1. build iperf with best config
|
||||||
build_iperf_with_config(BEST_PERFORMANCE_CONFIG)
|
build_iperf_with_config(BEST_PERFORMANCE_CONFIG)
|
||||||
@ -638,14 +631,6 @@ def test_wifi_throughput_basic(env, extra_data):
|
|||||||
test_utility = IperfTestUtility(dut, BEST_PERFORMANCE_CONFIG, ap_info["ssid"],
|
test_utility = IperfTestUtility(dut, BEST_PERFORMANCE_CONFIG, ap_info["ssid"],
|
||||||
ap_info["password"], pc_nic_ip, pc_iperf_log_file, test_result)
|
ap_info["password"], pc_nic_ip, pc_iperf_log_file, test_result)
|
||||||
|
|
||||||
PowerControl.Control.control_rest(apc_ip, ap_info["outlet"], "OFF")
|
|
||||||
PowerControl.Control.control(apc_ip, {ap_info["outlet"]: "ON"})
|
|
||||||
assert Attenuator.set_att(att_port, 0) is True
|
|
||||||
|
|
||||||
if not test_utility.wait_ap_power_on():
|
|
||||||
Utility.console_log("[{}] failed to power on, skip testing this AP"
|
|
||||||
.format(ap_info["ssid"]), color="red")
|
|
||||||
|
|
||||||
# 4. run test for TCP Tx, Rx and UDP Tx, Rx
|
# 4. run test for TCP Tx, Rx and UDP Tx, Rx
|
||||||
for _ in range(RETRY_COUNT_FOR_BEST_PERFORMANCE):
|
for _ in range(RETRY_COUNT_FOR_BEST_PERFORMANCE):
|
||||||
test_utility.run_all_cases(0)
|
test_utility.run_all_cases(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user