summaryrefslogtreecommitdiffstats
path: root/tests/basic/ec/ec.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basic/ec/ec.t')
-rw-r--r--tests/basic/ec/ec.t35
1 files changed, 16 insertions, 19 deletions
diff --git a/tests/basic/ec/ec.t b/tests/basic/ec/ec.t
index 77c6460f11a..cc882771501 100644
--- a/tests/basic/ec/ec.t
+++ b/tests/basic/ec/ec.t
@@ -1,5 +1,6 @@
#!/bin/bash
+. $(dirname $0)/../../traps.rc
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
@@ -11,7 +12,7 @@ function my_getfattr {
}
function get_rep_count {
- v=$(my_getfattr -n trusted.nsr.rep-count $1)
+ v=$(my_getfattr -n trusted.jbr.rep-count $1)
#echo $v > /dev/tty
echo $v
}
@@ -37,7 +38,7 @@ function check_create_write {
}
function check_truncate {
- truncate --size=8192 $tmpdir/truncate
+ truncate -s 8192 $tmpdir/truncate
for b in $*; do
cmp $tmpdir/truncate $b/truncate || return 1
done
@@ -108,7 +109,7 @@ function check_rmdir {
}
function check_setxattr {
- stat $M0/setxattr
+ getfattr -d -m. -e hex $M0/setxattr
for b in $*; do
v=$(my_getfattr -n user.foo $b/setxattr)
if [ "$v" != "ash_nazg_durbatuluk" ]; then
@@ -121,7 +122,7 @@ function check_setxattr {
}
function check_removexattr {
- stat $M0/removexattr
+ getfattr -d -m. -e hex $M0/removexattr
for b in $*; do
my_getfattr -n user.bar $b/removexattr 2> /dev/null
if [ $? -eq 0 ]; then
@@ -155,7 +156,7 @@ function check_perm_file {
cleanup
TEST useradd -o -M -u ${TEST_UID} ${TEST_USER}
-trap "userdel --force ${TEST_USER}" EXIT
+push_trapfunc "userdel --force ${TEST_USER}"
TEST glusterd
TEST pidof glusterd
@@ -172,12 +173,12 @@ TEST $CLI volume start $V0
EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status'
# 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
EXPECT_WITHIN $CHILD_UP_TIMEOUT "10" ec_child_up_count $V0 0
# Create local files for comparisons etc.
-tmpdir=$(mktemp -d)
-trap "rm -rf $tmpdir" EXIT
+tmpdir=$(mktemp -d -t ${0##*/}.XXXXXX)
+push_trapfunc "rm -rf $tmpdir"
TEST create_file $tmpdir/create-write 10
TEST create_file $tmpdir/truncate 10
@@ -200,7 +201,7 @@ sleep 10
# Test create+write
TEST cp $tmpdir/create-write $M0/
# Test truncate
-TEST truncate --size=8192 $M0/truncate
+TEST truncate -s 8192 $M0/truncate
# Test hard link
TEST ln $M0/hard-link-1 $M0/hard-link-2
# Test soft link
@@ -221,13 +222,13 @@ TEST setup_perm_file $M0
sleep 2
# Unmount/remount so that create/write and truncate don't see cached data.
-TEST umount $M0
-TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
+TEST $GFS -s $H0 --volfile-id $V0 $M1
EXPECT_WITHIN $CHILD_UP_TIMEOUT "8" ec_child_up_count $V0 0
# Test create/write and truncate *before* the bricks are brought back.
-TEST check_create_write $M0
-TEST check_truncate $M0
+TEST check_create_write $M1
+TEST check_truncate $M1
# Restart the bricks and allow repair to occur.
TEST $CLI volume start $V0 force
@@ -235,8 +236,8 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status'
EXPECT_WITHIN $CHILD_UP_TIMEOUT "10" ec_child_up_count $V0 0
# Unmount/remount again, same reason as before.
-TEST umount $M0
-TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1
+TEST $GFS -s $H0 --volfile-id $V0 $M0
EXPECT_WITHIN $CHILD_UP_TIMEOUT "10" ec_child_up_count $V0 0
# Make sure everything is as it should be. Most tests check for consistency
@@ -255,8 +256,4 @@ EXPECT_WITHIN $HEAL_TIMEOUT "Y" check_setxattr $B0/${V0}{0..9}
EXPECT_WITHIN $HEAL_TIMEOUT "Y" check_removexattr $B0/${V0}{0..9}
EXPECT_WITHIN $HEAL_TIMEOUT "Y" check_perm_file $B0/${V0}{0..9}
-rm -rf $tmpdir
-userdel --force ${TEST_USER}
-
cleanup
-