X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fmetadata-updates.sh;h=41a184931d0062c4b78ff5ab4d01a45f752b468b;hb=3e1cff73c9abe513cb691ff0e81da332a6434a94;hp=c93d0feca17a76751357bdab39a73641f326f2d6;hpb=a29c0877a076ea2e89727ed271c092441c99b478;p=fs%2Flustre-release.git diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh index c93d0fe..41a1849 100755 --- a/lustre/tests/metadata-updates.sh +++ b/lustre/tests/metadata-updates.sh @@ -20,6 +20,11 @@ NODES_TO_USE=${NODES_TO_USE:-$CLIENTS} [ -z $CLIENTS ] && NODES_TO_USE=$(hostname) +# hostname could differ from a network interface +# configured for NODES_TO_USE, bug 23961 +# the test dir on each host is created based on `hostname` of this host +HOSTS=$(comma_list $(do_nodes $NODES_TO_USE "echo \\\$(hostname)")) + FILE=testfile FILE_SIZE=1024 CURRENT_MODE=0644 @@ -86,7 +91,7 @@ do_truncate () { do_nodes $NODES_TO_USE "set $TRACE; TESTFILE=$TESTDIR/\\\$(hostname)/$FILE; -truncate \\\$TESTFILE 0" || return ${PIPESTATUS[0]} +$TRUNCATE \\\$TESTFILE 0" || return ${PIPESTATUS[0]} FILE_SIZE=0 return 0 @@ -99,7 +104,7 @@ get_stat () { echo "Checking file(s) attributes ... " do_nodesv $NODES_TO_USE "set $TRACE; -for HOST in ${NODES_TO_USE//,/ } ; do +for HOST in ${HOSTS//,/ } ; do TESTFILE=$TESTDIR/\\\$HOST/$FILE; tmp=\\\$(stat -c \\\"%u %g %s 0%a\\\" \\\$TESTFILE); echo \\\"\\\$TESTFILE [ uid gid size mode ] expected : $attr ; got : \\\$tmp \\\"; @@ -142,7 +147,7 @@ do_check_timestamps () { echo "Checking atime, mtime ... " do_nodesv $NODES_TO_USE "set $TRACE; -for HOST in ${NODES_TO_USE//,/ } ; do +for HOST in ${HOSTS//,/ } ; do TESTFILE=$TESTDIR/\\\$HOST/$FILE; tmp=\\\$(stat -c \\\"%X %Y\\\" \\\$TESTFILE); if [ x\\\"\\\$tmp\\\" != x\\\"$times\\\" ] ; then @@ -172,7 +177,7 @@ check_dir_contents () { echo "Checking dir contents ... (should exist files : f$num_files ... f$NUM_FILES) ... " do_nodes $NODES_TO_USE "set $TRACE; -for HOST in ${NODES_TO_USE//,/ } ; do +for HOST in ${HOSTS//,/ } ; do DIR=$TESTDIR/\\\$HOST; for i in \\\$(seq $NUM_FILES -1 $num_files) ; do if ! [ -f \\\$DIR/f\\\$i ] ; then @@ -246,17 +251,18 @@ check_dir_contents $(($NUM_FILES / 2 + 1)) || # "write_disjoint" test echo "Part 5. write_disjoint test: see lustre/tests/mpi/write_disjoint.c for details" if [ -f "$WRITE_DISJOINT" ]; then - set $TRACE - MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} - generate_machine_file $NODES_TO_USE $MACHINEFILE - mpi_run -np $(get_node_count ${NODES_TO_USE//,/ }) -machinefile $MACHINEFILE \ - $WRITE_DISJOINT -f $WRITE_DISJOINT_FILE -n $NUMLOOPS || STATUS=1 + set $TRACE + MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} + generate_machine_file $NODES_TO_USE $MACHINEFILE + mpi_run -np $(get_node_count ${NODES_TO_USE//,/ }) \ + ${MACHINEFILE_OPTION} $MACHINEFILE $WRITE_DISJOINT \ + -f $WRITE_DISJOINT_FILE -n $NUMLOOPS || STATUS=1 else skip_env "$0 : write_disjoint not found " fi -equals_msg `basename $0`: test complete, cleaning up +complete $SECONDS rm -rf $TESTDIR rm -f $MACHINEFILE check_and_cleanup_lustre -exit $STATUS +exit_status