From 61e2111852fd6923947b1b0f9731c2a30c8dfb44 Mon Sep 17 00:00:00 2001 From: Minh Diep Date: Fri, 15 Dec 2017 12:48:58 -0800 Subject: [PATCH] LU-10327 test: use nogroup instead of nobody In Ubuntu, there isn't any nobody group Change-Id: I2d4607b3d1384d2d619dd9640363533f92397356 Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/30559 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/lustre-rsync-test.sh | 9 ++++++++- lustre/tests/sanity-hsm.sh | 15 +++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lustre/tests/lustre-rsync-test.sh b/lustre/tests/lustre-rsync-test.sh index b3fe03d..a67447e3b 100644 --- a/lustre/tests/lustre-rsync-test.sh +++ b/lustre/tests/lustre-rsync-test.sh @@ -38,6 +38,13 @@ check_and_setup_lustre DIR=${DIR:-$MOUNT} assert_DIR +if getent group nobody; then + GROUP=nobody +elif getent group nogroup; then + GROUP=nogroup +else + error "No generic nobody group" +fi build_test_filter @@ -196,7 +203,7 @@ test_1() { # Set attributes chmod 000 $DIR/$tdir/d2/file3 - chown nobody:nobody $DIR/$tdir/d2/file3 + chown nobody:$GROUP $DIR/$tdir/d2/file3 # Set xattrs if [[ "$xattr" != "no" ]]; then diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index eadeba3..d7ab2be 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -43,6 +43,13 @@ if [[ $UID -eq 0 && $RUNAS_ID -eq 0 ]]; then skip_env "\$RUNAS_ID set to 0, but \$UID is also 0!" && exit fi check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS +if getent group nobody; then + GROUP=nobody +elif getent group nogroup; then + GROUP=nogroup +else + error "No generic nobody group" +fi build_test_filter @@ -2234,8 +2241,8 @@ test_24c() { # User. create_small_file $file - chown $RUNAS_ID:nobody $file || - error "cannot chown '$file' to '$RUNAS_ID:nobody'" + chown $RUNAS_ID:$GROUP $file || + error "cannot chown '$file' to '$RUNAS_ID:$GROUP'" $RUNAS $LFS hsm_$action $file && error "$action by user should fail" @@ -2258,8 +2265,8 @@ test_24c() { # Other. create_small_file $file - chown nobody:nobody $file || - error "cannot chown '$file' to 'nobody:nobody'" + chown nobody:$GROUP $file || + error "cannot chown '$file' to 'nobody:$GROUP'" $RUNAS $LFS hsm_$action $file && error "$action by other should fail" -- 1.8.3.1