From 52a1befd75087190ff23c0750b85bb632f772474 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 11 Sep 2017 15:16:42 -0600 Subject: [PATCH] LU-9968 tests: correct stripe index sanity 300g 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 Change-Id: If2c252ad9bb7249aa777764f212ee40523aee82f Reviewed-on: https://review.whamcloud.com/28935 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Saurabh Tandan Tested-by: Maloo Reviewed-by: Wei Liu --- lustre/tests/sanity.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index c130a37..c80bdab 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 -- 1.8.3.1