From a4ff6ba643234e03a22f12bee5990bfcc4b5b6de Mon Sep 17 00:00:00 2001 From: Yuan Hong Hui Date: Wed, 25 Dec 2024 18:42:47 +0800 Subject: [PATCH] feat(example): add pytest for ble example config test --- .../ble/ble_eddystone/sdkconfig.defaults | 4 +- .../ble_hid_device_demo/sdkconfig.defaults | 4 +- .../ble/ble_ibeacon/sdkconfig.defaults | 4 +- .../ble/ble_spp_client/sdkconfig.defaults | 4 +- .../ble/ble_spp_server/sdkconfig.defaults | 4 +- .../pytest_ble_throughput_test.py | 24 +-- .../throughput_client/main/Kconfig.projbuild | 4 +- .../sdkconfig.ci.esp32c2_xtal26m_notify | 1 - .../sdkconfig.ci.esp32c2_xtal26m_write | 2 +- .../throughput_client/sdkconfig.ci.write | 2 +- .../throughput_client/sdkconfig.defaults | 4 +- .../throughput_server/main/Kconfig.projbuild | 4 +- .../sdkconfig.ci.esp32c2_xtal26m_write | 2 +- .../throughput_server/sdkconfig.ci.write | 2 +- .../throughput_server/sdkconfig.defaults | 4 +- .../ble/gatt_client/main/Kconfig.projbuild | 9 +- .../ble/gatt_client/main/gattc_demo.c | 17 ++ .../ble/gatt_client/sdkconfig.ci.cfg_test | 2 + .../gatt_client/sdkconfig.ci.esp32c2_cfg_test | 4 + .../sdkconfig.ci.esp32c2_init_deinit | 8 + .../gatt_client/sdkconfig.ci.esp32c2_xtal26m | 3 +- .../ble/gatt_client/sdkconfig.ci.init_deinit | 6 + .../ble/gatt_client/sdkconfig.ci.name | 2 +- .../ble/gatt_client/sdkconfig.defaults | 4 +- .../main/Kconfig.projbuild | 4 +- .../sdkconfig.ci.esp32c2_xtal26m | 2 +- .../gatt_security_client/sdkconfig.ci.name | 3 +- .../gatt_security_client/sdkconfig.defaults | 4 +- .../main/Kconfig.projbuild | 2 +- .../sdkconfig.ci.esp32c2_xtal26m | 2 +- .../gatt_security_server/sdkconfig.ci.name | 3 +- .../gatt_security_server/sdkconfig.defaults | 4 +- .../ble/gatt_server/main/Kconfig.projbuild | 4 +- .../ble/gatt_server/sdkconfig.ci.cfg_test | 13 ++ .../gatt_server/sdkconfig.ci.esp32c2_cfg_test | 15 ++ .../gatt_server/sdkconfig.ci.esp32c2_xtal26m | 2 +- .../ble/gatt_server/sdkconfig.ci.name | 3 +- .../ble/gatt_server/sdkconfig.defaults | 18 +- .../sdkconfig.defaults | 4 +- .../gattc_multi_connect/sdkconfig.defaults | 4 +- .../bluedroid/ble/pytest_ble_test.py | 161 ++++++++++++++++-- .../main/Kconfig.projbuild | 4 +- .../sdkconfig.ci.cfg_test | 2 + .../sdkconfig.ci.esp32c2_cfg_test | 4 + .../sdkconfig.ci.esp32c2_xtal26m | 2 +- .../ble50_security_client/sdkconfig.ci.name | 2 +- .../main/Kconfig.projbuild | 4 +- .../sdkconfig.ci.cfg_test | 12 ++ .../sdkconfig.ci.esp32c2_cfg_test | 14 ++ .../sdkconfig.ci.esp32c2_xtal26m | 2 +- .../ble50_security_server/sdkconfig.ci.name | 2 +- .../periodic_adv/main/Kconfig.projbuild | 4 +- .../periodic_adv/sdkconfig.ci.esp32c2_xtal26m | 2 +- .../ble_50/periodic_adv/sdkconfig.ci.name | 2 +- .../periodic_sync/main/Kconfig.projbuild | 4 +- .../sdkconfig.ci.esp32c2_xtal26m | 2 +- .../ble_50/periodic_sync/sdkconfig.ci.name | 2 +- .../bluedroid/ble_50/pytest_ble50_test.py | 98 ++++++++++- .../coex/gattc_gatts_coex/sdkconfig.defaults | 4 +- 59 files changed, 434 insertions(+), 104 deletions(-) create mode 100644 examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test create mode 100644 examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test create mode 100644 examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit create mode 100644 examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit create mode 100644 examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.cfg_test create mode 100644 examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_cfg_test create mode 100644 examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test create mode 100644 examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test create mode 100644 examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.cfg_test create mode 100644 examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_cfg_test diff --git a/examples/bluetooth/bluedroid/ble/ble_eddystone/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_eddystone/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/ble_eddystone/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_eddystone/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_hid_device_demo/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/ble_ibeacon/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_ibeacon/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/ble_ibeacon/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_ibeacon/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/ble_spp_client/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_spp_client/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/ble_spp_client/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_spp_client/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/ble_spp_server/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_spp_server/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/ble_spp_server/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_spp_server/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/pytest_ble_throughput_test.py b/examples/bluetooth/bluedroid/ble/ble_throughput/pytest_ble_throughput_test.py index f7194312ec8..e63a87b87df 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/pytest_ble_throughput_test.py +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/pytest_ble_throughput_test.py @@ -8,7 +8,7 @@ from pytest_embedded_idf.dut import IdfDut -# Case 1: gatt write throughput test +# Case 1: gatt write throughput test(EXAMPLE_CI_ID = 2) @pytest.mark.esp32 @pytest.mark.esp32c3 @pytest.mark.esp32c6 @@ -18,10 +18,10 @@ @pytest.mark.esp32s3 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', - 'write', 'y'), + 'write'), ], indirect=True, ) @@ -48,15 +48,15 @@ def test_gatt_write_throughput(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> Non assert throughput > 50000 or throughput < 95000 -# Case 2: gatt write throughput test for ESP32C2 26mhz xtal +# Case 2: gatt write throughput test for ESP32C2 26mhz xtal(EXAMPLE_CI_ID = 2) @pytest.mark.esp32c2 @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', - 'esp32c2_xtal26m_write', 'y'), + 'esp32c2_xtal26m_write'), ], indirect=True, ) @@ -83,7 +83,7 @@ def test_c2_26mhz_xtal_write_throughput(app_path: str, dut: Tuple[IdfDut, IdfDut assert throughput > 50000 or throughput < 95000 -# Case 3: gatt notify throughput test +# Case 3: gatt notify throughput test(EXAMPLE_CI_ID = 1) @pytest.mark.esp32 @pytest.mark.esp32c3 @pytest.mark.esp32c6 @@ -93,10 +93,10 @@ def test_c2_26mhz_xtal_write_throughput(app_path: str, dut: Tuple[IdfDut, IdfDut @pytest.mark.esp32s3 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', - 'notify', 'y'), + 'notify'), ], indirect=True, ) @@ -125,15 +125,15 @@ def test_gatt_notify_throughput(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> No assert throughput > 50000 or throughput < 95000 -# Case 4: gatt notify throughput test for ESP32C2 26mhz xtal +# Case 4: gatt notify throughput test for ESP32C2 26mhz xtal(EXAMPLE_CI_ID = 1) @pytest.mark.esp32c2 @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', - 'esp32c2_xtal26m_notify', 'y'), + 'esp32c2_xtal26m_notify'), ], indirect=True, ) diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/Kconfig.projbuild index e460d652e7e..584f6d95577 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/main/Kconfig.projbuild @@ -13,8 +13,8 @@ menu "Example 'GATT CLIENT THROUGHPUT' Config" it can't test both write or notify at the same time at this demo config EXAMPLE_CI_ID - int - default 60 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_notify b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_notify index 0448a5d2a50..fdb015b2b97 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_notify +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_notify @@ -1,4 +1,3 @@ - CONFIG_EXAMPLE_CI_ID=1 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_write b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_write index 5874287ec33..ebbf1d6ee51 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_write +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.esp32c2_xtal26m_write @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=2 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.write b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.write index a47edbf1826..a6c588b96f3 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.write +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.ci.write @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=2 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=y CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=n diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.defaults index b0a386fc2ca..155f79ab29c 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_client/sdkconfig.defaults @@ -2,9 +2,9 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=y CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=n diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/Kconfig.projbuild index adc7fa53d2d..48cf48bc54f 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/main/Kconfig.projbuild @@ -24,8 +24,8 @@ menu "Example 'GATT SERVER THROUGHPUT' Config" it can't test both write or notify at the same time at this demo config EXAMPLE_CI_ID - int - default 60 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.esp32c2_xtal26m_write b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.esp32c2_xtal26m_write index 5874287ec33..ebbf1d6ee51 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.esp32c2_xtal26m_write +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.esp32c2_xtal26m_write @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=2 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.write b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.write index a47edbf1826..a6c588b96f3 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.write +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.ci.write @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=2 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=y CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=n diff --git a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.defaults index 1decbd1f1d6..a83167746f3 100644 --- a/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/ble_throughput/throughput_server/sdkconfig.defaults @@ -4,7 +4,7 @@ CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=y CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=n CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble/gatt_client/main/Kconfig.projbuild index f78a5e5a268..57e5fa6e72f 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble/gatt_client/main/Kconfig.projbuild @@ -5,8 +5,8 @@ menu "Example Configuration" default n config EXAMPLE_CI_ID - int - default 70 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. @@ -16,4 +16,9 @@ menu "Example Configuration" help This config the pipeline id for CI test. Only for internal used. + config EXAMPLE_INIT_DEINIT_LOOP + bool "Perform init deinit of bluedroid host in a loop" + default n + help + This config perform host init deinit loop for CI test. Only for internal used endmenu diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c index 302f9bf66d4..274d3df2f81 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c @@ -37,6 +37,9 @@ #define PROFILE_NUM 1 #define PROFILE_A_APP_ID 0 #define INVALID_HANDLE 0 +#if CONFIG_EXAMPLE_INIT_DEINIT_LOOP +#define EXAMPLE_TEST_COUNT 50 +#endif static char remote_device_name[ESP_BLE_ADV_NAME_LEN_MAX] = "ESP_GATTS_DEMO"; static bool connect = false; @@ -493,6 +496,20 @@ void app_main(void) ESP_LOGE(GATTC_TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret)); return; } + +#if CONFIG_EXAMPLE_INIT_DEINIT_LOOP + for(int i = 0; i < EXAMPLE_TEST_COUNT; i++) { + ESP_ERROR_CHECK( esp_bluedroid_disable() ); + ESP_ERROR_CHECK( esp_bluedroid_deinit() ); + vTaskDelay(10/portTICK_PERIOD_MS); + ESP_LOGI(GATTC_TAG, "Free memory: %" PRIu32 " bytes", esp_get_free_heap_size()); + ESP_ERROR_CHECK( esp_bluedroid_init() ); + ESP_ERROR_CHECK( esp_bluedroid_enable() ); + vTaskDelay(10/portTICK_PERIOD_MS); + } + return; +#endif + // Note: Avoid performing time-consuming operations within callback functions. // Register the callback function to the gap module ret = esp_ble_gap_register_callback(esp_gap_cb); diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test new file mode 100644 index 00000000000..12a643ff749 --- /dev/null +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test @@ -0,0 +1,2 @@ +CONFIG_EXAMPLE_CI_ID=4 +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test new file mode 100644 index 00000000000..ec098198eca --- /dev/null +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test @@ -0,0 +1,4 @@ +CONFIG_EXAMPLE_CI_ID=4 +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit new file mode 100644 index 00000000000..b160178a7f9 --- /dev/null +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit @@ -0,0 +1,8 @@ +# CONFIG_BT_GATTS_ENABLE is not set +# CONFIG_BT_GATTC_ENABLE is not set +# CONFIG_BT_BLE_SMP_ENABLE is not set +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y +CONFIG_EXAMPLE_INIT_DEINIT_LOOP=y diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m index e77ed1d26cd..e21eac3c221 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m @@ -1,5 +1,4 @@ - -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=3 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit new file mode 100644 index 00000000000..6131c64c07f --- /dev/null +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit @@ -0,0 +1,6 @@ +# CONFIG_BT_GATTS_ENABLE is not set +# CONFIG_BT_GATTC_ENABLE is not set +# CONFIG_BT_BLE_SMP_ENABLE is not set +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set +CONFIG_EXAMPLE_INIT_DEINIT_LOOP=y diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name index 6d9fd6470c4..6d167f440e4 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name @@ -1,2 +1,2 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=3 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble/gatt_security_client/main/Kconfig.projbuild index 2f892b4387c..758ebf6bb22 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/main/Kconfig.projbuild @@ -1,8 +1,8 @@ menu "Example 'GATT SECURITY CLIENT' Config" config EXAMPLE_CI_ID - int - default 80 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..18b93a65583 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=5 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name index d8e23a54e91..be962fcb8db 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name @@ -1,3 +1,2 @@ - -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=5 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_server/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble/gatt_security_server/main/Kconfig.projbuild index 0b0900d7c23..2703560f8f6 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_server/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble/gatt_security_server/main/Kconfig.projbuild @@ -1,7 +1,7 @@ menu "Example 'GATT SECURITY SERVER' Config" config EXAMPLE_CI_ID - int + int "example id for CI test" default 80 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..18b93a65583 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=5 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.name index d8e23a54e91..be962fcb8db 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.ci.name @@ -1,3 +1,2 @@ - -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=5 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/gatt_security_server/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble/gatt_server/main/Kconfig.projbuild index b59c78471d3..3baf34edbd5 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble/gatt_server/main/Kconfig.projbuild @@ -12,8 +12,8 @@ menu "Example 'GATT SERVER' Config" overhead at runtime. config EXAMPLE_CI_ID - int - default 70 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.cfg_test b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.cfg_test new file mode 100644 index 00000000000..110a8da8cc9 --- /dev/null +++ b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.cfg_test @@ -0,0 +1,13 @@ +CONFIG_EXAMPLE_CI_ID=4 +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_BLUEDROID_MEM_DEBUG=y +CONFIG_BT_GATTS_PPCP_CHAR_GAP=y +CONFIG_BT_BLE_BLUFI_ENABLE=y +CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED=y +CONFIG_BT_GATTC_CACHE_NVS_FLASH=y +CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE=y +CONFIG_BT_BLE_SMP_ID_RESET_ENABLE=y +CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK=y +CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN=y +CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL=y +CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_cfg_test b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_cfg_test new file mode 100644 index 00000000000..494c882dcbc --- /dev/null +++ b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_cfg_test @@ -0,0 +1,15 @@ +CONFIG_EXAMPLE_CI_ID=4 +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_BLUEDROID_MEM_DEBUG=y +CONFIG_BT_GATTS_PPCP_CHAR_GAP=y +CONFIG_BT_BLE_BLUFI_ENABLE=y +CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED=y +CONFIG_BT_GATTC_CACHE_NVS_FLASH=y +CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE=y +CONFIG_BT_BLE_SMP_ID_RESET_ENABLE=y +CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK=y +CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN=y +CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL=y +CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..e21eac3c221 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=3 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.name index d8e23a54e91..6d167f440e4 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.ci.name @@ -1,3 +1,2 @@ - -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=3 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.defaults index 1bf8906ea7d..0329933a8f8 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/gatt_server/sdkconfig.defaults @@ -2,7 +2,21 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set + +CONFIG_EXAMPLE_CI_ID=4 +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_BLUEDROID_MEM_DEBUG=y +CONFIG_BT_GATTS_PPCP_CHAR_GAP=y +CONFIG_BT_BLE_BLUFI_ENABLE=y +CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED=y +CONFIG_BT_GATTC_CACHE_NVS_FLASH=y +CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE=y +CONFIG_BT_BLE_SMP_ID_RESET_ENABLE=y +CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK=y +CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN=y +CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL=y +CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_server_service_table/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/gatt_server_service_table/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/gattc_multi_connect/sdkconfig.defaults b/examples/bluetooth/bluedroid/ble/gattc_multi_connect/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/ble/gattc_multi_connect/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/ble/gattc_multi_connect/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set diff --git a/examples/bluetooth/bluedroid/ble/pytest_ble_test.py b/examples/bluetooth/bluedroid/ble/pytest_ble_test.py index 9de955b3001..ef454759d34 100644 --- a/examples/bluetooth/bluedroid/ble/pytest_ble_test.py +++ b/examples/bluetooth/bluedroid/ble/pytest_ble_test.py @@ -5,10 +5,12 @@ import pexpect import pytest +from pytest_embedded import Dut from pytest_embedded_idf.dut import IdfDut # Case 1: gatt client and gatt server test +# EXAMPLE_CI_ID=3 @pytest.mark.esp32 @pytest.mark.esp32c3 @pytest.mark.esp32c6 @@ -18,10 +20,10 @@ @pytest.mark.esp32c61 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}', - 'name', 'y'), + 'name'), ], indirect=True, ) @@ -53,14 +55,15 @@ def test_gatt_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: # Case 2: gatt client and gatt server test for ESP32C2 26mhz xtal +# EXAMPLE_CI_ID=3 @pytest.mark.esp32c2 @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}', - 'esp32c2_xtal26m', 'y'), + 'esp32c2_xtal26m'), ], indirect=True, ) @@ -92,6 +95,7 @@ def test_c2_26mhz_xtal_gatt_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> N # Case 3: gatt security server and gatt security client test +# EXAMPLE_CI_ID=5 @pytest.mark.esp32 @pytest.mark.esp32c3 @pytest.mark.esp32c6 @@ -101,10 +105,10 @@ def test_c2_26mhz_xtal_gatt_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> N @pytest.mark.esp32c61 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "gatt_security_server")}|{os.path.join(os.path.dirname(__file__), "gatt_security_client")}', - 'name', 'y'), + 'name'), ], indirect=True, ) @@ -150,17 +154,20 @@ def test_gatt_security_func(app_path: str, dut: Tuple[IdfDut, IdfDut], target: T assert 'rst:' not in str(gatt_security_server_output) and 'boot:' not in str(gatt_security_server_output) assert 'Disconnected' not in str(gatt_security_client_output) assert 'Disconnected' not in str(gatt_security_server_output) + gatt_security_client.serial.erase_flash() + gatt_security_server.serial.erase_flash() # Case 4: gatt security server and gatt security client test for ESP32C2 26mhz xtal +# EXAMPLE_CI_ID=5 @pytest.mark.esp32c2 @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "gatt_security_server")}|{os.path.join(os.path.dirname(__file__), "gatt_security_client")}', - 'esp32c2_xtal26m', 'y'), + 'esp32c2_xtal26m'), ], indirect=True, ) @@ -200,6 +207,8 @@ def test_c2_26mhz_xtal_gatt_security_func(app_path: str, dut: Tuple[IdfDut, IdfD assert 'rst:' not in str(gatt_security_server_output) and 'boot:' not in str(gatt_security_server_output) assert 'Disconnected' not in str(gatt_security_client_output) assert 'Disconnected' not in str(gatt_security_server_output) + gatt_security_client.serial.erase_flash() + gatt_security_server.serial.erase_flash() # Case 5: ble ibeacon test @@ -212,10 +221,10 @@ def test_c2_26mhz_xtal_gatt_security_func(app_path: str, dut: Tuple[IdfDut, IdfD @pytest.mark.esp32c61 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}|{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}', - 'sender|receiver', 'y'), + 'sender|receiver'), ], indirect=True, ) @@ -241,10 +250,10 @@ def test_ble_ibeacon_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}|{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}', - 'esp32c2_xtal26m_sender|esp32c2_xtal26m_receiver', 'y'), + 'esp32c2_xtal26m_sender|esp32c2_xtal26m_receiver'), ], indirect=True, ) @@ -263,3 +272,131 @@ def test_c2_26mhz_ble_ibeacon_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> ibeacon_receiver.expect_exact('Minor: 0xf206 (61958)', timeout=30) ibeacon_receiver.expect_exact('Measured power (RSSI at a 1m distance):', timeout=30) ibeacon_receiver.expect_exact('RSSI of packet: ', timeout=30) + + +# Case 6: gatt client and gatt server config test +# EXAMPLE_CI_ID=4 +@pytest.mark.esp32 +@pytest.mark.esp32c3 +@pytest.mark.esp32c6 +@pytest.mark.esp32c5 +@pytest.mark.esp32h2 +@pytest.mark.esp32s3 +@pytest.mark.esp32c61 +@pytest.mark.wifi_two_dut +@pytest.mark.parametrize( + 'count, app_path, config', [ + (2, + f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}', + 'cfg_test'), + ], + indirect=True, +) +def test_gatt_config_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: + gatt_client = dut[1] + gatt_server = dut[0] + gatt_client_addr = gatt_client.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', timeout=30).group(1).decode('utf8') + gatt_server_addr = gatt_server.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', timeout=30).group(1).decode('utf8') + gatt_client.expect_exact('GATT client register, status 0', timeout=30) + gatt_server.expect_exact('GATT server register, status 0', timeout=30) + gatt_server.expect_exact('Advertising start successfully', timeout=30) + gatt_client.expect_exact('Scanning start successfully', timeout=30) + gatt_client.expect_exact(f'Connected, conn_id 0, remote {gatt_server_addr}', timeout=30) + gatt_server.expect_exact(f'Connected, conn_id 0, remote {gatt_client_addr}', timeout=30) + gatt_client.expect_exact('Connection params update, status 0', timeout=30) + gatt_server.expect_exact('Connection params update, status 0', timeout=30) + gatt_client.expect_exact('Service discover complete', timeout=30) + gatt_client.expect_exact('Service search complete', timeout=30) + gatt_client.expect_exact('MTU exchange, status 0, MTU 500', timeout=30) + gatt_server.expect_exact('MTU exchange, MTU 500', timeout=30) + gatt_server.expect_exact('Notification enable', timeout=30) + gatt_client.expect_exact('Notification received', timeout=30) + gatt_client_output = gatt_client.expect(pexpect.TIMEOUT, timeout=10) + gatt_server_output = gatt_server.expect(pexpect.TIMEOUT, timeout=10) + assert 'rst:' not in str(gatt_client_output) and 'boot:' not in str(gatt_client_output) + assert 'rst:' not in str(gatt_server_output) and 'boot:' not in str(gatt_server_output) + assert 'Disconnected' not in str(gatt_client_output) + assert 'Disconnected' not in str(gatt_server_output) + + +# Case 7: gatt client and gatt server config test for ESP32C2 26mhz xtal +# EXAMPLE_CI_ID=3 +@pytest.mark.esp32c2 +@pytest.mark.wifi_two_dut +@pytest.mark.xtal_26mhz +@pytest.mark.parametrize( + 'count, target, baud, app_path, config', [ + (2, 'esp32c2|esp32c2', '74880', + f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}', + 'esp32c2_cfg_test'), + ], + indirect=True, +) +def test_c2_26mhz_xtal_gatt_config_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: + gatt_client = dut[1] + gatt_server = dut[0] + gatt_client_addr = gatt_client.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})').group(1).decode('utf8') + gatt_server_addr = gatt_server.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})').group(1).decode('utf8') + gatt_client.expect_exact('GATT client register, status 0', timeout=30) + gatt_server.expect_exact('GATT server register, status 0', timeout=30) + gatt_server.expect_exact('Advertising start successfully', timeout=30) + gatt_client.expect_exact('Scanning start success', timeout=30) + gatt_client.expect_exact(f'Connected, conn_id 0, remote {gatt_server_addr}', timeout=30) + gatt_server.expect_exact(f'Connected, conn_id 0, remote {gatt_client_addr}', timeout=30) + gatt_client.expect_exact('Connection params update, status 0', timeout=30) + gatt_server.expect_exact('Connection params update, status 0', timeout=30) + gatt_client.expect_exact('Service discover complete', timeout=30) + gatt_client.expect_exact('Service search complete', timeout=30) + gatt_client.expect_exact('MTU exchange, status 0, MTU 500', timeout=30) + gatt_server.expect_exact('MTU exchange, MTU 500', timeout=30) + gatt_server.expect_exact('Notification enable', timeout=30) + gatt_client.expect_exact('Notification received', timeout=30) + gatt_client_output = gatt_client.expect(pexpect.TIMEOUT, timeout=10) + gatt_server_output = gatt_server.expect(pexpect.TIMEOUT, timeout=10) + assert 'rst:' not in str(gatt_client_output) and 'boot:' not in str(gatt_client_output) + assert 'rst:' not in str(gatt_server_output) and 'boot:' not in str(gatt_server_output) + assert 'Disconnected' not in str(gatt_client_output) + assert 'Disconnected' not in str(gatt_server_output) + + +# Case 8: BLE init deinit loop test +@pytest.mark.esp32c6 +@pytest.mark.esp32h2 +@pytest.mark.esp32c3 +@pytest.mark.esp32s3 +@pytest.mark.esp32c5 +@pytest.mark.esp32c61 +@pytest.mark.esp32 +@pytest.mark.generic +@pytest.mark.parametrize('config, app_path', [('init_deinit', + f'{os.path.join(os.path.dirname(__file__), "gatt_client")}')], indirect=True) +def test_bluedroid_host_init_deinit(dut: Dut) -> None: + all_hp = [] + dut.expect_exact('Bluetooth MAC:') + for _ in range(20): + all_hp.append(int(dut.expect(r'Free memory: (\d+) bytes').group(1).decode('utf8'))) + + # the heapsize after host deinit is same + assert len(list(set(all_hp))) == 1 + + +# # Case 9: BLE init deinit loop test for ESP32C2 26mhz xtal +@pytest.mark.esp32c2 +@pytest.mark.wifi_two_dut +@pytest.mark.xtal_26mhz +@pytest.mark.parametrize( + 'baud, app_path, config', [ + ('74880', + f'{os.path.join(os.path.dirname(__file__), "gatt_client")}', + 'esp32c2_init_deinit'), + ], + indirect=True, +) +def test_c2_26mhz_bluedroid_host_init_deinit(dut: Dut) -> None: + all_hp = [] + dut.expect_exact('Bluetooth MAC:') + for _ in range(20): + all_hp.append(int(dut.expect(r'Free memory: (\d+) bytes').group(1).decode('utf8'))) + + # the heapsize after host deinit is same + assert len(list(set(all_hp))) == 1 diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/Kconfig.projbuild index 4b273645acd..e1d78f31807 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/Kconfig.projbuild @@ -1,8 +1,8 @@ menu "Example 'BLE50 SECURITY GATT CLIENT' Config" config EXAMPLE_CI_ID - int - default 100 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test new file mode 100644 index 00000000000..63791867a24 --- /dev/null +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test @@ -0,0 +1,2 @@ +CONFIG_EXAMPLE_CI_ID=7 +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test new file mode 100644 index 00000000000..a31340300d4 --- /dev/null +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test @@ -0,0 +1,4 @@ +CONFIG_EXAMPLE_CI_ID=7 +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..4f8d8a6bc03 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=6 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name index 6d9fd6470c4..ea659fe46a1 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name @@ -1,2 +1,2 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=6 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/Kconfig.projbuild index e92296de4f0..c3f353d155d 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/main/Kconfig.projbuild @@ -1,8 +1,8 @@ menu "Example 'BLE50 SECURITY GATT SERVER' Config" config EXAMPLE_CI_ID - int - default 100 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.cfg_test b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.cfg_test new file mode 100644 index 00000000000..b4a6757b629 --- /dev/null +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.cfg_test @@ -0,0 +1,12 @@ +CONFIG_EXAMPLE_CI_ID=7 +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_BLUEDROID_MEM_DEBUG=y +CONFIG_BT_GATTS_PPCP_CHAR_GAP=y +CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED=y +CONFIG_BT_GATTC_CACHE_NVS_FLASH=y +CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE=y +CONFIG_BT_BLE_SMP_ID_RESET_ENABLE=y +CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK=y +CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN=y +CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL=y +CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_cfg_test b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_cfg_test new file mode 100644 index 00000000000..c752a69591b --- /dev/null +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_cfg_test @@ -0,0 +1,14 @@ +CONFIG_EXAMPLE_CI_ID=7 +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y +CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_BLUEDROID_MEM_DEBUG=y +CONFIG_BT_GATTS_PPCP_CHAR_GAP=y +CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED=y +CONFIG_BT_GATTC_CACHE_NVS_FLASH=y +CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE=y +CONFIG_BT_BLE_SMP_ID_RESET_ENABLE=y +CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK=y +CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN=y +CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL=y +CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..4f8d8a6bc03 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=6 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.name index 6d9fd6470c4..ea659fe46a1 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_server/sdkconfig.ci.name @@ -1,2 +1,2 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=6 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/Kconfig.projbuild index 9539c9a50ca..1775fb7f5e1 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble_50/periodic_adv/main/Kconfig.projbuild @@ -1,8 +1,8 @@ menu "Example 'PERIODIC ADVERTISING' Config" config EXAMPLE_CI_ID - int - default 110 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..463035ba5a8 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=8 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.name index 6d9fd6470c4..ce398ef858b 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble_50/periodic_adv/sdkconfig.ci.name @@ -1,2 +1,2 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=8 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/Kconfig.projbuild b/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/Kconfig.projbuild index 4e6ff4c02cf..b0deae6b2f0 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/Kconfig.projbuild +++ b/examples/bluetooth/bluedroid/ble_50/periodic_sync/main/Kconfig.projbuild @@ -1,8 +1,8 @@ menu "Example 'PERIODIC SYNCHRONIZATION' Config" config EXAMPLE_CI_ID - int - default 110 + int "example id for CI test" + default 0 help This config the example id for CI test. Only for internal used. diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.esp32c2_xtal26m index 6ab0a7ab9d4..463035ba5a8 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.esp32c2_xtal26m @@ -1,4 +1,4 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=8 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.name index 6d9fd6470c4..ce398ef858b 100644 --- a/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble_50/periodic_sync/sdkconfig.ci.name @@ -1,2 +1,2 @@ -CONFIG_EXAMPLE_CI_ID=1 +CONFIG_EXAMPLE_CI_ID=8 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} diff --git a/examples/bluetooth/bluedroid/ble_50/pytest_ble50_test.py b/examples/bluetooth/bluedroid/ble_50/pytest_ble50_test.py index b5b02e87f80..e6d72ccac94 100644 --- a/examples/bluetooth/bluedroid/ble_50/pytest_ble50_test.py +++ b/examples/bluetooth/bluedroid/ble_50/pytest_ble50_test.py @@ -8,6 +8,7 @@ # Case 1: ble50 security client and ble50 security server test +# EXAMPLE_CI_ID=6 @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32c5 @@ -16,10 +17,10 @@ @pytest.mark.esp32c61 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "ble50_security_server")}|{os.path.join(os.path.dirname(__file__), "ble50_security_client")}', - 'name', 'y'), + 'name'), ], indirect=True, ) @@ -46,14 +47,15 @@ def test_ble50_security_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: # Case 2: ble50 security client and ble50 security server test for ESP32C2 26mhz xtal +# EXAMPLE_CI_ID=6 @pytest.mark.esp32c2 @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "ble50_security_server")}|{os.path.join(os.path.dirname(__file__), "ble50_security_client")}', - 'esp32c2_xtal26m', 'y'), + 'esp32c2_xtal26m'), ], indirect=True, ) @@ -80,6 +82,7 @@ def test_c2_26mhz_xtal_ble50_security_func(app_path: str, dut: Tuple[IdfDut, Idf # Case 3: period_adv and period_sync test +# EXAMPLE_CI_ID=8 @pytest.mark.esp32c3 @pytest.mark.esp32c6 @pytest.mark.esp32c5 @@ -88,10 +91,10 @@ def test_c2_26mhz_xtal_ble50_security_func(app_path: str, dut: Tuple[IdfDut, Idf @pytest.mark.esp32c61 @pytest.mark.wifi_two_dut @pytest.mark.parametrize( - 'count, app_path, config, erase_all', [ + 'count, app_path, config', [ (2, f'{os.path.join(os.path.dirname(__file__), "periodic_adv")}|{os.path.join(os.path.dirname(__file__), "periodic_sync")}', - 'name', 'y'), + 'name'), ], indirect=True, ) @@ -114,14 +117,15 @@ def test_period_adv_sync_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None # Case 4: period_adv and period_sync test for ESP32C2 26mhz xtal +# EXAMPLE_CI_ID=8 @pytest.mark.esp32c2 @pytest.mark.wifi_two_dut @pytest.mark.xtal_26mhz @pytest.mark.parametrize( - 'count, target, baud, app_path, config, erase_all', [ + 'count, target, baud, app_path, config', [ (2, 'esp32c2|esp32c2', '74880', f'{os.path.join(os.path.dirname(__file__), "periodic_adv")}|{os.path.join(os.path.dirname(__file__), "periodic_sync")}', - 'esp32c2_xtal26m', 'y'), + 'esp32c2_xtal26m'), ], indirect=True, ) @@ -141,3 +145,81 @@ def test_c2_26mhz_xtal_period_adv_sync_func(app_path: str, dut: Tuple[IdfDut, Id sync_dut.expect_exact(f'Create sync with the peer device BE', timeout=30) sync_dut.expect_exact('Periodic advertising sync establish, status 0', timeout=30) sync_dut.expect_exact('Periodic adv report, sync handle ', timeout=30) + + +# Case 5: ble50 security client and ble50 security server config test +# EXAMPLE_CI_ID=7 +@pytest.mark.esp32c3 +@pytest.mark.esp32c6 +@pytest.mark.esp32c5 +@pytest.mark.esp32h2 +@pytest.mark.esp32s3 +@pytest.mark.esp32c61 +@pytest.mark.wifi_two_dut +@pytest.mark.parametrize( + 'count, app_path, config', [ + (2, + f'{os.path.join(os.path.dirname(__file__), "ble50_security_server")}|{os.path.join(os.path.dirname(__file__), "ble50_security_client")}', + 'cfg_test'), + ], + indirect=True, +) +def test_ble50_security_config_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: + server = dut[0] + client = dut[1] + client_addr = client.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', timeout=30).group(1).decode('utf8') + server_addr = server.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', timeout=30).group(1).decode('utf8') + + server.expect_exact('Extended advertising params set, status 0', timeout=30) + server.expect_exact('Extended advertising data set, status 0', timeout=30) + server.expect_exact('Extended advertising start, status 0', timeout=30) + client.expect_exact('Extended scanning start successfully', timeout=30) + client.expect_exact(f'Connected, conn_id 0, remote {server_addr}', timeout=30) + server.expect_exact(f'Connected, conn_id 0, remote {client_addr}', timeout=30) + server.expect_exact('Pairing successfully', timeout=30) + client.expect_exact('Pairing successfully', timeout=30) + server.expect_exact('Bonded devices number 1', timeout=30) + server.expect_exact('Characteristic write', timeout=30) + client.expect_exact('Service discover complete', timeout=30) + client.expect_exact('Service search complete', timeout=30) + client.expect_exact('MTU exchange, status 0', timeout=30) + client.expect_exact('Descriptor write successfully', timeout=30) + client.serial.erase_flash() + server.serial.erase_flash() + + +# Case 6: ble50 security client and ble50 security server config test for ESP32C2 26mhz xtal +# EXAMPLE_CI_ID=7 +@pytest.mark.esp32c2 +@pytest.mark.wifi_two_dut +@pytest.mark.xtal_26mhz +@pytest.mark.parametrize( + 'count, target, baud, app_path, config', [ + (2, 'esp32c2|esp32c2', '74880', + f'{os.path.join(os.path.dirname(__file__), "ble50_security_server")}|{os.path.join(os.path.dirname(__file__), "ble50_security_client")}', + 'esp32c2_cfg_test'), + ], + indirect=True, +) +def test_c2_26mhz_xtal_ble50_security_config_func(app_path: str, dut: Tuple[IdfDut, IdfDut]) -> None: + server = dut[0] + client = dut[1] + client_addr = client.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', timeout=30).group(1).decode('utf8') + server_addr = server.expect(r'Bluetooth MAC: (([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2})', timeout=30).group(1).decode('utf8') + + server.expect_exact('Extended advertising params set, status 0', timeout=30) + server.expect_exact('Extended advertising data set, status 0', timeout=30) + server.expect_exact('Extended advertising start, status 0', timeout=30) + client.expect_exact('Extended scanning start successfully', timeout=30) + client.expect_exact(f'Connected, conn_id 0, remote {server_addr}', timeout=30) + server.expect_exact(f'Connected, conn_id 0, remote {client_addr}', timeout=30) + server.expect_exact('Pairing successfully', timeout=30) + client.expect_exact('Pairing successfully', timeout=30) + server.expect_exact('Bonded devices number 1', timeout=30) + server.expect_exact('Characteristic write', timeout=30) + client.expect_exact('Service discover complete', timeout=30) + client.expect_exact('Service search complete', timeout=30) + client.expect_exact('MTU exchange, status 0', timeout=30) + client.expect_exact('Descriptor write successfully', timeout=30) + client.serial.erase_flash() + server.serial.erase_flash() diff --git a/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/sdkconfig.defaults b/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/sdkconfig.defaults index 1bf8906ea7d..ad218785e70 100644 --- a/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/coex/gattc_gatts_coex/sdkconfig.defaults @@ -2,7 +2,7 @@ # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # CONFIG_BT_ENABLED=y -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. -CONFIG_BT_LE_50_FEATURE_SUPPORT=n +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set