nvme/63: fixup tls_key encryption check
PATCH 1/1 nvme/63: fixup tls_key encryption check
From: Wilfred Mallawa <[email protected]>
The _nvme_ctrl_tls_key function returns 0 if tls_key exists in sysfs for the respective nvme controller. This will be evaluated as true. However, the test should error only if the key is not exposed by sysfs. Which would mean the connection is not encrypted, as per the existing warning message in the test. Currently, we are checking that it exists and erroring out incorrectly. This patch fixes the above.
--- tests/nvme/063 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/nvme/063 +1 -1
@@ -93,7 +93,7 @@ test() { _nvme_connect_subsys --dhchap-secret "${hostkey}" --concat ctrl=$(_find_nvme_dev "${def_subsysnqn}") - if _nvme_ctrl_tls_key "$ctrl" > /dev/null ; then + if ! _nvme_ctrl_tls_key "$ctrl" > /dev/null ; then echo "WARNING: connection is not encrypted" _systemctl_stop return 1
Signature · 1 line
2.49.0
Shinichiro Kawasaki
AppliedQuoted 9 lines · Wilfred Mallawa
From: Wilfred Mallawa <[email protected]>
The
_nvme_ctrl_tls_keyfunction returns 0 iftls_keyexists in sysfs for the respective nvme controller. This will be evaluated as true. However, the test should error only if the key is not exposed by sysfs. Which would mean the connection is not encrypted, as per the existing warning message in the test. Currently, we are checking that it exists and erroring out incorrectly. This patch fixes the above.
Quoted 3 lines
Fixes 9aa2023312bf ("nvme: add testcase for secure concatenation")Signed-off-by Wilfred Mallawa <[email protected]>
I applied it. Thanks!