pytest: Expect "Calling app_main()" to indicate start of application

This commit updates variousf pytest scripts to expect
"main_task: Calling app_main()" instead of "cpu_start: Starting scheduler" as
indicator of the start of an application.
This commit is contained in:
Darian Leung
2022-12-09 16:06:44 +08:00
parent bc56ae4a63
commit cdbd8ebeaa
5 changed files with 20 additions and 16 deletions

View File

@@ -199,6 +199,10 @@ static void main_task(void* args)
ESP_ERROR_CHECK(esp_task_wdt_init(&twdt_config)); ESP_ERROR_CHECK(esp_task_wdt_init(&twdt_config));
#endif // CONFIG_ESP_TASK_WDT #endif // CONFIG_ESP_TASK_WDT
/*
Note: Be careful when changing the "Calling app_main()" log below as multiple pytest scripts expect this log as a
start-of-application marker.
*/
ESP_LOGI(MAIN_TAG, "Calling app_main()"); ESP_LOGI(MAIN_TAG, "Calling app_main()");
extern void app_main(void); extern void app_main(void);
app_main(); app_main();

View File

@@ -16,7 +16,7 @@ def test_plugins(dut: Dut) -> None:
Successfully registered plugin 'Nihao' Successfully registered plugin 'Nihao'
Hello plugin performing self-registration... Hello plugin performing self-registration...
Successfully registered plugin 'Hello' Successfully registered plugin 'Hello'
cpu_start: Starting scheduler main_task: Calling app_main()
List of plugins: List of plugins:
- Plugin 'Hello' - Plugin 'Hello'
- Plugin 'Nihao' - Plugin 'Nihao'

View File

