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 <nathaniel.l.clark@intel.com>
Change-Id: I568ec95bd7f0613caf96101055a392ea5762cd2d
Reviewed-on: http://review.whamcloud.com/4438
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
+# -*- 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.
#
# Run select tests by setting ONLY, or as arguments to the script.
# Skip specific tests by setting EXCEPT.
get_rename_size() {
local size=$1
get_rename_size() {
local size=$1
local sample=$(do_facet $SINGLEMDS $LCTL get_param mdt.*.rename_stats |
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")
eval $cmd || error "$cmd failed"
local crossdir=$($cmd | grep 'crossdir')
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"
[ -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"