From: James Nunez Date: Thu, 31 Oct 2013 19:43:25 +0000 (-0600) Subject: LU-4016 tests: use user and group names in metadata-updates X-Git-Tag: 2.5.51~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5e1db9849b50209b8316333cb495bf822ef513f3 LU-4016 tests: use user and group names in metadata-updates pdsh eats %u passed to stat executed on remote nodes. Avoid this problem by using the user and group names instead of numerical identifiers in metadata-updates ownership checks. Test-Parameters: testlist=metadata-updates Signed-off-by: James Nunez Signed-off-by: Stephen Champion Change-Id: Id0a283d58873bb64772f28cbc28c5a6abad9a48e Reviewed-on: http://review.whamcloud.com/8052 Tested-by: Jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh index 41a1849..cad4473 100755 --- a/lustre/tests/metadata-updates.sh +++ b/lustre/tests/metadata-updates.sh @@ -32,8 +32,8 @@ NEW_MODE=0222 NEW_ATIME="2001-01-01 GMT" NEW_MTIME="2005-05-05 GMT" -test_UID=$(id -u) -test_GID=$(id -g) +test_USER=$(id -u -n) +test_GROUP=$(id -g -n) SUMFILE=$TESTDIR/mdsum @@ -99,21 +99,21 @@ $TRUNCATE \\\$TESTFILE 0" || return ${PIPESTATUS[0]} # check st_uid, st_gid, st_size, st_mode get_stat () { - local attr="$test_UID $test_GID $FILE_SIZE $CURRENT_MODE" + local attr="$test_USER $test_GROUP $FILE_SIZE $CURRENT_MODE" - echo "Checking file(s) attributes ... " + echo "Checking file(s) attributes ... " do_nodesv $NODES_TO_USE "set $TRACE; for HOST in ${HOSTS//,/ } ; do TESTFILE=$TESTDIR/\\\$HOST/$FILE; - tmp=\\\$(stat -c \\\"%u %g %s 0%a\\\" \\\$TESTFILE); + tmp=\\\$(stat -c \\\"%U %G %s 0%a\\\" \\\$TESTFILE); echo \\\"\\\$TESTFILE [ uid gid size mode ] expected : $attr ; got : \\\$tmp \\\"; if [ x\\\"\\\$tmp\\\" != x\\\"$attr\\\" ] ; then echo \\\"Wrong file attributes\\\"; exit 56; fi; done " || return ${PIPESTATUS[0]} - return 0 + return 0 } do_chmod () {