From b9a0a6920c204d3642394e66a9ef2369f420d2ae Mon Sep 17 00:00:00 2001
From: grev <grev>
Date: Mon, 1 Dec 2008 10:27:17 +0000
Subject: [PATCH] b=17696 i=Adilger skip liblustre for different client/mds
 versions

---
 lustre/tests/acceptance-small.sh |  7 ++++++-
 lustre/tests/test-framework.sh   | 17 +++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh
index 9d14d74a9c..e10c738239 100755
--- a/lustre/tests/acceptance-small.sh
+++ b/lustre/tests/acceptance-small.sh
@@ -61,6 +61,7 @@ setup_if_needed() {
     local MOUNTED=$(mounted_lustre_filesystems)
     if $(echo $MOUNTED | grep -w -q $MOUNT); then
         check_config $MOUNT
+        init_versions_vars
         return
     fi
 
@@ -315,8 +316,12 @@ for NAME in $CONFIGS; do
 	fi
 
 	[ "$NETTYPE" = "tcp" -o "$NETTYPE" = "ptl" ] || LIBLUSTRE=no # bug 15660
+	if [ "$LIBLUSTRE" != "no" ] && ! check_versions ; then
+		skip liblustre version mismatch: cli $CLIVER, mds $MDSVER, ost $OSTVER
+		LIBLUSTRE=no	# bug 17696
+	fi
 	if [ "$LIBLUSTRE" != "no" ]; then
-	        title liblustre
+		title liblustre
 		assert_env MGSNID MOUNT2
 		export LIBLUSTRE_MOUNT_POINT=$MOUNT2
 		export LIBLUSTRE_MOUNT_RETRY=5
diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 617f2bcd98..747d415ecd 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -1243,6 +1243,8 @@ setupall() {
         [ -n "$CLIENTS" ] && zconf_mount_clients $CLIENTS $MOUNT2
     fi
 
+    init_versions_vars
+
     # by remounting mdt before ost, initial connect from mdt to ost might
     # timeout because ost is not ready yet. wait some time to its fully
     # recovery. initial obd_connect timeout is 5s; in GSS case it's preceeded
@@ -1295,6 +1297,12 @@ init_facets_vars () {
     done
 }
 
+init_versions_vars () {
+    export MDSVER=$(do_facet $SINGLEMDS "lctl get_param version" | cut -d. -f1,2)
+    export OSTVER=$(do_facet ost1 "lctl get_param version" | cut -d. -f1,2)
+    export CLIVER=$(lctl get_param version | cut -d. -f 1,2)
+}
+
 check_config () {
     local mntpt=$1
     
@@ -1319,6 +1327,7 @@ check_and_setup_lustre() {
     else
         check_config $MOUNT
         init_facets_vars
+        init_versions_vars
     fi
     if [ "$ONLY" == "setup" ]; then
         exit 0
@@ -1964,9 +1973,13 @@ is_patchless ()
     lctl get_param version | grep -q patchless
 }
 
+check_versions () {
+    [ "$MDSVER" = "$CLIVER" -a "$OSTVER" = "$CLIVER" ]
+}
+
 get_node_count() {
-   local nodes="$@"
-   echo $nodes | wc -w || true
+    local nodes="$@"
+    echo $nodes | wc -w || true
 }
 
 mixed_ost_devs () {
-- 
GitLab