[PATCH blktests 05/10] nvme/rc: introduce _have_libnvme_ver()

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

 



A following patch is going to add a test case which depends on the
version of libnvme linked to nvme-cli. Introduce the helper function
_have_libnvme_ver() to check the version dependency.

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

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 9584610..e52437f 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -617,3 +617,16 @@ _have_systemd_tlshd_service() {
 		SKIP_REASONS+=("Install ktls-utils for tlshd")
 	fi
 }
+
+_have_libnvme_ver() {
+	local ver
+
+	_have_program nvme || return $?
+	ver="$(nvme --version | grep libnvme | cut --delimiter ' ' --fields 3 | sed 's/-.*//')"
+
+	if _compare_three_version_numbers "$ver" "$1" "$2" "$3"; then
+		SKIP_REASONS+=("libnvme version is older than ${1}.${2}.${3:-0}")
+		return 1
+	fi
+	return 0
+}
-- 
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