Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add tests for KMU and keys provisioning #18456

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

gchwier
Copy link
Contributor

@gchwier gchwier commented Oct 31, 2024

Add two test applications with test scenarios automated with pytest.
Frist: verify_west_ncs_provision - application with hardcoded keys only to check if command west ncs-provission writes proper keys.
Second: hello_for_kmu - hello_world based app with MCUboot, keys are uploaded with west command and application is flashed. Checked if app is booted when using correct keys and not booted with wrong keys.

To test one can use command:
${ZEPHYR_BASE}/scripts/twister --device-testing -p nrf54l15dk/nrf54l15/cpuapp --device-serial /dev/ttyACM1 --west-flash="--erase" -T tests/subsys/kmu -vv --no-clean

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Oct 31, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 5

Inputs:

Sources:

sdk-nrf: PR head: 843da3edd796a38053cb5e53abe5bfa5b0293b5f

more details

sdk-nrf:

PR head: 843da3edd796a38053cb5e53abe5bfa5b0293b5f
merge base: 32c41c59d57a77e919a55932433a5f52e2278df2
target head (main): 70c22253fb6a8b5e02f61c4de165843a875e0a21
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (20)
CODEOWNERS
tests
│  ├── subsys
│  │  ├── kmu
│  │  │  ├── hello_for_kmu
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── prj.conf
│  │  │  │  ├── sb_secondary_key.conf
│  │  │  │  ├── sb_wrong_key.conf
│  │  │  │  ├── src
│  │  │  │  │  │ main.c
│  │  │  │  ├── sysbuild.conf
│  │  │  │  ├── sysbuild
│  │  │  │  │  │ mcuboot.conf
│  │  │  │  │ testcase.yaml
│  │  │  ├── keys
│  │  │  │  ├── root-ed25519-1.pem
│  │  │  │  ├── root-ed25519-2.pem
│  │  │  │  │ root-ed25519-w.pem
│  │  │  ├── pytest
│  │  │  │  ├── common.py
│  │  │  │  ├── conftest.py
│  │  │  │  ├── test_kmu_key_provision.py
│  │  │  │  │ test_kmu_with_mcuboot.py
│  │  │  ├── verify_west_ncs_provision
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── prj.conf
│  │  │  │  ├── src
│  │  │  │  │  │ main.c
│  │  │  │  │ testcase.yaml

Outputs:

Toolchain

Version: b44b7a08c9
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:b44b7a08c9_912848a074

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 40
  • ✅ Integration tests
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi

Note: This message is automatically posted and updated by the CI

@gchwier gchwier force-pushed the grch_test_kmu branch 2 times, most recently from 31496e6 to 8189f9c Compare October 31, 2024 19:07
@gchwier
Copy link
Contributor Author

gchwier commented Nov 2, 2024

failed after rebasing to #18366,
received build error:
west build -p -b nrf54l15dk/nrf54l15/cpuapp tests/subsys/kmu/hello_for_kmu

modules/nrf/subsys/nrf_security/src/libmbedcrypto_base.a(threading_alt.c.obj): in function `k_mutex_lock':
ncs/nrf/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:986: undefined reference to `z_impl_k_mutex_lock'

@Vge0rge
Copy link
Contributor

Vge0rge commented Nov 4, 2024

failed after rebasing to #18366, received build error: west build -p -b nrf54l15dk/nrf54l15/cpuapp tests/subsys/kmu/hello_for_kmu

modules/nrf/subsys/nrf_security/src/libmbedcrypto_base.a(threading_alt.c.obj): in function `k_mutex_lock':
ncs/nrf/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:986: undefined reference to `z_impl_k_mutex_lock'

Hey, can you try to rebase on this and see if it fixes your build issue?
#18487

@gchwier
Copy link
Contributor Author

gchwier commented Nov 4, 2024

Hey, can you try to rebase on this and see if it fixes your build issue? #18487

works with that change, thank you!

Add two test applications with test scenarios automated with pytest.
Keys are provisioned with the `west ncs-provision` command.
The tests verify if the applications boot and if the keys are correct.

Signed-off-by: Grzegorz Chwierut <[email protected]>
@gchwier gchwier added this to the 2.8.0 milestone Nov 4, 2024
@gchwier gchwier added the backport v2.8-branch auto-create a PR with same commits to v2.8-branch label Nov 4, 2024
@rlubos rlubos merged commit d3fc0cc into nrfconnect:main Nov 4, 2024
14 checks passed
@gchwier gchwier deleted the grch_test_kmu branch November 4, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport v2.8-branch auto-create a PR with same commits to v2.8-branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants