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 <james.a.nunez@intel.com>
Signed-off-by: Stephen Champion <schamp@sgi.com>
Change-Id: Id0a283d58873bb64772f28cbc28c5a6abad9a48e
Reviewed-on: http://review.whamcloud.com/8052
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
NEW_ATIME="2001-01-01 GMT"
NEW_MTIME="2005-05-05 GMT"
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)
# check st_uid, st_gid, st_size, st_mode
get_stat () {
# 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;
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]}
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]}