X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Ftest-framework.sh;h=381bacfe20eb0659913015a962f02adcfed11136;hp=d9af277edc28962989c873d83d4e561531496781;hb=f625f670afbe954030ff81f0f8522137d6cdd335;hpb=27c45108721b90ca89a4724294bf76855cad16cf diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d9af277..381bacf 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1193,6 +1193,12 @@ mount_facet() { else set_default_debug_facet $facet + if [[ $facet == mds* ]]; then + do_facet $facet \ + lctl set_param -n mdt.${FSNAME}*.enable_remote_dir=1 \ + 2>/dev/null + fi + label=$(devicelabel ${facet} ${!dev}) [ -z "$label" ] && echo no label for ${!dev} && exit 1 eval export ${facet}_svc=${label} @@ -2671,7 +2677,7 @@ hostlist_expand() { done myList="${myList%* }"; - # We can select an object at a offset in the list + # We can select an object at an offset in the list [ $# -eq 2 ] && { cnt=0 for item in $myList; do @@ -3019,7 +3025,7 @@ ostvdevname() { eval VDEVPTR="";; zfs ) #if $OSTDEVn isn't defined, default is $OSTDEVBASE{n} - # Device formated by zfs + # Device formatted by zfs DEVNAME=OSTDEV$num eval VDEVPTR=${!DEVNAME:=${OSTDEVBASE}${num}};; * ) @@ -3029,7 +3035,7 @@ ostvdevname() { echo -n $VDEVPTR } -# Logical device formated for lustre +# Logical device formatted for lustre mdsdevname() { local num=$1 local DEVNAME=MDSDEV$num @@ -3063,7 +3069,7 @@ mdsvdevname() { eval VDEVPTR="";; zfs ) # if $MDSDEVn isn't defined, default is $MDSDEVBASE{n} - # Device formated by ZFS + # Device formatted by ZFS local DEVNAME=MDSDEV$num eval VDEVPTR=${!DEVNAME:=${MDSDEVBASE}${num}};; * ) @@ -6882,62 +6888,46 @@ generate_logname() { # make directory on different MDTs test_mkdir() { - local option - local parent - local child local path local p_option - local option2 local stripe_count=2 - local rc=0 - - case $# in - 1) path=$1;; - 2) option=$1 - path=$2;; - 3) option=$1 - option2=$2 - path=$3;; - *) error "Only creating single directory is supported";; - esac - - child=$(basename $path) - parent=$(dirname $path) - - if [ "$option" == "-p" -o "$option2" == "-p" ]; then - if [ -d $parent/$child ]; then - return $rc - fi - p_option="-p" - fi + local stripe_index=-1 + local OPTIND=1 + + while getopts "c:i:p" opt; do + case $opt in + c) stripe_count=$OPTARG;; + i) stripe_index=$OPTARG;; + p) p_option="-p";; + \?) error "only support -i -c -p";; + esac + done - if [ "${option:0:2}" == "-c" ]; then - stripe_count=$(echo $option | sed 's/^-c//') - fi + shift $((OPTIND - 1)) + [ $# -eq 1 ] || error "Only creating single directory is supported" + path="$*" - if [ "${option2:0:2}" == "-c" ]; then - stripe_count=$(echo $option2 | sed 's/^-c//') - fi + if [ "$p_option" == "-p" ]; then + local parent=$(dirname $path) - if [ ! -d ${parent} ]; then - if [ "$p_option" == "-p" ]; then - mkdir -p ${parent} - else - return 1 - fi + [ -d $path ] && return 0 + [ ! -d ${parent} ] && mkdir -p ${parent} fi if [ $MDSCOUNT -le 1 ]; then - mkdir $p_option $parent/$child || rc=$? + mkdir $path else - local mdt_idx=$($LFS getstripe -M $parent) local test_num=$(echo $testnum | sed -e 's/[^0-9]*//g') + local mdt_index - mdt_idx=$((test_num % MDSCOUNT)) - echo "striped dir -i$mdt_idx -c$stripe_count $path" - $LFS setdirstripe -i$mdt_idx -c$stripe_count $path || rc=$? + if [ $stripe_index -eq -1 ]; then + mdt_index=$((test_num % MDSCOUNT)) + else + mdt_index=$stripe_index + fi + echo "striped dir -i$mdt_index -c$stripe_count $path" + $LFS setdirstripe -i$mdt_index -c$stripe_count $path fi - return $rc } # find the smallest and not in use file descriptor