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/basic | |
parent | 88159becd90d40323ecfc24cf40813538c9204cc (diff) |
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/basic')
-rw-r--r-- | tests/basic/ec/ec.t | 4 | ||||
-rw-r--r-- | tests/basic/ec/self-heal.t | 2 | ||||
-rw-r--r-- | tests/basic/gfid-access.t | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/tests/basic/ec/ec.t b/tests/basic/ec/ec.t index 569f4c7098a..b4ce338231c 100644 --- a/tests/basic/ec/ec.t +++ b/tests/basic/ec/ec.t @@ -226,7 +226,7 @@ EXPECT_WITHIN 5 "Y" check_setxattr $B0/${V0}{0..9} EXPECT_WITHIN 5 "Y" check_removexattr $B0/${V0}{0..9} EXPECT_WITHIN 5 "Y" check_perm_file $B0/${V0}{0..9} -rm -rf $tmpdir -userdel --force ${TEST_USER} +TEST rm -rf $tmpdir +TEST userdel --force ${TEST_USER} cleanup diff --git a/tests/basic/ec/self-heal.t b/tests/basic/ec/self-heal.t index ba28b7d82f5..524c11d2220 100644 --- a/tests/basic/ec/self-heal.t +++ b/tests/basic/ec/self-heal.t @@ -118,6 +118,6 @@ EXPECT "2" stat -c "%h" test4 EXPECT_WITHIN 5 "3" stat -c "%h" ${brick[0]}/test4 EXPECT_WITHIN 5 "3" stat -c "%h" ${brick[1]}/test4 -rm -rf $tmp +TEST rm -rf $tmp cleanup diff --git a/tests/basic/gfid-access.t b/tests/basic/gfid-access.t index a2965cc1452..f83eb6d47ee 100644 --- a/tests/basic/gfid-access.t +++ b/tests/basic/gfid-access.t @@ -17,8 +17,8 @@ b_gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $B0/${V0}0/b)) #Operations on Directory TEST setfattr -n trusted.abc -v abc $M0/a -EXPECT "abc" echo $(getfattr -n trusted.abc $M0/a) -EXPECT "abc" echo $(getfattr -n trusted.abc $M0/.gfid/$a_gfid_str) +EXPECT "abc" echo $(getfattr -n trusted.abc --only-values $M0/a) +EXPECT "abc" echo $(getfattr -n trusted.abc --only-values $M0/.gfid/$a_gfid_str) TEST setfattr -x trusted.abc $M0/a TEST ! getfattr -n trusted.abc $M0/a TEST ! getfattr -n trusted.abc $M0/.gfid/$a_gfid_str @@ -27,8 +27,8 @@ EXPECT "777" stat -c "%a" $M0/a EXPECT "777" stat -c "%a" $M0/.gfid/$a_gfid_str TEST setfattr -n trusted.abc -v def $M0/.gfid/$a_gfid_str -EXPECT "def" echo $(getfattr -n trusted.abc $M0/a) -EXPECT "def" echo $(getfattr -n trusted.abc $M0/.gfid/$a_gfid_str) +EXPECT "def" echo $(getfattr -n trusted.abc --only-values $M0/a) +EXPECT "def" echo $(getfattr -n trusted.abc --only-values $M0/.gfid/$a_gfid_str) TEST setfattr -x trusted.abc $M0/.gfid/$a_gfid_str TEST ! getfattr -n trusted.abc $M0/a TEST ! getfattr -n trusted.abc $M0/.gfid/$a_gfid_str @@ -56,8 +56,8 @@ TEST ! mknod $M0/.gfid/b b 0 0 #Operations on File TEST setfattr -n trusted.abc -v abc $M0/b -EXPECT "abc" echo $(getfattr -n trusted.abc $M0/b) -EXPECT "abc" echo $(getfattr -n trusted.abc $M0/.gfid/$b_gfid_str) +EXPECT "abc" echo $(getfattr -n trusted.abc --only-values $M0/b) +EXPECT "abc" echo $(getfattr -n trusted.abc --only-values $M0/.gfid/$b_gfid_str) TEST setfattr -x trusted.abc $M0/b TEST ! getfattr -n trusted.abc $M0/b TEST ! getfattr -n trusted.abc $M0/.gfid/$b_gfid_str @@ -66,8 +66,8 @@ EXPECT "777" stat -c "%a" $M0/b EXPECT "777" stat -c "%a" $M0/.gfid/$b_gfid_str TEST setfattr -n trusted.abc -v def $M0/.gfid/$b_gfid_str -EXPECT "def" echo $(getfattr -n trusted.abc $M0/b) -EXPECT "def" echo $(getfattr -n trusted.abc $M0/.gfid/$b_gfid_str) +EXPECT "def" echo $(getfattr -n trusted.abc --only-values $M0/b) +EXPECT "def" echo $(getfattr -n trusted.abc --only-values $M0/.gfid/$b_gfid_str) TEST setfattr -x trusted.abc $M0/.gfid/$b_gfid_str TEST ! getfattr -n trusted.abc $M0/b TEST ! getfattr -n trusted.abc $M0/.gfid/$b_gfid_str |