1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: add driver_at_least() to aux.sh

Add a function to test whether the running device-mapper driver
version is at least equal to some given version.
This commit is contained in:
Bryn M. Reeves 2015-11-27 17:55:08 +00:00
parent 1f8fd5a152
commit 3dae416229

View File

@ -1232,6 +1232,21 @@ target_at_least() {
}
}
# Check whether the kernel driver version is greater or equal
# to the specified version. This can be used to skip tests on
# kernels where they are known to not be supported.
#
# e.g. driver_at_least 4 33
#
driver_at_least() {
local version=$(dmsetup version | tail -1 2>/dev/null)
version=${version##*:}
version_at_least "$version" "$@" || {
echo "Found driver version $version, but requested $@." >&2
return 1
}
}
have_thin() {
test "$THIN" = shared -o "$THIN" = internal || {
echo "Thin is not built-in." >&2