diff options
Diffstat (limited to 'tests/bugs/changelog')
| -rwxr-xr-x | tests/bugs/changelog/bug-1208470.t | 40 | ||||
| -rw-r--r-- | tests/bugs/changelog/bug-1211327.t | 46 | ||||
| -rw-r--r-- | tests/bugs/changelog/bug-1225542.t | 30 | ||||
| -rw-r--r-- | tests/bugs/changelog/bug-1321955.t | 60 |
4 files changed, 176 insertions, 0 deletions
diff --git a/tests/bugs/changelog/bug-1208470.t b/tests/bugs/changelog/bug-1208470.t new file mode 100755 index 00000000000..526f8f20612 --- /dev/null +++ b/tests/bugs/changelog/bug-1208470.t @@ -0,0 +1,40 @@ +#!/bin/bash + +## Testcase: +## Avoid creating any EMPTY changelog(over the changelog rollover time) + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../changelog.rc +cleanup; + +## override current changelog rollover-time +## to avoid sleeping for long duration. +CL_RO_TIME=5 + +## Start and create a volume +TEST glusterd; +TEST pidof glusterd; +TEST $CLI volume create $V0 $H0:$B0/$V0"1"; + +## Verify volume is created +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; + +## Start volume and verify +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +## Set changelog ON +TEST $CLI volume set $V0 changelog.changelog on; + +EXPECT 1 count_changelog_files $B0/${V0}1 + +## Set changelog rollover time +TEST $CLI volume set $V0 changelog.rollover-time $CL_RO_TIME; + +## Wait for changelog rollover time +sleep $CL_RO_TIME + +## NO additional empty changelogs created +EXPECT 1 count_changelog_files $B0/${V0}1 diff --git a/tests/bugs/changelog/bug-1211327.t b/tests/bugs/changelog/bug-1211327.t new file mode 100644 index 00000000000..a849ec3981f --- /dev/null +++ b/tests/bugs/changelog/bug-1211327.t @@ -0,0 +1,46 @@ +#!/bin/bash + +#Testcase: +#On brick restart, new HTIME.TSTAMP file should not be created. +#But on changelog disable/enable HTIME.TSTAMP should be created. + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../changelog.rc +cleanup; + +## Start and create a volume +TEST glusterd; +TEST pidof glusterd; +TEST $CLI volume create $V0 $H0:$B0/$V0"1"; + +## Verify volume is is created +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; + +## Start volume and verify +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +TEST $CLI volume set $V0 changelog.changelog on; +##Let changelog init complete before killing gluster processes +sleep 1 + +TEST killall_gluster; +EXPECT_WITHIN $CHILD_UP_TIMEOUT "0" online_brick_count + +TEST glusterd; +TEST pidof glusterd; + +##Let the brick processes starts +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count + +##On brick restart only one HTIME should be found. +EXPECT 1 count_htime_files; + +##On changelog disable/enable, new HTIME should be created. +TEST $CLI volume set $V0 changelog.changelog off; +TEST $CLI volume set $V0 changelog.changelog on; +EXPECT 2 count_htime_files; + +cleanup; diff --git a/tests/bugs/changelog/bug-1225542.t b/tests/bugs/changelog/bug-1225542.t new file mode 100644 index 00000000000..a646aa88014 --- /dev/null +++ b/tests/bugs/changelog/bug-1225542.t @@ -0,0 +1,30 @@ +#!/bin/bash + +#Testcase: +#On snapshot, notify changelog reconfigure upon explicit rollover +#irrespective of any failures and send error back to barrier if any. + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../snapshot.rc + +cleanup; +TEST verify_lvm_version +TEST glusterd; +TEST pidof glusterd; + +TEST setup_lvm 1 + +## Create a volume +TEST $CLI volume create $V0 $H0:$L1 + +## Start volume and verify +TEST $CLI volume start $V0 + +TEST $CLI volume set $V0 changelog.changelog on +##Wait for changelog init to complete. +sleep 1 + +## Take snapshot +TEST $CLI snapshot create snap1 $V0 + +cleanup; diff --git a/tests/bugs/changelog/bug-1321955.t b/tests/bugs/changelog/bug-1321955.t new file mode 100644 index 00000000000..9e3752b1728 --- /dev/null +++ b/tests/bugs/changelog/bug-1321955.t @@ -0,0 +1,60 @@ +#!/bin/bash + +#This file checks if missing entry self-heal and entry self-heal are working +#as expected. +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../afr.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1} +TEST $CLI volume set $V0 changelog.changelog enable +TEST $CLI volume set $V0 changelog.capture-del-path on +TEST $CLI volume start $V0 + +#Mount the volume +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 + +#Create files +TEST touch $M0/file1 +TEST mkdir $M0/dir1 +TEST touch $M0/dir1/file1 + +#Check for presence of files +TEST stat $B0/${V0}0/dir1/file1 +TEST stat $B0/${V0}1/dir1/file1 +TEST stat $B0/${V0}0/file1 +TEST stat $B0/${V0}1/file1 + +#Kill brick1 +TEST kill_brick $V0 $H0 $B0/${V0}1 + +#Del dir1/file1 +TEST rm -f $M0/dir1/file1 + +#file1 should be present in brick1 and not in brick0 +TEST ! stat $B0/${V0}0/dir1/file1 +TEST stat $B0/${V0}1/dir1/file1 + +#Bring up the brick which is down +TEST $CLI volume start $V0 force +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 1 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 + +#Initiate heal +TEST $CLI volume heal $V0 + +EXPECT_WITHIN $HEAL_TIMEOUT "0" get_pending_heal_count $V0 + +#dir1/file1 in brick1 should be deleted +TEST ! stat $B0/${V0}1/dir1/file1 + +#file1 under root should not be deleted in brick1 +TEST stat $B0/${V0}1/file1 + +cleanup; |
