From 214bb48cd628441a77e97ffba409bfc5ad4e501b Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Thu, 1 Nov 2012 13:51:13 -0400 Subject: [PATCH] LU-2188 tests: Fix assumptions in test 133d The test assumed that with 512 files in a directory, the inode sizes would be different in the two test directories. This is not the case on zfs which caused the get_rename_size() function to return multiple values. This change adds a argument to specify which stat is pulled from rename_stats, and doesn't rely on the sizes being different. Signed-off-by: Nathaniel Clark Change-Id: I568ec95bd7f0613caf96101055a392ea5762cd2d Reviewed-on: http://review.whamcloud.com/4438 Reviewed-by: wangdi Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 7f9a65f..d015a4c 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1,4 +1,5 @@ #!/bin/bash +# -*- tab-width: 4; indent-tabs-mode: t; -*- # # Run select tests by setting ONLY, or as arguments to the script. # Skip specific tests by setting EXCEPT. @@ -7731,8 +7732,10 @@ size_in_KMGT() { get_rename_size() { local size=$1 + local context=${2:-.} local sample=$(do_facet $SINGLEMDS $LCTL get_param mdt.*.rename_stats | - awk '/ '${size}'/ {print $4}' | sed -e "s/,//g") + grep -A1 $context | + awk '/ '${size}'/ {print $4}' | sed -e "s/,//g") echo $sample } @@ -7798,8 +7801,8 @@ test_133d() { eval $cmd || error "$cmd failed" local crossdir=$($cmd | grep 'crossdir') - local src_sample=$(get_rename_size $testdir1_size) - local tgt_sample=$(get_rename_size $testdir2_size) + local src_sample=$(get_rename_size $testdir1_size crossdir_src) + local tgt_sample=$(get_rename_size $testdir2_size crossdir_tgt) [ -z "$crossdir" ] && error "crossdir_rename_size count error" [ "$src_sample" -eq 1 ] || error "crossdir_rename_size error $src_sample" [ "$tgt_sample" -eq 1 ] || error "crossdir_rename_size error $tgt_sample" -- 1.8.3.1