From: James Simmons Date: Tue, 5 Jan 2016 23:30:02 +0000 (-0500) Subject: LU-5030 tests: handle missing common_name for upstream client X-Git-Tag: 2.7.66~55 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=9b09e38b5008af30c86854e77930fc85323079c5;p=fs%2Flustre-release.git LU-5030 tests: handle missing common_name for upstream client The upstream client has moved from procfs to sysfs except for llite.*.lov.common_name which does not exist for the upstream client. In the current test suite common_name is used to gather information like stripe count and ost count. This is left overs from days before lfs [s|g]et_stripe existed and OSTCOUNT was not defined in the test suite configuration files. Instead we can replace the use of common_name with OSTCOUNT and use lfs [g|s]et_stripe. Change-Id: I7fbb7348e009cb9f77ba9847aeb4879dc302e4ee Signed-off-by: Dmitry Eremin Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/14675 Tested-by: Jenkins Reviewed-by: Ryan Haasken Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 9d5e75d..bd057dc 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -68,9 +68,6 @@ export QUOTA_AUTO=0 check_and_setup_lustre -LOVNAME=$(lctl get_param -n llite.*.lov.common_name | tail -n 1) -OSTCOUNT=$(lctl get_param -n lov.$LOVNAME.numobd) - SHOW_QUOTA_USER="$LFS quota -v -u $TSTUSR $DIR" SHOW_QUOTA_USERID="$LFS quota -v -u $TSTID $DIR" SHOW_QUOTA_GROUP="$LFS quota -v -g $TSTUSR $DIR" diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index ebb2495..f696fe0 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -111,11 +111,6 @@ assert_DIR MDT0=$($LCTL get_param -n mdc.*.mds_server_uuid | awk '{ gsub(/_UUID/,""); print $1 }' | head -n1) -LOVNAME=$($LCTL get_param -n llite.*.lov.common_name | tail -n 1) -OSTCOUNT=$($LCTL get_param -n lov.$LOVNAME.numobd) -STRIPECOUNT=$($LCTL get_param -n lov.$LOVNAME.stripecount) -STRIPESIZE=$($LCTL get_param -n lov.$LOVNAME.stripesize) -ORIGFREE=$($LCTL get_param -n lov.$LOVNAME.kbytesavail) MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))} [ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo @@ -1431,6 +1426,9 @@ run_test 27l "check setstripe permissions (should return error)" test_27m() { [[ $OSTCOUNT -lt 2 ]] && skip_env "$OSTCOUNT < 2 OSTs -- skipping" && return + + ORIGFREE=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail | + head -n1) if [[ $ORIGFREE -gt $MAXFREE ]]; then skip "$ORIGFREE > $MAXFREE skipping out-of-space test on OST0" return @@ -4848,7 +4846,9 @@ test_56w() { local file_size=$((stripe_size * OSTCOUNT)) local file_num=$((NUMDIRS * NUMFILES + NUMFILES)) local required_space=$((file_num * file_size)) - local free_space=$($LCTL get_param -n lov.$LOVNAME.kbytesavail) + + local free_space=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail | + head -n1) [[ $free_space -le $((required_space / 1024)) ]] && skip_env "need at least $required_space bytes free space," \ "have $free_space kbytes" && return @@ -5371,28 +5371,35 @@ run_test 65a "directory with no stripe info ====================" test_65b() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir || error "setstripe" touch $DIR/$tdir/f2 $LVERIFY $DIR/$tdir $DIR/$tdir/f2 || error "lverify failed" } -run_test 65b "directory setstripe -S $((STRIPESIZE * 2)) -i 0 -c 1" +run_test 65b "directory setstripe -S stripe_size*2 -i 0 -c 1" test_65c() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return if [[ $OSTCOUNT -gt 1 ]]; then test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $(($STRIPESIZE * 4)) -i 1 \ -c $(($OSTCOUNT - 1)) $DIR/$tdir || error "setstripe" touch $DIR/$tdir/f3 $LVERIFY $DIR/$tdir $DIR/$tdir/f3 || error "lverify failed" fi } -run_test 65c "directory setstripe -S $((STRIPESIZE*4)) -i 1 -c $((OSTCOUNT-1))" +run_test 65c "directory setstripe -S stripe_size*4 -i 1 -c $((OSTCOUNT-1))" test_65d() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPECOUNT=$($GETSTRIPE -c $DIR/$tdir) + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + if [[ $STRIPECOUNT -le 0 ]]; then sc=1 elif [[ $STRIPECOUNT -gt 2000 ]]; then @@ -5406,7 +5413,7 @@ test_65d() { $LVERIFY $DIR/$tdir $DIR/$tdir/f4 $DIR/$tdir/f5 || error "lverify failed" } -run_test 65d "directory setstripe -S $STRIPESIZE -c stripe_count" +run_test 65d "directory setstripe -S stripe_size -c stripe_count" test_65e() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return @@ -5430,6 +5437,8 @@ run_test 65f "dir setstripe permission (should return error) ===" test_65g() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir || error "setstripe" $SETSTRIPE -d $DIR/$tdir || error "setstripe" @@ -5441,6 +5450,8 @@ run_test 65g "directory setstripe -d ===========================" test_65h() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir || error "setstripe" test_mkdir -p $DIR/$tdir/dd1 diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 99b8649..5d2104e 100644 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -48,9 +48,6 @@ TRACE=${TRACE:-""} check_and_setup_lustre -LOVNAME=$($LCTL get_param -n llite.*.lov.common_name | tail -n 1) -OSTCOUNT=$($LCTL get_param -n lov.$LOVNAME.numobd) - assert_DIR rm -rf $DIR1/[df][0-9]* $DIR1/lnk $DIR/[df].${TESTSUITE}*