@@ -284,8 +284,8 @@ def test_examples_efuse_with_virt_secure_boot_v1(dut: Dut) -> None:
dut.expect('Disable ROM BASIC interpreter fallback...') dut.expect('Disable ROM BASIC interpreter fallback...')
dut.expect('secure_boot_v1: secure boot is now enabled for bootloader image') dut.expect('secure_boot_v1: secure boot is now enabled for bootloader image')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -312,8 +312,8 @@ def test_examples_efuse_with_virt_secure_boot_v1_pre_loaded(dut: Dut) -> None:
dut.serial.flash() dut.serial.flash()
dut.expect('Loading virtual efuse blocks from real efuses') dut.expect('Loading virtual efuse blocks from real efuses')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -339,8 +339,8 @@ def test_examples_efuse_with_virt_secure_boot_v1_pre_loaded(dut: Dut) -> None:
dut.expect('Disable ROM BASIC interpreter fallback...') dut.expect('Disable ROM BASIC interpreter fallback...')
dut.expect('secure_boot_v1: secure boot is now enabled for bootloader image') dut.expect('secure_boot_v1: secure boot is now enabled for bootloader image')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -397,8 +397,8 @@ def test_examples_efuse_with_virt_secure_boot_v2(dut: Dut) -> None:
dut.expect('Prevent read disabling of additional efuses...') dut.expect('Prevent read disabling of additional efuses...')
dut.expect('secure_boot_v2: Secure boot permanently enabled') dut.expect('secure_boot_v2: Secure boot permanently enabled')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -453,8 +453,8 @@ def test_examples_efuse_with_virt_secure_boot_v2(dut: Dut) -> None:
dut.expect('Prevent read disabling of additional efuses...') dut.expect('Prevent read disabling of additional efuses...')
dut.expect('secure_boot_v2: Secure boot permanently enabled') dut.expect('secure_boot_v2: Secure boot permanently enabled')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -481,8 +481,8 @@ def test_examples_efuse_with_virt_secure_boot_v2_pre_loaded(dut: Dut) -> None:
print(' - Start app (flash partition_table and app)') print(' - Start app (flash partition_table and app)')
dut.serial.flash() dut.serial.flash()
dut.expect('Loading virtual efuse blocks from real efuses') dut.expect('Loading virtual efuse blocks from real efuses')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -517,8 +517,8 @@ def test_examples_efuse_with_virt_secure_boot_v2_pre_loaded(dut: Dut) -> None:
dut.expect('Prevent read disabling of additional efuses...') dut.expect('Prevent read disabling of additional efuses...')
dut.expect('secure_boot_v2: Secure boot permanently enabled') dut.expect('secure_boot_v2: Secure boot permanently enabled')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -580,8 +580,8 @@ def test_examples_efuse_with_virt_secure_boot_v2_esp32xx(dut: Dut) -> None:
dut.expect('Disable hardware & software JTAG...') dut.expect('Disable hardware & software JTAG...')
dut.expect('secure_boot_v2: Secure boot permanently enabled') dut.expect('secure_boot_v2: Secure boot permanently enabled')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -628,8 +628,8 @@ def test_example_efuse_with_virt_secure_boot_v2_esp32xx_pre_loaded(dut: Dut) ->
dut.serial.bootloader_flash() dut.serial.bootloader_flash()
dut.serial.flash() dut.serial.flash()
dut.expect('Loading virtual efuse blocks from real efuses') dut.expect('Loading virtual efuse blocks from real efuses')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -672,8 +672,8 @@ def test_example_efuse_with_virt_secure_boot_v2_esp32xx_pre_loaded(dut: Dut) ->
dut.expect('Disable hardware & software JTAG...') dut.expect('Disable hardware & software JTAG...')
dut.expect('secure_boot_v2: Secure boot permanently enabled', timeout=20) dut.expect('secure_boot_v2: Secure boot permanently enabled', timeout=20)
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -768,9 +768,9 @@ def test_examples_efuse_with_virt_sb_v1_and_fe(dut: Dut) -> None:
dut.expect('Checking secure boot...') dut.expect('Checking secure boot...')
dut.expect('secure_boot_v1: bootloader secure boot is already enabled, continuing..') dut.expect('secure_boot_v1: bootloader secure boot is already enabled, continuing..')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect_exact('flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)') dut.expect_exact('flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -847,9 +847,9 @@ def test_examples_efuse_with_virt_sb_v2_and_fe(dut: Dut) -> None:
dut.expect('secure_boot_v2: enabling secure boot v2...') dut.expect('secure_boot_v2: enabling secure boot v2...')
dut.expect('secure_boot_v2: secure boot v2 is already enabled, continuing..') dut.expect('secure_boot_v2: secure boot v2 is already enabled, continuing..')
dut.expect_exact('flash_encrypt: flash encryption is enabled (3 plaintext flashes left)') dut.expect_exact('flash_encrypt: flash encryption is enabled (3 plaintext flashes left)')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect_exact('flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)') dut.expect_exact('flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')
@@ -934,9 +934,9 @@ def test_examples_efuse_with_virt_sb_v2_and_fe_esp32xx(dut: Dut) -> None:
dut.expect('secure_boot_v2: enabling secure boot v2...') dut.expect('secure_boot_v2: enabling secure boot v2...')
dut.expect('secure_boot_v2: secure boot v2 is already enabled, continuing..') dut.expect('secure_boot_v2: secure boot v2 is already enabled, continuing..')
dut.expect_exact('flash_encrypt: flash encryption is enabled (1 plaintext flashes left)') dut.expect_exact('flash_encrypt: flash encryption is enabled (1 plaintext flashes left)')
dut.expect('cpu_start: Pro cpu up')
dut.expect('Loading virtual efuse blocks from flash') dut.expect('Loading virtual efuse blocks from flash')
dut.expect_exact('flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)') dut.expect_exact('flash_encrypt: Flash encryption mode is DEVELOPMENT (not secure)')
dut.expect('main_task: Calling app_main()')
dut.expect('Start eFuse example') dut.expect('Start eFuse example')
dut.expect('example: Done') dut.expect('example: Done')

View File

@@ -17,7 +17,7 @@ from pytest_embedded import Dut
@pytest.mark.generic @pytest.mark.generic
def test_eventfd(dut: Dut) -> None: def test_eventfd(dut: Dut) -> None:
dut.expect_exact('cpu_start: Starting scheduler') dut.expect_exact('main_task: Calling app_main()')
exp_list_5seconds = [ exp_list_5seconds = [
'eventfd_example: Select timeouted for 1 times', 'eventfd_example: Select timeouted for 1 times',

View File

@@ -25,7 +25,7 @@ def get_uart_msgs(i: int) -> List[str]:
@pytest.mark.generic @pytest.mark.generic
def test_examples_select(dut: Dut) -> None: def test_examples_select(dut: Dut) -> None:
dut.expect_exact('cpu_start: Starting scheduler', timeout=30) dut.expect_exact('main_task: Calling app_main()', timeout=30)
exp_list = [] exp_list = []
for i in range(1, 10): for i in range(1, 10):