Skip to content

Commit 17c22d6

Browse files
Qinghao ShiQinghao Shi
authored andcommitted
Add log compare test for devicekey example
1 parent 265f6d1 commit 17c22d6

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Testing examples
2+
3+
Examples are tested using tool [htrun](https://github.com/ARMmbed/mbed-os-tools/tree/master/packages/mbed-host-tests) and templated print log.
4+
5+
To run the test, use following command after you build the example:
6+
```
7+
mbedhtrun -d D: -p COM4 -m K64F -f .\BUILD\K64F\GCC_ARM\devicekey.bin --compare-log tests\devicekey.log
8+
```
9+
10+
11+
More details about `htrun` are [here](https://github.com/ARMmbed/htrun#testing-mbed-os-examples).
12+

tests/devicekey.log

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- Mbed OS DeviceKey example ---
2+
3+
--- Using the following salt for key derivation: SALT1 ----- SALT1 ------ SALT1 ---
4+
--- First call to derive key, requesting derived key of 16 byte ---
5+
--- Derived key1 is:
6+
[0-9A-F]+
7+
8+
--- Second call to derive key with the same salt. ---
9+
--- Derived key2 should be equal to key1 from the first call. key2 is:
10+
[0-9A-F]+
11+
--- Keys match ---
12+
13+
--- Using the following salt for key derivation SALT2 ----- SALT2 ------ SALT2 ---
14+
--- Third call to derive key with the different salt should result with a new derived key1:
15+
[0-9A-F]+
16+
--- Keys not match ---
17+
18+
--- 32 byte key derivation example. ---
19+
--- 32 byte derived key is:
20+
[0-9A-F]+
21+
22+
--- Mbed OS DeviceKey example done. ---

0 commit comments

Comments
 (0)