Skip to content

Commit fda2141

Browse files
igawkawasaki
authored andcommitted
common/rc, nvme/{043-045}: add _have_crypto_algorithm
A crypto algorithm might be provided as built-in, thus check first if it is always present before trying to load as module. Signed-off-by: Daniel Wagner <[email protected]> [Shin'ichiro: replaced grep -q option with --quiet option] Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent b1b99d1 commit fda2141

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

common/rc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ _have_driver()
6969
return 0
7070
}
7171

72+
# Check that the specified crypto algorithm is present, regardless of whether
73+
# it's built-in or as module.
74+
_have_crypto_algorithm()
75+
{
76+
local algo="$1"
77+
78+
if grep --quiet "${algo}" /proc/crypto; then
79+
return 0
80+
fi
81+
82+
_have_driver "${algo}"
83+
}
84+
7285
# Check that the specified module is available as a loadable module and not
7386
# built-in the kernel.
7487
_have_module() {

tests/nvme/043

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ requires() {
1616
_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
1717
_require_nvme_trtype_is_fabrics
1818
_require_nvme_cli_auth
19-
_have_driver dh_generic
19+
_have_crypto_algorithm dh-generic
2020
}
2121

2222
set_conditions() {

tests/nvme/044

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ requires() {
1616
_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
1717
_require_nvme_trtype_is_fabrics
1818
_require_nvme_cli_auth
19-
_have_driver dh_generic
19+
_have_crypto_algorithm dh-generic
2020
}
2121

2222
set_conditions() {

tests/nvme/045

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requires() {
1717
_require_kernel_nvme_fabrics_feature dhchap_ctrl_secret
1818
_require_nvme_trtype_is_fabrics
1919
_require_nvme_cli_auth
20-
_have_driver dh_generic
20+
_have_crypto_algorithm dh-generic
2121
}
2222

2323
set_conditions() {

0 commit comments

Comments
 (0)