summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-02-19 17:54:03 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-02-20 04:08:37 -0800
commitdf9f1cd96854c82338c62897d788319b560e43ad (patch)
tree5cfb32c9bae36b9acbb19058656c33c479b88093 /tests/bugs
parent9d842f965655bf70c643b4541844e83bc4e74190 (diff)
Fix for test usst.t and bug-1167580-set-proper-uid-and-gid-during-nfs-access.t
testcase usst.t and bug-1167580-set-proper-uid-and-gid-during-nfs-access.t uses below method to generate random string cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 8 | head -n 1 Doing a cat on /dev/urandom can consume more CPU usage. Change to: uuidgen | tr -dc 'a-zA-Z' | head -c 8 Change-Id: I9cb562557ae860026fb5e140ed9b5e297b4428d9 BUG: 1163543 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9703 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t11
1 files changed, 5 insertions, 6 deletions
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 $?