diff mbox

[ndctl] ndctl: limit clear poison test to 4.6+ kernels

Message ID 20160329222325.31212.8411.stgit@dwillia2-desk3.jf.intel.com (mailing list archive)
State Accepted
Commit f6ae970b7890
Headers show

Commit Message

Dan Williams March 29, 2016, 10:23 p.m. UTC
Prior kernels do not export a clear poison facility.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/clear.sh |    9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/test/clear.sh b/test/clear.sh
index e74522201231..16b0cbf3a71c 100755
--- a/test/clear.sh
+++ b/test/clear.sh
@@ -13,6 +13,15 @@  err() {
 	exit $rc
 }
 
+eval $(uname -r | awk -F. '{print "maj="$1 ";" "min="$2}')
+if [ $maj -lt 4 ]; then
+	echo "kernel $maj.$min lacks clear poison support"
+	exit $rc
+elif [ $maj -eq 4 -a $min -lt 6 ]; then
+	echo "kernel $maj.$min lacks clear poison support"
+	exit $rc
+fi
+
 set -e
 trap 'err $LINENO' ERR