feat(example): add pytest for ble example config test

This commit is contained in:
Yuan Hong Hui
2024-12-25 18:42:47 +08:00
committed by Island
parent bba3063b52
commit a4ff6ba643
59 changed files with 434 additions and 104 deletions

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -8,7 +8,7 @@ import pytest
from pytest_embedded_idf.dut import IdfDut 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.esp32
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
@@ -18,10 +18,10 @@ from pytest_embedded_idf.dut import IdfDut
@pytest.mark.esp32s3 @pytest.mark.esp32s3
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}',
'write', 'y'), 'write'),
], ],
indirect=True, 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 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.esp32c2
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (2, 'esp32c2|esp32c2', '74880',
f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', 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, 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 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.esp32
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @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.esp32s3
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}',
'notify', 'y'), 'notify'),
], ],
indirect=True, 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 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.esp32c2
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (2, 'esp32c2|esp32c2', '74880',
f'{os.path.join(os.path.dirname(__file__), "throughput_server")}|{os.path.join(os.path.dirname(__file__), "throughput_client")}', 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, indirect=True,
) )

View File

@@ -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 it can't test both write or notify at the same time at this demo
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 60 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -1,4 +1,3 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=1
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=2
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=2
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}
CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=y CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=y
CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=n CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=n

View File

@@ -2,9 +2,9 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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_GATTS_NOTIFY_THROUGHPUT=y
CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=n CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=n

View File

@@ -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 it can't test both write or notify at the same time at this demo
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 60 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=2
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=2
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}
CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=y CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=y
CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=n CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=n

View File

@@ -4,7 +4,7 @@
CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=y CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=y
CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=n CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT=n
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -5,8 +5,8 @@ menu "Example Configuration"
default n default n
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 70 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.
@@ -16,4 +16,9 @@ menu "Example Configuration"
help help
This config the pipeline id for CI test. Only for internal used. 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 endmenu

View File

@@ -37,6 +37,9 @@
#define PROFILE_NUM 1 #define PROFILE_NUM 1
#define PROFILE_A_APP_ID 0 #define PROFILE_A_APP_ID 0
#define INVALID_HANDLE 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 char remote_device_name[ESP_BLE_ADV_NAME_LEN_MAX] = "ESP_GATTS_DEMO";
static bool connect = false; 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)); ESP_LOGE(GATTC_TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret));
return; 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. // Note: Avoid performing time-consuming operations within callback functions.
// Register the callback function to the gap module // Register the callback function to the gap module
ret = esp_ble_gap_register_callback(esp_gap_cb); ret = esp_ble_gap_register_callback(esp_gap_cb);

View File

@@ -0,0 +1,2 @@
CONFIG_EXAMPLE_CI_ID=4
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -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}

View File

@@ -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

View File

@@ -1,5 +1,4 @@
CONFIG_EXAMPLE_CI_ID=3
CONFIG_EXAMPLE_CI_ID=1
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -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

View File

@@ -1,2 +1,2 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=3
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -1,8 +1,8 @@
menu "Example 'GATT SECURITY CLIENT' Config" menu "Example 'GATT SECURITY CLIENT' Config"
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 80 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=5
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,3 +1,2 @@
CONFIG_EXAMPLE_CI_ID=5
CONFIG_EXAMPLE_CI_ID=1
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -1,7 +1,7 @@
menu "Example 'GATT SECURITY SERVER' Config" menu "Example 'GATT SECURITY SERVER' Config"
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 80 default 80
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=5
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,3 +1,2 @@
CONFIG_EXAMPLE_CI_ID=5
CONFIG_EXAMPLE_CI_ID=1
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -12,8 +12,8 @@ menu "Example 'GATT SERVER' Config"
overhead at runtime. overhead at runtime.
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 70 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=3
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,3 +1,2 @@
CONFIG_EXAMPLE_CI_ID=3
CONFIG_EXAMPLE_CI_ID=1
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -2,7 +2,21 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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

View File

