Skip to content

Commit

Permalink
Update the readme files
Browse files Browse the repository at this point in the history
update the readme files
  • Loading branch information
stanley31huang committed Jul 15, 2024
1 parent 0da3962 commit 160fc62
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 895 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@

## <a id='top'>environ keys for crypto test</a>
## <a id='top'>environ keys for crypto tests</a>

- HWRNG
- Affected Test Cases:
- [ce-oem-crypto/hwrng-current](#ce-oem-crypto/hwrng-current)
- Affected Test Cases:
- [ce-oem-crypto/hwrng-current](#ce-oem-crypto/hwrng-current)

## Detailed test cases
## Detailed test cases contains environ variable
### <a id='ce-oem-crypto/hwrng-current'>ce-oem-crypto/hwrng-current</a>
- **environ :** HWRNG
- **summary :** Check if current Hardware Random Number Generate is expected.
- **description :**
- **summary:**
Check if current Hardware Random Number Generate is expected.

- **description:**
```
None
```
- **command :**

- **file:**
[source file](accelerator.pxu#L1)

- **environ:**
HWRNG

- **command:**
```
path_hwrng='/sys/class/misc/hw_random/'
if [ -e "$path_hwrng/rng_available" ]; then
Expand All @@ -38,235 +47,4 @@ else
exit 1
fi
```

[Back to top](#top)
### <a id='ce-oem-crypto/caam/caam_hwrng_test'>ce-oem-crypto/caam/caam_hwrng_test</a>
- **environ :** None
- **summary :** Check if CAAM job ring increased after generate random number by using hwrng.
- **description :**
```
None
```
- **command :**
```
init_interrupt=$(awk '/\.jr/ {printf "%s ",$2;next;}' /proc/interrupts|sed 's/ //g')
if [ -z "$init_interrupt" ]
then
echo "ERROR: Can not find CAAM job ring interrupts"
exit 1
fi
echo "CAAM Job ring interrupt before using Hardware RNG: $init_interrupt"
echo "Starting DD of /dev/hwrng ..."
for i in {1..20}
do
dd if=/dev/hwrng bs=512K count=1 > /dev/null
echo "Finished $i/20 times DD ..."
interrupt=$(awk '/\.jr/ {printf "%s ",$2;next;}' /proc/interrupts|sed 's/ //g')
echo "Current job ring interrupt: $interrupt"
if [ "$interrupt" -gt "$init_interrupt" ];
then
echo "PASS: CAAM job ring interrupts have increased."
exit 0
fi
done
echo "FAIL: CAAM job ring interrupts didn't increase!"
exit 1
```

[Back to top](#top)
### <a id='ce-oem-crypto/caam/algo_check'>ce-oem-crypto/caam/algo_check</a>
- **environ :** None
- **summary :** Check CAAM algorithm is in the system /proc/crypto
- **description :**
```
None
```
- **command :**
```
status=0
if grep -q caam /proc/crypto; then
echo -e "\nInfo: Found CAAM algorithm in /proc/crypto"
else
echo -e "\nError: No any CAAM algorithm has been found in /proc/crytpo"
status=1
fi
echo -e "\nPlease refer to resource job cryptoinfo for more detail"
exit "$status"
```

[Back to top](#top)
### <a id='ce-oem-crypto/caam-crypto-profiles'>ce-oem-crypto/caam-crypto-profiles</a>
- **environ :** None
- **summary :** Generates a crypto profiles for CAAM accelerator
- **description :**
```
A set of crypto profile mapping for CAAm accelerator.
```
- **command :**
```
check_crypto_profile.py resource -t caam
```

[Back to top](#top)
### <a id='ce-oem-crypto/mcrc-crypto-profiles'>ce-oem-crypto/mcrc-crypto-profiles</a>
- **environ :** None
- **summary :** Generates a crypto profiles for MCRC accelerator
- **description :**
```
A set of crypto profile mapping for MCRC accelerator.
```
- **command :**
```
check_crypto_profile.py resource -t mcrc
```

[Back to top](#top)
### <a id='ce-oem-crypto/sa2ul-crypto-profiles'>ce-oem-crypto/sa2ul-crypto-profiles</a>
- **environ :** None
- **summary :** Generates a crypto profiles for SA2UL accelerator
- **description :**
```
A set of crypto profile mapping for SA2UL accelerator.
```
- **command :**
```
check_crypto_profile.py resource -t sa2ul
```

[Back to top](#top)
### <a id='cryptoinfo'>cryptoinfo</a>
- **environ :** None
- **summary :** Collect information about the crypto algorithm in system
- **description :**
```
Gets crypto algorithm resource info from /proc/crypto
```
- **command :**
```
cat /proc/crypto
```

[Back to top](#top)
### <a id='ce-oem-crypto/cryptsetup_benchmark'>ce-oem-crypto/cryptsetup_benchmark</a>
- **environ :** None
- **summary :** Measure the cryptographic performance of system
- **description :**
```
Measure the cryptographic performance of system by using cryptsetup
```
- **command :**
```
log=$(mktemp)
echo "Starting cryptographic benchmark testing ..."
cryptsetup benchmark | tee "$log"
awk '/aes-xts *512b/ {encryption=$3; decryption=$5} END {print "Performace of AES-XTS 512b", "\nEncryption:", encryption, "Mib/s", "\nDecryption:", decryption, "Mib/s"}' "$log"
```

[Back to top](#top)
### <a id='ce-oem-crypto/af_alg_hash_crc64_test'>ce-oem-crypto/af_alg_hash_crc64_test</a>
- **environ :** None
- **summary :** Check kernel crypto API is functional with type HASH - CRC64 algorithm
- **description :**
```
None
```
- **command :**
```
af_alg_test.py --type hash_crc64
```

[Back to top](#top)
### <a id='ce-oem-crypto/af_alg_hash_sha256_test'>ce-oem-crypto/af_alg_hash_sha256_test</a>
- **environ :** None
- **summary :** Check kernel crypto API is functional with type HASH - SHA256 algorithm
- **description :**
```
None
```
- **command :**
```
af_alg_test.py --type hash_sha256
```

[Back to top](#top)
### <a id='ce-oem-crypto/af_alg_aead_gcm_aes_test'>ce-oem-crypto/af_alg_aead_gcm_aes_test</a>
- **environ :** None
- **summary :** Check if kernel crypto API is functional with type AEAD - GCM AES algorithm.
- **description :**
```
None
```
- **command :**
```
af_alg_test.py --type aead_gcm_aes
```

[Back to top](#top)
### <a id='ce-oem-crypto/af_alg_skcipher_cbc_aes_test'>ce-oem-crypto/af_alg_skcipher_cbc_aes_test</a>
- **environ :** None
- **summary :** Check if kernel crypto API is functional with type SKCIPHER - CBC AES algorithm.
- **description :**
```
None
```
- **command :**
```
af_alg_test.py --type skcipher_cbc_aes
```

[Back to top](#top)
### <a id='ce-oem-crypto/af_alg_rng_stdrng_test'>ce-oem-crypto/af_alg_rng_stdrng_test</a>
- **environ :** None
- **summary :** Check if kernel crypto API is functional with type RNG - stdrng algorithm.
- **description :**
```
None
```
- **command :**
```
af_alg_test.py --type rng_stdrng
```

[Back to top](#top)
### <a id='ce-oem-crypto/check-caam-crypto-profiles'>ce-oem-crypto/check-caam-crypto-profiles</a>
- **environ :** None
- **summary :** Check CAAM crypto {name} profile and its driver in the system
- **template_summary :** Check CAAM crypto profile and its driver in the system
- **description :**
```
None
```
- **command :**
```
check_crypto_profile.py check -n "{name}" -t {type} -d {driver_pattern}
```

[Back to top](#top)
### <a id='ce-oem-crypto/check-mcrc-crypto-profiles'>ce-oem-crypto/check-mcrc-crypto-profiles</a>
- **environ :** None
- **summary :** Check MCRC crypto {name} profile and its driver in the system
- **template_summary :** Check MCRC crypto profile and its driver in the system
- **description :**
```
None
```
- **command :**
```
check_crypto_profile.py check -n "{name}" -t {type} -d {driver_pattern}
```

[Back to top](#top)
### <a id='ce-oem-crypto/check-sa2ul-crypto-profiles'>ce-oem-crypto/check-sa2ul-crypto-profiles</a>
- **environ :** None
- **summary :** Check SA2UL crypto {name} profile and its driver in the system
- **template_summary :** Check SA2UL crypto profile and its driver in the system
- **description :**
```
None
```
- **command :**
```
check_crypto_profile.py check -n "{name}" -t {type} -d {driver_pattern}
```

[Back to top](#top)
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@

## <a id='top'>environ keys for digital-io test</a>
## <a id='top'>environ keys for digital-io tests</a>

- DIGITAL_IO_LOOPBACK_GPIO
- Affected Test Cases:
- [ce-oem-digital-io/loopback_mapping_gpio](#ce-oem-digital-io/loopback_mapping_gpio)
- Affected Test Cases:
- [ce-oem-digital-io/loopback_mapping_gpio](#ce-oem-digital-io/loopback_mapping_gpio)
- DIGITAL_IO_LOOPBACK_SERIAL
- Affected Test Cases:
- [ce-oem-digital-io/loopback_mapping_serial](#ce-oem-digital-io/loopback_mapping_serial)
- Affected Test Cases:
- [ce-oem-digital-io/loopback_mapping_serial](#ce-oem-digital-io/loopback_mapping_serial)

## Detailed test cases
## Detailed test cases contains environ variable
### <a id='ce-oem-digital-io/loopback_mapping_gpio'>ce-oem-digital-io/loopback_mapping_gpio</a>
- **environ :** DIGITAL_IO_LOOPBACK_GPIO
- **summary :** Generates a digital I/O loopback ports mapping for digital I/O loopback test
- **description :**
- **summary:**
Generates a digital I/O loopback ports mapping for digital I/O loopback test

- **description:**
```
A digital I/O loopback ports mapping. By giving a pair of digital I/O port on machnie to generates test jobs.
Usage of parameter:
DIGITAL_IO_LOOPBACK_GPIO=do_port:do_gpio_pin:di_port:di_gpio_pin do_port:do_gpio_pin:di_port:di_gpio_pin ...
e.g. DIGITAL_IO_LOOPBACK_GPIO=1:733:2:765 3:734:4:766
```
- **command :**

- **file:**
[source file](jobs.pxu#L1)

- **environ:**
DIGITAL_IO_LOOPBACK_GPIO

- **command:**
```
awk '{
split($0, record, " ")
Expand All @@ -28,19 +37,27 @@ awk '{
}
}' <<< "$DIGITAL_IO_LOOPBACK_GPIO"
```

[Back to top](#top)

### <a id='ce-oem-digital-io/loopback_mapping_serial'>ce-oem-digital-io/loopback_mapping_serial</a>
- **environ :** DIGITAL_IO_LOOPBACK_SERIAL
- **summary :** Generates a digital I/O loopback ports mapping for digital I/O loopback test
- **description :**
- **summary:**
Generates a digital I/O loopback ports mapping for digital I/O loopback test

- **description:**
```
A digital I/O loopback ports mapping. By giving a pair of digital I/O port on machnie to generates test jobs.
Usage of parameter:
DIGITAL_IO_LOOPBACK_SERIAL=do_port:do_byte_pin:di_port:di_byte_pin do_port:do_byte_pin:di_port:di_byte_pin ...
e.g. DIGITAL_IO_LOOPBACK_SERIAL=1:2:1:6 2:3:2:7 3:4:3:8 4:5:4:9
```
- **command :**

- **file:**
[source file](jobs.pxu#L41)

- **environ:**
DIGITAL_IO_LOOPBACK_SERIAL

- **command:**
```
awk '{
split($0, record, " ")
Expand All @@ -50,44 +67,4 @@ awk '{
}
}' <<< "$DIGITAL_IO_LOOPBACK_SERIAL"
```

[Back to top](#top)
### <a id='ce-oem-digital-io/loopback_gpio_DODO-DIDI'>ce-oem-digital-io/loopback_gpio_DODO-DIDI</a>
- **environ :** None
- **summary :** To test loopback between DO{DO} and DI{DI}
- **template_summary :** Loopback tests for the DO{DO}-DI{DI} pin control by GPIO
- **description :**
```
None
```
- **command :**
```
echo "## Perform the digital I/O loopback test"
echo "DO{DO} gpio pin is {DO_GPIO}"
echo "DI{DI} gpio pin is {DI_GPIO}"
digital_io_loopback_test.py -o {DO_GPIO} -i {DI_GPIO}
```

[Back to top](#top)
### <a id='ce-oem-digital-io/loopback_serial_DODO-DIDI'>ce-oem-digital-io/loopback_serial_DODO-DIDI</a>
- **environ :** None
- **summary :** To test loopback between DO{DO} and DI{DI}
- **template_summary :** Loopback tests for the DO{DO}-DI{DI} pin control by serial console
- **description :**
```
The scripts will connect to the Digital IO controller via serial console
the serial console port is defined in variable DIGITAL_IO_CONSOLE
```
- **command :**
```
if [[ -z "$DIGITAL_IO_CONSOLE" ]]; then
echo "DIGITAL_IO_CONSOLE variable is not defined"
exit 1
fi
echo "## Perform the digital I/O loopback test"
echo "DO{DO} register byte is {DO_REGISTER_BYTE}"
echo "DI{DI} register byte is {DI_REGISTER_BYTE}"
digital_io_loopback_serial_test.py -o {DO_REGISTER_BYTE} -i {DI_REGISTER_BYTE} -s "$DIGITAL_IO_CONSOLE"
```

[Back to top](#top)
Loading

0 comments on commit 160fc62

Please sign in to comment.