diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2014-08-07 17:01:18 +0200 |
---|---|---|
committer | Harshavardhana <harsha@harshavardhana.net> | 2014-08-18 01:09:39 -0700 |
commit | ba0f31b2a5c8bd35f99b1ba2a74c81a2c2ded200 (patch) | |
tree | 572eb19fb9cba596469fc529556c4708d1e0788c /tests/bugs/bug-884597.t | |
parent | c80b5b915a6bf2c6506d789f8ab6f0dcbf3dc617 (diff) |
Regression test portability: stat
Linux uses stat -c, stat --printf= or stat --printf
NetBSD uses stat -f with different format strings. This change set
changes all stat usage to stat -c and introduce a shell stat()
fonction to perform the format string translation.
BUG: 764655
Change-Id: I024fca7c1b736b053f5888cbf21da0a72489ef63
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8424
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Tested-by: Harshavardhana <harsha@harshavardhana.net>
Diffstat (limited to 'tests/bugs/bug-884597.t')
-rwxr-xr-x | tests/bugs/bug-884597.t | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/bugs/bug-884597.t b/tests/bugs/bug-884597.t index a0540b628a0..2d2bb745e52 100755 --- a/tests/bugs/bug-884597.t +++ b/tests/bugs/bug-884597.t @@ -61,8 +61,8 @@ get_hashed_brick $i cached=$? # check if uid/gid on linkfile is created with correct uid/gid -BACKEND_UID=`stat --printf=%u $B0/${V0}$cached/$i`; -BACKEND_GID=`stat --printf=%g $B0/${V0}$cached/$i`; +BACKEND_UID=`stat -c %u $B0/${V0}$cached/$i`; +BACKEND_GID=`stat -c %g $B0/${V0}$cached/$i`; EXPECT "0" uid_gid_compare $NEW_UID $NEW_GID $BACKEND_UID $BACKEND_GID @@ -79,8 +79,8 @@ TEST glusterfs --attribute-timeout=0 --entry-timeout=0 -s $H0 --volfile-id $V0 $ lookup=`ls -l $M0/$i 2>/dev/null` # check if uid/gid on linkfile is created with correct uid/gid -BACKEND_UID=`stat --printf=%u $B0/${V0}$cached/$i`; -BACKEND_GID=`stat --printf=%g $B0/${V0}$cached/$i`; +BACKEND_UID=`stat -c %u $B0/${V0}$cached/$i`; +BACKEND_GID=`stat -c %g $B0/${V0}$cached/$i`; EXPECT "0" uid_gid_compare $NEW_UID $NEW_GID $BACKEND_UID $BACKEND_GID # create hardlinks. Make sure a linkfile gets created @@ -117,8 +117,8 @@ get_hashed_brick link$i cached=$? # check if uid/gid on linkfile is created with correct uid/gid -BACKEND_UID=`stat --printf=%u $B0/${V0}$cached/link$i`; -BACKEND_GID=`stat --printf=%g $B0/${V0}$cached/link$i`; +BACKEND_UID=`stat -c %u $B0/${V0}$cached/link$i`; +BACKEND_GID=`stat -c %g $B0/${V0}$cached/link$i`; EXPECT "0" uid_gid_compare $NEW_UID $NEW_GID $BACKEND_UID $BACKEND_GID @@ -166,8 +166,8 @@ get_hashed_brick user_file$i cached=$? # check if uid/gid on linkfile is created with correct uid/gid -BACKEND_UID=`stat --printf=%u $B0/${V0}$cached/user_file$i`; -BACKEND_GID=`stat --printf=%g $B0/${V0}$cached/user_file$i`; +BACKEND_UID=`stat -c %u $B0/${V0}$cached/user_file$i`; +BACKEND_GID=`stat -c %g $B0/${V0}$cached/user_file$i`; EXPECT "0" uid_gid_compare $NEW_UID $NEW_GID $BACKEND_UID $BACKEND_GID cleanup; |