From d4ec67725369eae2199d3a1e9fc06d61dc873116 Mon Sep 17 00:00:00 2001 From: yiwenxiu Date: Tue, 11 Feb 2025 15:01:02 +0800 Subject: [PATCH] feat(openthread): add br library check case --- .../openthread/ot_br/main/idf_component.yml | 2 +- .../openthread/ot_br/sdkconfig.ci.br_libcheck | 1 + examples/openthread/pytest_otbr.py | 34 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 examples/openthread/ot_br/sdkconfig.ci.br_libcheck diff --git a/examples/openthread/ot_br/main/idf_component.yml b/examples/openthread/ot_br/main/idf_component.yml index bf43f391cb..dff9291048 100644 --- a/examples/openthread/ot_br/main/idf_component.yml +++ b/examples/openthread/ot_br/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: espressif/esp_ot_cli_extension: - version: "~1.2.0" + version: "~1.3.0" espressif/mdns: "^1.0.3" ## Required IDF version idf: diff --git a/examples/openthread/ot_br/sdkconfig.ci.br_libcheck b/examples/openthread/ot_br/sdkconfig.ci.br_libcheck new file mode 100644 index 0000000000..92e017398a --- /dev/null +++ b/examples/openthread/ot_br/sdkconfig.ci.br_libcheck @@ -0,0 +1 @@ +CONFIG_OPENTHREAD_BR_LIB_CHECK=y diff --git a/examples/openthread/pytest_otbr.py b/examples/openthread/pytest_otbr.py index 846247e2ad..9c0e8cf017 100644 --- a/examples/openthread/pytest_otbr.py +++ b/examples/openthread/pytest_otbr.py @@ -62,6 +62,9 @@ from pytest_embedded_idf.dut import IdfDut # Case 15: Thread network formation and attaching with TREL # A TREL device forms a Thread network, other TREL devices attach to it, then test ping connection between them. +# Case 16: Thread network BR lib check +# Check BR library compatibility + @pytest.fixture(scope='module', name='Init_avahi') def fixture_Init_avahi() -> bool: @@ -928,3 +931,34 @@ def test_trel_connect(dut: Tuple[IdfDut, IdfDut]) -> None: for trel in trel_list: ocf.execute_command(trel, 'factoryreset') time.sleep(3) + + +# Case 16: Thread network BR lib check +@pytest.mark.supported_targets +@pytest.mark.openthread_br +@pytest.mark.flaky(reruns=1, reruns_delay=1) +@pytest.mark.parametrize( + 'config, count, app_path, target, port', + [ + pytest.param( + 'rcp_uart|br_libcheck', + 2, + f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' + f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', + 'esp32c6|esp32s3', + f'{ESPPORT3}|{ESPPORT2}', + id='c6-s3' + ), + ], + indirect=True, +) +def test_br_lib_check(dut: Tuple[IdfDut, IdfDut]) -> None: + br = dut[1] + dut[0].serial.stop_redirect_thread() + try: + time.sleep(3) + ocf.execute_command(br, 'brlibcheck') + br.expect('The br library compatibility checking passed', timeout=10) + finally: + ocf.execute_command(br, 'factoryreset') + time.sleep(3)