@@ -5,10 +5,12 @@ from typing import Tuple
import pexpect import pexpect
import pytest import pytest
from pytest_embedded import Dut
from pytest_embedded_idf.dut import IdfDut from pytest_embedded_idf.dut import IdfDut
# Case 1: gatt client and gatt server test # Case 1: gatt client and gatt server test
# EXAMPLE_CI_ID=3
@pytest.mark.esp32 @pytest.mark.esp32
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
@@ -18,10 +20,10 @@ from pytest_embedded_idf.dut import IdfDut
@pytest.mark.esp32c61 @pytest.mark.esp32c61
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}', f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}',
'name', 'y'), 'name'),
], ],
indirect=True, 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 # Case 2: gatt client and gatt server test for ESP32C2 26mhz xtal
# EXAMPLE_CI_ID=3
@pytest.mark.esp32c2 @pytest.mark.esp32c2
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (2, 'esp32c2|esp32c2', '74880',
f'{os.path.join(os.path.dirname(__file__), "gatt_server")}|{os.path.join(os.path.dirname(__file__), "gatt_client")}', 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, 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 # Case 3: gatt security server and gatt security client test
# EXAMPLE_CI_ID=5
@pytest.mark.esp32 @pytest.mark.esp32
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @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.esp32c61
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "gatt_security_server")}|{os.path.join(os.path.dirname(__file__), "gatt_security_client")}', 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, 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 '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_client_output)
assert 'Disconnected' not in str(gatt_security_server_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 # Case 4: gatt security server and gatt security client test for ESP32C2 26mhz xtal
# EXAMPLE_CI_ID=5
@pytest.mark.esp32c2 @pytest.mark.esp32c2
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (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")}', 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, 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 '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_client_output)
assert 'Disconnected' not in str(gatt_security_server_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 # 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.esp32c61
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}|{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}', 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, 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.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (2, 'esp32c2|esp32c2', '74880',
f'{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}|{os.path.join(os.path.dirname(__file__), "ble_ibeacon")}', 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, 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('Minor: 0xf206 (61958)', timeout=30)
ibeacon_receiver.expect_exact('Measured power (RSSI at a 1m distance):', timeout=30) ibeacon_receiver.expect_exact('Measured power (RSSI at a 1m distance):', timeout=30)
ibeacon_receiver.expect_exact('RSSI of packet: ', 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

View File

@@ -1,8 +1,8 @@
menu "Example 'BLE50 SECURITY GATT CLIENT' Config" menu "Example 'BLE50 SECURITY GATT CLIENT' Config"
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 100 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -0,0 +1,2 @@
CONFIG_EXAMPLE_CI_ID=7
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -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}

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=6
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,2 +1,2 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=6
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,8 +1,8 @@
menu "Example 'BLE50 SECURITY GATT SERVER' Config" menu "Example 'BLE50 SECURITY GATT SERVER' Config"
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 100 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=6
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,2 +1,2 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=6
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,8 +1,8 @@
menu "Example 'PERIODIC ADVERTISING' Config" menu "Example 'PERIODIC ADVERTISING' Config"
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 110 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=8
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,2 +1,2 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=8
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,8 +1,8 @@
menu "Example 'PERIODIC SYNCHRONIZATION' Config" menu "Example 'PERIODIC SYNCHRONIZATION' Config"
config EXAMPLE_CI_ID config EXAMPLE_CI_ID
int int "example id for CI test"
default 110 default 0
help help
This config the example id for CI test. Only for internal used. This config the example id for CI test. Only for internal used.

View File

@@ -1,4 +1,4 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=8
CONFIG_IDF_TARGET="esp32c2" CONFIG_IDF_TARGET="esp32c2"
CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ_26=y
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -1,2 +1,2 @@
CONFIG_EXAMPLE_CI_ID=1 CONFIG_EXAMPLE_CI_ID=8
CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID}

View File

@@ -8,6 +8,7 @@ from pytest_embedded_idf.dut import IdfDut
# Case 1: ble50 security client and ble50 security server test # Case 1: ble50 security client and ble50 security server test
# EXAMPLE_CI_ID=6
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
@pytest.mark.esp32c5 @pytest.mark.esp32c5
@@ -16,10 +17,10 @@ from pytest_embedded_idf.dut import IdfDut
@pytest.mark.esp32c61 @pytest.mark.esp32c61
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "ble50_security_server")}|{os.path.join(os.path.dirname(__file__), "ble50_security_client")}', 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, 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 # Case 2: ble50 security client and ble50 security server test for ESP32C2 26mhz xtal
# EXAMPLE_CI_ID=6
@pytest.mark.esp32c2 @pytest.mark.esp32c2
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (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")}', 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, 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 # Case 3: period_adv and period_sync test
# EXAMPLE_CI_ID=8
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.esp32c6 @pytest.mark.esp32c6
@pytest.mark.esp32c5 @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.esp32c61
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, app_path, config, erase_all', [ 'count, app_path, config', [
(2, (2,
f'{os.path.join(os.path.dirname(__file__), "periodic_adv")}|{os.path.join(os.path.dirname(__file__), "periodic_sync")}', f'{os.path.join(os.path.dirname(__file__), "periodic_adv")}|{os.path.join(os.path.dirname(__file__), "periodic_sync")}',
'name', 'y'), 'name'),
], ],
indirect=True, 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 # Case 4: period_adv and period_sync test for ESP32C2 26mhz xtal
# EXAMPLE_CI_ID=8
@pytest.mark.esp32c2 @pytest.mark.esp32c2
@pytest.mark.wifi_two_dut @pytest.mark.wifi_two_dut
@pytest.mark.xtal_26mhz @pytest.mark.xtal_26mhz
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, target, baud, app_path, config, erase_all', [ 'count, target, baud, app_path, config', [
(2, 'esp32c2|esp32c2', '74880', (2, 'esp32c2|esp32c2', '74880',
f'{os.path.join(os.path.dirname(__file__), "periodic_adv")}|{os.path.join(os.path.dirname(__file__), "periodic_sync")}', 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, 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(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 advertising sync establish, status 0', timeout=30)
sync_dut.expect_exact('Periodic adv report, sync handle ', 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()

View File

@@ -2,7 +2,7 @@
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration # Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
# #
CONFIG_BT_ENABLED=y 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_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 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