From 1d80fd72bf42f653a5d6a4a31fc2c5df571f1afc Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Thu, 8 Mar 2018 10:40:40 -0500 Subject: [PATCH] LU-5490 tests: Sanity/133d ensure stats read is on correct MDT Ensure directories used to collect rename_stats are on the MDT that is checked. This ensures directories are created on MDT0 and not striped and then rename_stats is read from MDT0. Signed-off-by: Nathaniel Clark Change-Id: Ib27f5c531f2d8bd664ec3a4732c512b0c389dc43 Reviewed-on: https://review.whamcloud.com/31585 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu --- lustre/tests/sanity.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4bae41a..c8a880d 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -10521,12 +10521,13 @@ size_in_KMGT() { } get_rename_size() { - local size=$1 - local context=${2:-.} - local sample=$(do_facet $SINGLEMDS $LCTL get_param mdt.*.rename_stats | + local size=$1 + local context=${2:-.} + local sample=$(do_facet $SINGLEMDS $LCTL \ + get_param mdt.$FSNAME-MDT0000.rename_stats | grep -A1 $context | awk '/ '${size}'/ {print $4}' | sed -e "s/,//g") - echo $sample + echo $sample } test_133d() { @@ -10538,11 +10539,12 @@ test_133d() { local testdir1=$DIR/${tdir}/stats_testdir1 local testdir2=$DIR/${tdir}/stats_testdir2 + mkdir -p $DIR/${tdir} do_facet $SINGLEMDS $LCTL set_param mdt.*.rename_stats=clear - mkdir -p ${testdir1} || error "mkdir failed" - mkdir -p ${testdir2} || error "mkdir failed" + lfs mkdir -i 0 -c 1 ${testdir1} || error "mkdir failed" + lfs mkdir -i 0 -c 1 ${testdir2} || error "mkdir failed" createmany -o $testdir1/test 512 || error "createmany failed" @@ -10563,7 +10565,9 @@ test_133d() { echo "source rename dir size: ${testdir1_size}" echo "target rename dir size: ${testdir2_size}" - local cmd="do_facet $SINGLEMDS $LCTL get_param mdt.*.rename_stats" + local cmd="do_facet $SINGLEMDS $LCTL " + cmd+="get_param mdt.$FSNAME-MDT0000.rename_stats" + eval $cmd || error "$cmd failed" local samedir=$($cmd | grep 'same_dir') local same_sample=$(get_rename_size $testdir1_size) -- 1.8.3.1