diff options
-rw-r--r-- | tests/basic/uss.t | 2 | ||||
-rw-r--r-- | tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/basic/uss.t b/tests/basic/uss.t index 2e4286860cf..2de66a97f48 100644 --- a/tests/basic/uss.t +++ b/tests/basic/uss.t @@ -65,7 +65,7 @@ TEST $CLI snapshot create snap4 $V0; ## Test that features.uss takes only options enable/disable and throw error for ## any other argument. for i in {1..10}; do - RANDOM_STRING=`cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 8 | head -n 1` + RANDOM_STRING=$(uuidgen | tr -dc 'a-zA-Z' | head -c 8) TEST_IN_LOOP ! $CLI volume set $V0 features.uss $RANDOM_STRING done diff --git a/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t b/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t index b15d3a85151..5bea7a71306 100644 --- a/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t +++ b/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t @@ -38,12 +38,11 @@ function check_if_permitted () { # Create a directory in /tmp to specify which directory to make # as home directory for user -home_dir=$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 8 | head -n 1) -home_dir="/tmp/bug-1167580-$home_dir" -mkdir $home_dir +home_dir=$(mktemp -d) +chmod 777 $home_dir function get_new_user() { - local temp=$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 8 | head -n 1) + local temp=$(uuidgen | tr -dc 'a-zA-Z' | head -c 8) id $temp if [ "$?" == "0" ] then @@ -59,9 +58,9 @@ function create_user() { if [ "$group" == "" ] then - useradd -d $home_dir/$user $user + /usr/sbin/useradd -d $home_dir/$user $user else - useradd -d $home_dir/$user -G $group $user + /usr/sbin/useradd -d $home_dir/$user -G $group $user fi return $? |