Whamcloud - gitweb
LU-3219 tests: add version check code to sanityn test 71 85/6585/4
authorJian Yu <jian.yu@intel.com>
Fri, 7 Jun 2013 08:09:17 +0000 (16:09 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Jul 2013 04:39:41 +0000 (04:39 +0000)
This patch adds Lustre version check codes into sanityn test
71 to make the test work with servers which do not have the
following patch:

Lustre-commit: 58444c4e9bc58e192f0bc0c163a5d51d42ba4255
Lustre-change: http://review.whamcloud.com/6127
or
Lustre-commit: 6a4ea7d154b6c016f482662463c9d2186176fee0
Lustre-change: http://review.whamcloud.com/6377

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 serverjob=lustre-b2_1 serverbuildno=191 \
testlist=sanityn

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: Ide9d42d4634f51110cb7036e43060b591ed970eb
Reviewed-on: http://review.whamcloud.com/6585
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanityn.sh

index 951c1bd..ba50004 100644 (file)
@@ -2435,12 +2435,22 @@ test_70b() { # LU-2781
 run_test 70b "remove files after calling rm_entry"
 
 test_71() {
 run_test 70b "remove files after calling rm_entry"
 
 test_71() {
+       local server_version=$(lustre_version_code $SINGLEMDS)
+
+       [[ $server_version -lt $(version_code 2.1.6) ]] &&
+               skip "Need MDS version at least 2.1.6" && return
+
+       # Patch not applied to 2.2 and 2.3 branches
+       [[ $server_version -ge $(version_code 2.2.0) ]] &&
+       [[ $server_version -lt $(version_code 2.4.0) ]] &&
+               skip "Need MDS version at least 2.4.0" && return
+
        checkfiemap --test ||
                { skip "checkfiemap not runnable: $?" && return; }
        # write data this way: hole - data - hole - data
        dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=1 count=1
        [ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR1/$tfile) + 1)))" = \
        checkfiemap --test ||
                { skip "checkfiemap not runnable: $?" && return; }
        # write data this way: hole - data - hole - data
        dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=1 count=1
        [ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR1/$tfile) + 1)))" = \
-               "zfs" ] && 
+               "zfs" ] &&
                skip "ORI-366/LU-1941: FIEMAP unimplemented on ZFS" && return 0
        dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=3 count=1
        GET_STAT="lctl get_param -n ldlm.services.ldlm_cbd.stats"
                skip "ORI-366/LU-1941: FIEMAP unimplemented on ZFS" && return 0
        dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=3 count=1
        GET_STAT="lctl get_param -n ldlm.services.ldlm_cbd.stats"