diff options
author | Harshavardhana <harsha@harshavardhana.net> | 2014-08-23 02:14:36 -0700 |
---|---|---|
committer | Harshavardhana <harsha@harshavardhana.net> | 2014-09-05 10:04:20 -0700 |
commit | fd500d4396f910e4cf759e0fffa4daf4ed24745a (patch) | |
tree | 2e52c1b64659efc3cf98fed31a8a2fc6f8a4bc26 /tests/bugs | |
parent | 88159becd90d40323ecfc24cf40813538c9204cc (diff) | |
download | glusterfs-fd500d4396f910e4cf759e0fffa4daf4ed24745a.tar.gz glusterfs-fd500d4396f910e4cf759e0fffa4daf4ed24745a.tar.xz glusterfs-fd500d4396f910e4cf759e0fffa4daf4ed24745a.zip |
porting: Provide setfattr/getfattr implementation
- Use 'getfattr' properly avoid redundant options during xattr query
- Untabify certain parts of tests (remove tabs)
- Avoid backtick evaluation for certain values to make code more portable.
- Use awk on FreeBSD/Darwin, since 'wc' implementation is broken and adds
spurious spaces in its output.
Change-Id: I7dcc0b70874e43b4cda8c306ed18a31b7a3f990a
BUG: 1131713
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8520
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org>
Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/949327.t | 2 | ||||
-rw-r--r-- | tests/bugs/bug-1002207.t | 2 | ||||
-rw-r--r-- | tests/bugs/bug-1111490.t | 6 | ||||
-rw-r--r-- | tests/bugs/bug-765380.t | 8 | ||||
-rw-r--r-- | tests/bugs/bug-856455.t | 10 | ||||
-rw-r--r-- | tests/bugs/bug-906646.t | 6 | ||||
-rwxr-xr-x | tests/bugs/bug-924265.t | 2 |
7 files changed, 18 insertions, 18 deletions
diff --git a/tests/bugs/949327.t b/tests/bugs/949327.t index 7b0c5c51a8..b8ac995f24 100644 --- a/tests/bugs/949327.t +++ b/tests/bugs/949327.t @@ -7,7 +7,7 @@ cleanup; function tmp_file_count() { -echo $(ls -lh /tmp/tmp.* | wc -l) + echo $(ls -lh /tmp/tmp.* 2>/dev/null | wc -l) } diff --git a/tests/bugs/bug-1002207.t b/tests/bugs/bug-1002207.t index 4fad2ff156..c67738bd7e 100644 --- a/tests/bugs/bug-1002207.t +++ b/tests/bugs/bug-1002207.t @@ -26,7 +26,7 @@ function xattr_query_check() local path=$1 local xa_name=$2 - local ret=`getfattr -m . -n $xa_name $path 2>&1 | grep -o "$xa_name: No such attribute" | wc -l` + local ret=$(getfattr -n $xa_name $path 2>&1 | grep -o "$xa_name: No such attribute" | wc -l) echo $ret } diff --git a/tests/bugs/bug-1111490.t b/tests/bugs/bug-1111490.t index 7b13c8798e..289ac70b4a 100644 --- a/tests/bugs/bug-1111490.t +++ b/tests/bugs/bug-1111490.t @@ -12,19 +12,19 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}0 TEST $CLI volume start $V0 # mount with auxillary gfid mount -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 --aux-gfid-mount +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 --aux-gfid-mount # create file with specific gfid uuid=`uuidgen` EXPECT "File creation OK" gfid-access.py $M0 ROOT file0 $uuid file # check gfid -EXPECT "$uuid" getfattr -m . --only-values -n glusterfs.gfid.string $M0/file0 +EXPECT "$uuid" getfattr --only-values -n glusterfs.gfid.string $M0/file0 # unmount and mount again so as to start with a fresh inode table # or use another mount... TEST umount $M0 -TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 --aux-gfid-mount +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 --aux-gfid-mount # touch the file again (gfid-access.py handles errno) EXPECT "File creation OK" gfid-access.py $M0 ROOT file0 $uuid file diff --git a/tests/bugs/bug-765380.t b/tests/bugs/bug-765380.t index 65bc6597ee..cf580c4a81 100644 --- a/tests/bugs/bug-765380.t +++ b/tests/bugs/bug-765380.t @@ -13,15 +13,15 @@ TEST $CLI volume create $V0 replica $REPLICA $H0:$B0/${V0}00 $H0:$B0/${V0}01 $H0 TEST $CLI volume start $V0 ## Mount FUSE with caching disabled -TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; +TEST $GFS -s $H0 --volfile-id $V0 $M0; function count_hostname_or_uuid_from_pathinfo() { - pathinfo=`getfattr -m . -n trusted.glusterfs.pathinfo $M0/f00f` + pathinfo=$(getfattr -n trusted.glusterfs.pathinfo $M0/f00f) echo $pathinfo | grep -o $1 | wc -l } -touch $M0/f00f +TEST touch $M0/f00f EXPECT $REPLICA count_hostname_or_uuid_from_pathinfo $H0 @@ -31,7 +31,7 @@ TEST $CLI volume set $V0 node-uuid-pathinfo on # do not expext hostname as part of the pathinfo string EXPECT 0 count_hostname_or_uuid_from_pathinfo $H0 -uuid=`grep UUID $GLUSTERD_WORKDIR/glusterd.info | cut -f2 -d=` +uuid=$(grep UUID $GLUSTERD_WORKDIR/glusterd.info | cut -f2 -d=) # ... but expect the uuid $REPLICA times EXPECT $REPLICA count_hostname_or_uuid_from_pathinfo $uuid diff --git a/tests/bugs/bug-856455.t b/tests/bugs/bug-856455.t index 3e314aa5bb..0e79d9fa1c 100644 --- a/tests/bugs/bug-856455.t +++ b/tests/bugs/bug-856455.t @@ -13,20 +13,20 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}0 $H0:$B0/${V0}1 $H0:$B0/${V0}2 TEST $CLI volume start $V0 ## Mount FUSE with caching disabled -TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; +TEST $GFS -s $H0 --volfile-id $V0 $M0; function query_pathinfo() { local path=$1; local retval; - local pathinfo=`getfattr -m . -n trusted.glusterfs.pathinfo $path`; - retval=`echo $pathinfo | grep -o 'POSIX' | wc -l`; + local pathinfo=$(getfattr -n trusted.glusterfs.pathinfo $path); + retval=$(echo $pathinfo | grep -o 'POSIX' | wc -l); echo $retval } -touch $M0/f00f; -mkdir $M0/f00d; +TEST touch $M0/f00f; +TEST mkdir $M0/f00d; # verify pathinfo for a file and directory EXPECT 1 query_pathinfo $M0/f00f; diff --git a/tests/bugs/bug-906646.t b/tests/bugs/bug-906646.t index 754f193beb..b11bb08bdd 100644 --- a/tests/bugs/bug-906646.t +++ b/tests/bugs/bug-906646.t @@ -17,14 +17,14 @@ TEST $CLI volume set $V0 cluster.self-heal-daemon off TEST $CLI volume set $V0 cluster.background-self-heal-count 0 ## Mount FUSE with caching disabled -TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; +TEST $GFS -s $H0 --volfile-id $V0 $M0; function xattr_query_check() { local path=$1 local xa_name=$2 - local ret=`getfattr -m . -n $xa_name $path 2>&1 | grep -o "$xa_name: No such attribute" | wc -l` + local ret=$(getfattr -n $xa_name $path 2>&1 | grep -o "$xa_name: No such attribute" | wc -l) echo $ret } @@ -50,7 +50,7 @@ function remove_xattr() f=f00f pth=$M0/$f -touch $pth +TEST touch $pth # fetch backend paths backend_paths=`get_backend_paths $pth` diff --git a/tests/bugs/bug-924265.t b/tests/bugs/bug-924265.t index b08c13fddc..51eda7f6e9 100755 --- a/tests/bugs/bug-924265.t +++ b/tests/bugs/bug-924265.t @@ -8,7 +8,7 @@ # We only care about the exit code, so keep it quiet. function silent_getfattr { - getfattr $* &> /dev/null + getfattr $* &> /dev/null } cleanup |