diff options
author | Sunil Kumar Acharya <sheggodu@redhat.com> | 2019-11-14 09:24:26 +0530 |
---|---|---|
committer | Sanju Rakonde <sanjurakonde@review.gluster.org> | 2020-01-24 06:34:08 +0000 |
commit | 7cac693bba33cbba35a6d0bbe98d8ad5551d2134 (patch) | |
tree | 154d758a687fb8dbebd9dfd96b371b9d7b32565b /tests | |
parent | 7dc4122b84c93cfa6355002fa651a806706e4990 (diff) |
tests: fix test failures for nfsnobody user and group
'nfsnobody' user and group is merged with
'nobody' user and group in RHEL8.
Tests are modified to use appropriate user and group.
BUG: 1756900
Change-Id: I59863da2262283b00b1cb417d3652ebe29a36407
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/bugs/glusterfs-server/bug-887145.t | 14 | ||||
-rwxr-xr-x | tests/bugs/rpc/bug-954057.t | 10 |
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/bugs/glusterfs-server/bug-887145.t b/tests/bugs/glusterfs-server/bug-887145.t index 82f7ccacfc1..db2cf3c050b 100755 --- a/tests/bugs/glusterfs-server/bug-887145.t +++ b/tests/bugs/glusterfs-server/bug-887145.t @@ -29,7 +29,15 @@ chmod 600 $M0/file; TEST mount_nfs $H0:/$V0 $N0 nolock; -chown -R nfsnobody:nfsnobody $M0/dir; +grep nfsnobody /etc/passwd > /dev/null +if [ $? -eq 1 ]; then +usr=nobody +grp=nobody +else +usr=nfsnobody +grp=nfsnobody +fi +chown -R $usr:$grp $M0/dir; chown -R tmp_user:tmp_user $M0/other; TEST $CLI volume set $V0 server.root-squash on; @@ -38,7 +46,7 @@ EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; # create files and directories in the root of the glusterfs and nfs mount # which is owned by root and hence the right behavior is getting EACCESS -# as the fops are executed as nfsnobody. +# as the fops are executed as nfsnobody/nobody. touch $M0/foo 2>/dev/null; TEST [ $? -ne 0 ] touch $N0/foo 2>/dev/null; @@ -61,7 +69,7 @@ cat $N0/passwd 1>/dev/null; TEST [ $? -eq 0 ] # create files and directories should succeed as the fops are being executed -# inside the directory owned by nfsnobody +# inside the directory owned by nfsnobody/nobody TEST touch $M0/dir/file; TEST touch $N0/dir/foo; TEST mkdir $M0/dir/new; diff --git a/tests/bugs/rpc/bug-954057.t b/tests/bugs/rpc/bug-954057.t index 65af274f09d..40acdc2fdc7 100755 --- a/tests/bugs/rpc/bug-954057.t +++ b/tests/bugs/rpc/bug-954057.t @@ -25,7 +25,15 @@ TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 TEST mkdir $M0/dir TEST mkdir $M0/nobody -TEST chown nfsnobody:nfsnobody $M0/nobody +grep nfsnobody /etc/passwd > /dev/null +if [ $? -eq 1 ]; then +usr=nobody +grp=nobody +else +usr=nfsnobody +grp=nfsnobody +fi +TEST chown $usr:$grp $M0/nobody TEST `echo "file" >> $M0/file` TEST cp $M0/file $M0/new TEST chmod 700 $M0/new |