diff options
Diffstat (limited to 'tests/bugs/distribute')
-rwxr-xr-x | tests/bugs/distribute/bug-1117851.t | 101 | ||||
-rw-r--r-- | tests/bugs/distribute/bug-1122443.t | 60 | ||||
-rw-r--r-- | tests/bugs/distribute/bug-1600379.t | 54 | ||||
-rwxr-xr-x | tests/bugs/distribute/issue-1327.t | 33 |
4 files changed, 87 insertions, 161 deletions
diff --git a/tests/bugs/distribute/bug-1117851.t b/tests/bugs/distribute/bug-1117851.t deleted file mode 100755 index 62cb6b66ab4..00000000000 --- a/tests/bugs/distribute/bug-1117851.t +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash - -SCRIPT_TIMEOUT=250 - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -create_files () { - for i in {1..1000}; do - orig=$(printf %s/abc%04d $1 $i) - real=$(printf %s/src%04d $1 $i) - # Make sure lots of these have linkfiles. - echo "This is file $i" > $orig - mv $orig $real - done - sync -} - -move_files_inner () { - sfile=$M0/status_$(basename $1) - for i in {1..1000}; do - src=$(printf %s/src%04d $1 $i) - dst=$(printf %s/dst%04d $1 $i) - mv $src $dst 2> /dev/null - done - echo "done" > $sfile -} - -move_files () { - #Create the status file here to prevent spurious failures - #caused by the file not being created in time by the - #background process - sfile=$M0/status_$(basename $1) - echo "running" > $sfile - move_files_inner $* & -} - -check_files () { - errors=0 - for i in {1..1000}; do - if [ ! -f $(printf %s/dst%04d $1 $i) ]; then - if [ -f $(printf %s/src%04d $1 $i) ]; then - echo "file $i didnt get moved" > /dev/stderr - else - echo "file $i is MISSING" > /dev/stderr - errors=$((errors+1)) - fi - fi - done - if [ $((errors)) != 0 ]; then - : ls -l $1 > /dev/stderr - fi - return $errors -} - -cleanup; - -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info; - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4,5,6}; - -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT '6' brick_count $V0 - -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Mount FUSE with caching disabled (read-write) -TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; - -TEST create_files $M0 - -## Mount FUSE with caching disabled (read-write) again -TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M1; - -TEST move_files $M0 -TEST move_files $M1 - -# It's regrettable that renaming 1000 files might take more than 30 seconds, -# but on our test systems sometimes it does, so double the time from what we'd -# use otherwise. There still seem to be some spurious failures, 1 in 20 when -# this does not complete, added an additional 60 seconds to take false reports -# out of the system, during test runs, especially on slower test systems. -EXPECT_WITHIN 120 "done" cat $M0/status_0 -EXPECT_WITHIN 120 "done" cat $M1/status_1 - -EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 -EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1 -TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0; -TEST check_files $M0 - -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; diff --git a/tests/bugs/distribute/bug-1122443.t b/tests/bugs/distribute/bug-1122443.t deleted file mode 100644 index 906be7072bd..00000000000 --- a/tests/bugs/distribute/bug-1122443.t +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../dht.rc - -make_files() { - mkdir $1 && \ - ln -s ../ $1/symlink && \ - mknod $1/special_b b 1 2 && \ - mknod $1/special_c c 3 4 && \ - mknod $1/special_u u 5 6 && \ - mknod $1/special_p p && \ - touch -h --date=@1 $1/symlink && \ - touch -h --date=@2 $1/special_b && - touch -h --date=@3 $1/special_c && - touch -h --date=@4 $1/special_u && - touch -h --date=@5 $1/special_p -} - -bug_1113050_workaround() { - # Test if graph change has settled (bug-1113050?) - test=$(stat -c "%n:%Y" $1 2>&1 | tr '\n' ',') - if [ $? -eq 0 ] ; then - echo RECONNECTED - else - echo WAITING - fi - return 0 -} - -cleanup - -TEST glusterd -TEST pidof glusterd - -TEST $CLI volume create $V0 $H0:$B0/${V0}0 -TEST $CLI volume start $V0 - -# Mount FUSE and create symlink -TEST glusterfs -s $H0 --volfile-id $V0 $M0 -TEST make_files $M0/subdir - -# Get mtime before migration -BEFORE="$(stat -c %n:%Y $M0/subdir/* | tr '\n' ',')" - -# Migrate brick -TEST $CLI volume add-brick $V0 $H0:$B0/${V0}1 -TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}0 start -EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" remove_brick_status_completed_field "$V0 $H0:$B0/${V0}0" -TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}0 commit - -# Get mtime after migration -EXPECT_WITHIN 5 RECONNECTED bug_1113050_workaround $M0/subdir/* -AFTER="$(stat -c %n:%Y $M0/subdir/* | tr '\n' ',')" - -# Check if mtime is unchanged -TEST [ "$AFTER" == "$BEFORE" ] - -cleanup diff --git a/tests/bugs/distribute/bug-1600379.t b/tests/bugs/distribute/bug-1600379.t new file mode 100644 index 00000000000..8d2f6154100 --- /dev/null +++ b/tests/bugs/distribute/bug-1600379.t @@ -0,0 +1,54 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +# Initialize +#------------------------------------------------------------ +cleanup; + +# Start glusterd +TEST glusterd; +TEST pidof glusterd; +TEST $CLI volume info; + +# Create a volume +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2} + +# Verify volume creation +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; + +# Start volume and verify successful start +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0; +#------------------------------------------------------------ + +# Test case - Remove xattr from killed brick on lookup +#------------------------------------------------------------ +# Create a dir and set custom xattr +TEST mkdir $M0/testdir +TEST setfattr -n user.attr -v val $M0/testdir +xattr_val=`getfattr -d $B0/${V0}2/testdir | awk '{print $1}'`; +TEST ${xattr_val}='user.attr="val"'; + +# Kill 2nd brick process +TEST kill_brick $V0 $H0 $B0/${V0}2 +EXPECT_WITHIN ${PROCESS_UP_TIMEOUT} "1" online_brick_count + +# Remove custom xattr +TEST setfattr -x user.attr $M0/testdir + +# Bring up the killed brick process +TEST $CLI volume start $V0 force + +# Perform lookup +sleep 5 +TEST ls $M0/testdir + +# Check brick xattrs +xattr_val_2=`getfattr -d $B0/${V0}2/testdir`; +TEST [ ${xattr_val_2} = ''] ; + +cleanup; diff --git a/tests/bugs/distribute/issue-1327.t b/tests/bugs/distribute/issue-1327.t new file mode 100755 index 00000000000..acd8c8c6614 --- /dev/null +++ b/tests/bugs/distribute/issue-1327.t @@ -0,0 +1,33 @@ +#!/bin/bash + +SCRIPT_TIMEOUT=250 + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../dht.rc + +cleanup + +TEST glusterd +TEST pidof glusterd + +BRICK1=$B0/${V0}-0 +BRICK2=$B0/${V0}-1 + +TEST $CLI volume create $V0 $H0:$BRICK1 $H0:$BRICK2 +TEST $CLI volume start $V0 + +TEST glusterfs -s $H0 --volfile-id $V0 $M0 +TEST mkdir $M0/dir + +#remove dir from one of the brick +TEST rmdir $BRICK2/dir + +#safe cache timeout for lookup to be triggered +sleep 2 + +TEST ls $M0/dir + +TEST stat $BRICK2/dir + +cleanup |