|
1 | | -Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
2 | | -SPDX-License-Identifier: BSD-3-Clause-Clear |
3 | | - |
4 | | -# Qualcomm Crypto (qcom_crypto) Functionality Test Script |
5 | | -# Overview |
6 | | - |
7 | | -The qcom_crypto test script validates the basic functionality of cryptographic operations using the kcapi tool. It ensures that encryption, decryption, and HMAC-SHA256 operations are correctly executed and verified against expected outputs. |
8 | | - |
9 | | -## Features |
10 | | - |
11 | | -- Environment Initialization: Robustly locates and sources the init_env file from the directory hierarchy. |
12 | | -- Dependency Check: Verifies the presence of required tools like kcapi. |
13 | | -- Crypto Validation: Performs AES-CBC encryption/decryption and HMAC-SHA256 operations. |
14 | | -- Automated Result Logging: Outputs test results to a .res file for automated result collection. |
15 | | -- Modular Integration: Designed to work within a larger test framework using functestlib.sh. |
16 | | - |
17 | | -## Prerequisites |
18 | | - |
19 | | -Ensure the following components are present on the target device: |
20 | | - |
21 | | -- `kcapi` (Kernel Crypto tool) Available in /usr/bin |
22 | | -- `libkcapi.so.1` (Kernel Crypto library) Available in /usr/lib |
23 | | - |
24 | | -## Directory Structure |
25 | | -``` |
26 | | -Runner/ |
27 | | -├── suites/ |
28 | | -│ ├── Kernel/ |
29 | | -│ │ ├── FunctionalArea/ |
30 | | -│ │ │ ├── baseport/ |
31 | | -│ │ │ │ ├── qcom_crypto/ |
32 | | -│ │ │ │ │ ├── run.sh |
33 | | -``` |
34 | | -## Usage |
35 | | - |
36 | | -1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to the ```/<user-defined-location>``` directory on the target device. |
37 | | - |
38 | | -2. Verify Transfer: Ensure that the repo have been successfully copied to the ```/<user-defined-location>``` directory on the target device. |
39 | | - |
40 | | -3. Run Scripts: Navigate to the ```/<user-defined-location>``` directory on the target device and execute the scripts as needed. |
41 | | - |
42 | | ---- |
43 | | -Quick Example |
44 | | -``` |
45 | | -git clone <this-repo> |
46 | | -cd <this-repo> |
47 | | -scp -r common Runner user@target_device_ip:/<user-defined-location> |
48 | | -ssh user@target_device_ip |
49 | | -cd /<user-defined-location>/Runner && ./run-test.sh qcom_crypto |
50 | | -
|
51 | | -Sample output: |
52 | | -sh-5.2# ./run-test.sh qcom_crypto |
53 | | -[Executing test case: qcom_crypto] 1970-01-01 05:44:18 - |
54 | | -[INFO] 1970-01-01 05:44:18 - ----------------------------------------------------------------------------------------- |
55 | | -[INFO] 1970-01-01 05:44:18 - -------------------Starting qcom_crypto Testcase---------------------------- |
56 | | -[INFO] 1970-01-01 05:44:18 - === Test Initialization === |
57 | | -[INFO] 1970-01-01 05:44:18 - Checking if dependency binary is available |
58 | | -[INFO] 1970-01-01 05:44:18 - Running encryption test |
59 | | -[INFO] 1970-01-01 05:44:18 - Encryption test passed |
60 | | -[INFO] 1970-01-01 05:44:18 - Running decryption test |
61 | | -[INFO] 1970-01-01 05:44:18 - Decryption test passed |
62 | | -[INFO] 1970-01-01 05:44:18 - Running HMAC-SHA256 test |
63 | | -[INFO] 1970-01-01 05:44:18 - HMAC-SHA256 test passed |
64 | | -[PASS] 1970-01-01 05:44:18 - qcom_crypto : All tests passed |
65 | | -[PASS] 1970-01-01 05:44:18 - qcom_crypto passed |
66 | | -
|
67 | | -[INFO] 1970-01-01 05:44:18 - ========== Test Summary ========== |
68 | | -PASSED: |
69 | | -qcom_crypto |
70 | | -
|
71 | | -FAILED: |
72 | | - None |
73 | | -
|
74 | | -SKIPPED: |
75 | | - None |
76 | | -[INFO] 1970-01-01 05:44:18 - ================================== |
77 | | -``` |
78 | | -4. Results will be available in the `/<user-defined-location>/Runner/suites/Kernel/FunctionalArea/baseport/qcom_crypto/` directory. |
79 | | - |
80 | | -## Notes |
81 | | - |
82 | | -- It uses kcapi to validate AES-CBC encryption/decryption and HMAC-SHA256 hashing. |
| 1 | +Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
| 2 | +SPDX-License-Identifier: BSD-3-Clause-Clear |
| 3 | + |
| 4 | +# Qualcomm Crypto (qcom_crypto) Functionality Test Script |
| 5 | +# Overview |
| 6 | + |
| 7 | +The qcom_crypto test script validates the basic functionality of cryptographic operations using the kcapi tool. It ensures that encryption, decryption, and HMAC-SHA256 operations are correctly executed and verified against expected outputs. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- Environment Initialization: Robustly locates and sources the init_env file from the directory hierarchy. |
| 12 | +- Dependency Check: Verifies the presence of required tools like kcapi. |
| 13 | +- Crypto Validation: Performs AES-CBC encryption/decryption and HMAC-SHA256 operations. |
| 14 | +- Automated Result Logging: Outputs test results to a .res file for automated result collection. |
| 15 | +- Modular Integration: Designed to work within a larger test framework using functestlib.sh. |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Ensure the following components are present on the target device: |
| 20 | + |
| 21 | +- `kcapi` (Kernel Crypto tool) Available in /usr/bin |
| 22 | +- `libkcapi.so.1` (Kernel Crypto library) Available in /usr/lib |
| 23 | + |
| 24 | +## Directory Structure |
| 25 | +``` |
| 26 | +Runner/ |
| 27 | +├── suites/ |
| 28 | +│ ├── Kernel/ |
| 29 | +│ │ ├── Baseport/ |
| 30 | +│ │ │ ├── qcom_crypto/ |
| 31 | +│ │ │ │ ├── run.sh |
| 32 | +
|
| 33 | +``` |
| 34 | +## Usage |
| 35 | + |
| 36 | +1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to the ```/<user-defined-location>``` directory on the target device. |
| 37 | + |
| 38 | +2. Verify Transfer: Ensure that the repo have been successfully copied to the ```/<user-defined-location>``` directory on the target device. |
| 39 | + |
| 40 | +3. Run Scripts: Navigate to the ```/<user-defined-location>``` directory on the target device and execute the scripts as needed. |
| 41 | + |
| 42 | +--- |
| 43 | +Quick Example |
| 44 | +``` |
| 45 | +git clone <this-repo> |
| 46 | +cd <this-repo> |
| 47 | +scp -r common Runner user@target_device_ip:/<user-defined-location> |
| 48 | +ssh user@target_device_ip |
| 49 | +cd /<user-defined-location>/Runner && ./run-test.sh qcom_crypto |
| 50 | +
|
| 51 | +Sample output: |
| 52 | +sh-5.2# ./run-test.sh qcom_crypto |
| 53 | +[Executing test case: qcom_crypto] 1970-01-01 05:44:18 - |
| 54 | +[INFO] 1970-01-01 05:44:18 - ----------------------------------------------------------------------------------------- |
| 55 | +[INFO] 1970-01-01 05:44:18 - -------------------Starting qcom_crypto Testcase---------------------------- |
| 56 | +[INFO] 1970-01-01 05:44:18 - === Test Initialization === |
| 57 | +[INFO] 1970-01-01 05:44:18 - Checking if dependency binary is available |
| 58 | +[INFO] 1970-01-01 05:44:18 - Running encryption test |
| 59 | +[INFO] 1970-01-01 05:44:18 - Encryption test passed |
| 60 | +[INFO] 1970-01-01 05:44:18 - Running decryption test |
| 61 | +[INFO] 1970-01-01 05:44:18 - Decryption test passed |
| 62 | +[INFO] 1970-01-01 05:44:18 - Running HMAC-SHA256 test |
| 63 | +[INFO] 1970-01-01 05:44:18 - HMAC-SHA256 test passed |
| 64 | +[PASS] 1970-01-01 05:44:18 - qcom_crypto : All tests passed |
| 65 | +[PASS] 1970-01-01 05:44:18 - qcom_crypto passed |
| 66 | +
|
| 67 | +[INFO] 1970-01-01 05:44:18 - ========== Test Summary ========== |
| 68 | +PASSED: |
| 69 | +qcom_crypto |
| 70 | +
|
| 71 | +FAILED: |
| 72 | + None |
| 73 | +
|
| 74 | +SKIPPED: |
| 75 | + None |
| 76 | +[INFO] 1970-01-01 05:44:18 - ================================== |
| 77 | +``` |
| 78 | +4. Results will be available in the `/<user-defined-location>/Runner/suites/Kernel/FunctionalArea/baseport/qcom_crypto/` directory. |
| 79 | + |
| 80 | +## Notes |
| 81 | + |
| 82 | +- It uses kcapi to validate AES-CBC encryption/decryption and HMAC-SHA256 hashing. |
83 | 83 | - If any test fails, the script logs the expected vs actual output and exits with a failure code. |
0 commit comments