Whamcloud - gitweb
LU-9968 tests: correct stripe index sanity 300g 35/28935/3
authorJames Nunez <james.a.nunez@intel.com>
Mon, 11 Sep 2017 21:16:42 +0000 (15:16 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Oct 2017 03:42:40 +0000 (03:42 +0000)
In sanity test 300g, we set the starting stripe index to MDT 1
and MDT 2 using 'lfs setstripedir -iN' for N = 1 and 2. At the
beginning of the test, we check that there are two or more MDTs
in the Lustre file system being tested. If there are only two MDTs,
then this test will fail when we try to set the starting stripe
index to 2 because the MDT indexes are zero based.

For santiy test 300g only use MDT start index 0 and 1.

Signed-off-by: James Nunez <james.a.nunez@intel.com>
Change-Id: If2c252ad9bb7249aa777764f212ee40523aee82f
Reviewed-on: https://review.whamcloud.com/28935
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Saurabh Tandan <saurabh.tandan@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
lustre/tests/sanity.sh

index c130a37..c80bdab 100755 (executable)
@@ -15311,17 +15311,17 @@ test_300g() {
        $LFS setdirstripe -D -i1 $DIR/$tdir/striped_dir ||
                error "create striped_dir failed"
 
+       $LFS setdirstripe -i0 $DIR/$tdir/striped_dir/dir0 ||
+               error "create dir0 fails"
+       stripe_index=$($LFS getdirstripe -i $DIR/$tdir/striped_dir/dir0)
+       [ $stripe_index -eq 0 ] ||
+               error "dir0 expect index 0 got $stripe_index"
+
        mkdir $DIR/$tdir/striped_dir/dir1 ||
                error "create dir1 fails"
        stripe_index=$($LFS getdirstripe -i $DIR/$tdir/striped_dir/dir1)
        [ $stripe_index -eq 1 ] ||
-               error "dir1 expect 1 got $stripe_index"
-
-       $LFS setdirstripe -i2 $DIR/$tdir/striped_dir/dir2 ||
-               error "create dir2 fails"
-       stripe_index=$($LFS getdirstripe -i $DIR/$tdir/striped_dir/dir2)
-       [ $stripe_index -eq 2 ] ||
-               error "dir2 expect 2 got $stripe_index"
+               error "dir1 expect index 1 got $stripe_index"
 
        #check default stripe count/stripe index
        test_300_check_default_striped_dir normal_dir $MDSCOUNT 1