[PATCH blktests 04/10] nvme/rc: introduce _have_tlshd_ver() and _have_systemd_tlshd_service()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To run the newly introduced test cases for nvme-tcp TLS support, the
userland daemon tlshd and its systemctl service unit are required.
Confirm availability of tlshd and the systemctl service. Also check that
the tlshd version is larger than or equal to 1.0.0, which allows to
authenticate TLS sessions for nvme subsystem with the default
configurations.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
---
 tests/nvme/rc | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/nvme/rc b/tests/nvme/rc
index de68b31..9584610 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -597,3 +597,23 @@ _nvme_reset_ctrl() {
 _nvme_delete_ctrl() {
 	echo 1 > /sys/class/nvme/"$1"/delete_controller
 }
+
+# Check whether the version of the fio is greater than or equal to $1.$2.$3
+_have_tlshd_ver() {
+	_have_program tlshd || return $?
+
+	if _compare_three_version_numbers \
+		   "$(tlshd --version |& sed 's/.*utils \([0-9^.]*\).*/\1/')" \
+		   "$1" "$2" "$3"; then
+		SKIP_REASONS+=("tlshd version is older than ${1}.${2}.${3}")
+		return 1
+	fi
+	return 0
+}
+
+_have_systemd_tlshd_service() {
+	_have_tlshd_ver 1 0 0
+	if ! _have_systemctl_unit tlshd; then
+		SKIP_REASONS+=("Install ktls-utils for tlshd")
+	fi
+}
-- 
2.49.0





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux