diff options
Diffstat (limited to 'tests/bugs/snapshot')
12 files changed, 129 insertions, 52 deletions
diff --git a/tests/bugs/snapshot/bug-1109889.t b/tests/bugs/snapshot/bug-1109889.t index 6b29cdd9eb1..5fdc7dc9506 100644 --- a/tests/bugs/snapshot/bug-1109889.t +++ b/tests/bugs/snapshot/bug-1109889.t @@ -19,9 +19,9 @@ TEST $CLI volume create $V0 $H0:$L1 $H0:$L2 $H0:$L3; TEST $CLI volume start $V0; -TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; +TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0; -MOUNT_PID=`ps ax |grep "glusterfs --volfile-sever $H0 --volfile-id=$V0 $M0" | grep -v grep | awk '{print $1}' | head -1` +MOUNT_PID=$(get_mount_process_pid $V0 $M0) for i in {1..10} ; do echo "file" > $M0/file$i ; done diff --git a/tests/bugs/snapshot/bug-1111041.t b/tests/bugs/snapshot/bug-1111041.t index f771d64f2a3..efda9688d8b 100755 --- a/tests/bugs/snapshot/bug-1111041.t +++ b/tests/bugs/snapshot/bug-1111041.t @@ -11,6 +11,10 @@ function is_snapd_running { $CLI volume status $1 | grep "Snapshot Daemon" | wc -l; } +function snapd_pid { + $CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'} +} + TEST glusterd; TEST pidof glusterd; @@ -25,14 +29,12 @@ TEST $CLI volume set $V0 features.uss enable; EXPECT "1" is_snapd_running $V0 -SNAPD_PID=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'}); +SNAPD_PID=$(snapd_pid); TEST [ $SNAPD_PID -gt 0 ] kill -9 $SNAPD_PID -SNAPD_PID=$($CLI volume status $V0 | grep "Snapshot Daemon" | awk {'print $8'}); - -TEST [ $SNAPD_PID = 'N/A' ] +EXPECT_WITHIN $PROCESS_DOWN_TIMEOUT "^N/A$" snapd_pid cleanup ; diff --git a/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t b/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t deleted file mode 100644 index c536c8261e4..00000000000 --- a/tests/bugs/snapshot/bug-1140162-file-snapshot-features-encrypt-opts-validation.t +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -## Test case for BZ-1140160 Volume option set <vol> <file-snapshot> and -## <features.encryption> <value> command input should validate correctly. - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -## Start glusterd -TEST glusterd; -TEST pidof glusterd; - -## Lets create and start volume -TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; -TEST $CLI volume start $V0 - -## Set features.file-snapshot and features.encryption option with non-boolean -## value. These options should fail. -TEST ! $CLI volume set $V0 features.file-snapshot abcd -TEST ! $CLI volume set $V0 features.encryption redhat - -## Set other options with valid value. These options should succeed. -TEST $CLI volume set $V0 barrier enable -TEST $CLI volume set $V0 ping-timeout 60 - -## Set features.file-snapshot and features.encryption option with valid boolean -## value. These options should succeed. -TEST $CLI volume set $V0 features.file-snapshot on - -## Before setting the crypt xlator on, it is required to create master key -## Otherwise glusterfs client process will fail to start -echo "0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff" > $GLUSTERD_WORKDIR/$V0-master-key - -## Specify location of master key -TEST $CLI volume set $V0 encryption.master-key $GLUSTERD_WORKDIR/$V0-master-key - -TEST $CLI volume set $V0 features.encryption on - -cleanup; -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 -#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000 diff --git a/tests/bugs/snapshot/bug-1166197.t b/tests/bugs/snapshot/bug-1166197.t index 7350acfa9ed..b070ae271ba 100755 --- a/tests/bugs/snapshot/bug-1166197.t +++ b/tests/bugs/snapshot/bug-1166197.t @@ -5,6 +5,8 @@ . $(dirname $0)/../../volume.rc . $(dirname $0)/../../nfs.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; CURDIR=`pwd` diff --git a/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t b/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t index 3776451c158..52a7a790b97 100644 --- a/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t +++ b/tests/bugs/snapshot/bug-1167580-set-proper-uid-and-gid-during-nfs-access.t @@ -4,6 +4,8 @@ . $(dirname $0)/../../volume.rc . $(dirname $0)/../../snapshot.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + # This function returns a value "Y" if user can execute # the given command. Else it will return "N" # @arg-1 : Name of the user @@ -199,3 +201,5 @@ TEST $CLI snapshot delete all cleanup; +#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 +#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000 diff --git a/tests/bugs/snapshot/bug-1227646.t b/tests/bugs/snapshot/bug-1227646.t index a16a8c270da..9b73dfdb32f 100644 --- a/tests/bugs/snapshot/bug-1227646.t +++ b/tests/bugs/snapshot/bug-1227646.t @@ -20,7 +20,6 @@ TEST $CLI snapshot create snap1 $V0 no-timestamp; TEST $CLI volume stop $V0 TEST $CLI snapshot restore snap1; TEST $CLI volume start $V0 -TEST $CLI volume tier $V0 attach $H0:$L1 $H0:$L2 TEST pkill gluster TEST glusterd diff --git a/tests/bugs/snapshot/bug-1260848.t b/tests/bugs/snapshot/bug-1260848.t index 7eae3982e43..6455d8297b2 100644 --- a/tests/bugs/snapshot/bug-1260848.t +++ b/tests/bugs/snapshot/bug-1260848.t @@ -4,6 +4,8 @@ . $(dirname $0)/../../nfs.rc . $(dirname $0)/../../volume.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; ## Start and create a volume diff --git a/tests/bugs/snapshot/bug-1279327.t b/tests/bugs/snapshot/bug-1279327.t index de1b3885a1c..4e4be6eeea6 100644 --- a/tests/bugs/snapshot/bug-1279327.t +++ b/tests/bugs/snapshot/bug-1279327.t @@ -15,7 +15,6 @@ TEST setup_lvm 3 TEST $CLI volume create $V0 $H0:$L1 TEST $CLI volume start $V0 TEST $CLI volume quota $V0 enable -TEST $CLI volume tier $V0 attach replica 2 $H0:$L2 $H0:$L3 TEST $CLI snapshot create snap1 $V0 no-timestamp TEST $CLI snapshot activate snap1 diff --git a/tests/bugs/snapshot/bug-1482023-snpashot-issue-with-other-processes-accessing-mounted-path.t b/tests/bugs/snapshot/bug-1482023-snpashot-issue-with-other-processes-accessing-mounted-path.t index 22f98d2b5a7..04a85db0c1a 100644 --- a/tests/bugs/snapshot/bug-1482023-snpashot-issue-with-other-processes-accessing-mounted-path.t +++ b/tests/bugs/snapshot/bug-1482023-snpashot-issue-with-other-processes-accessing-mounted-path.t @@ -111,6 +111,10 @@ EXPECT_WITHIN $PROBE_TIMEOUT 2 peer_count; EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" mounted_snaps ${V0} EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" mounted_snaps ${V1} +# It might be possible that the import snap synctask is still updating the data, +# we need to allow a buffer time to be on the safer side +sleep 2 + kill_glusterd 2 activate_snapshots EXPECT 'Started' snapshot_status ${V0}_snap; @@ -125,3 +129,5 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" mounted_snaps ${V0} EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" mounted_snaps ${V1} cleanup; +# run first! +#G_TESTDEF_TEST_STATUS_CENTOS6=BRICK_MUX_BAD_TEST,BUG=1743069 diff --git a/tests/bugs/snapshot/bug-1512451-snapshot-creation-failed-after-brick-reset.t b/tests/bugs/snapshot/bug-1512451-snapshot-creation-failed-after-brick-reset.t index 0624a5db977..53b274e8819 100644 --- a/tests/bugs/snapshot/bug-1512451-snapshot-creation-failed-after-brick-reset.t +++ b/tests/bugs/snapshot/bug-1512451-snapshot-creation-failed-after-brick-reset.t @@ -28,7 +28,7 @@ TEST ! snapshot_exists 1 ${V0}_snap1 TEST $CLI_1 volume reset-brick $V0 $H1:$L1/B1 start TEST $CLI_1 volume reset-brick $V0 $H1:$L1/B1 $H1:$L1/B1 commit force -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status_1 $V0 $H1 $L1/B1 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" cluster_brick_up_status 1 $V0 $H1 $L1/B1 TEST $CLI_1 snapshot create ${V0}_snap1 ${V0} no-timestamp TEST snapshot_exists 1 ${V0}_snap1 diff --git a/tests/bugs/snapshot/bug-1597662.t b/tests/bugs/snapshot/bug-1597662.t new file mode 100644 index 00000000000..f582930476a --- /dev/null +++ b/tests/bugs/snapshot/bug-1597662.t @@ -0,0 +1,58 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../snapshot.rc + +cleanup; + +TEST init_n_bricks 3; +TEST setup_lvm 3; +TEST glusterd; +TEST pidof glusterd; + +TEST $CLI volume create $V0 $H0:$L1 $H0:$L2 $H0:$L3; +TEST $CLI volume start $V0; + +snap_path=/var/run/gluster/snaps + +TEST $CLI snapshot create snap1 $V0 no-timestamp; + +$CLI snapshot activate snap1; + +EXPECT 'Started' snapshot_status snap1; + +# This Function will check for entry /var/run/gluster/snaps/<snap-name> +# against snap-name + +function is_snap_path +{ + echo `ls $snap_path | grep snap1 | wc -l` +} + +# snap is active so snap_path should exist +EXPECT "1" is_snap_path + +$CLI snapshot deactivate snap1; +EXPECT_WITHIN ${PROCESS_DOWN_TIMEOUT} 'Stopped' snapshot_status snap1 +# snap is deactivated so snap_path should not exist +EXPECT "0" is_snap_path + +# activate snap again +$CLI snapshot activate snap1; +EXPECT_WITHIN ${PROCESS_UP_TIMEOUT} 'Started' snapshot_status snap1 + +# snap is active so snap_path should exist +EXPECT "1" is_snap_path + +# delete snap now +TEST $CLI snapshot delete snap1; + +# snap is deleted so snap_path should not exist +EXPECT "0" is_snap_path + +TEST $CLI volume stop $V0; +TEST $CLI volume delete $V0; + +cleanup; + diff --git a/tests/bugs/snapshot/bug-1618004-fix-memory-corruption-in-snap-import.t b/tests/bugs/snapshot/bug-1618004-fix-memory-corruption-in-snap-import.t new file mode 100644 index 00000000000..a2c004e435e --- /dev/null +++ b/tests/bugs/snapshot/bug-1618004-fix-memory-corruption-in-snap-import.t @@ -0,0 +1,48 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../snapshot.rc +. $(dirname $0)/../../cluster.rc + +function get_volume_info () +{ + local var=$1 + $CLI_1 volume info $V0 | grep "^$var" | sed 's/.*: //' +} + +cleanup; + +TEST verify_lvm_version +TEST launch_cluster 2 +TEST setup_lvm 2 + +TEST $CLI_1 peer probe $H2; +EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count; + +TEST $CLI_1 volume create $V0 $H1:$L1 $H2:$L2 +EXPECT "$V0" get_volume_info 'Volume Name'; +EXPECT 'Created' get_volume_info 'Status'; + +TEST $CLI_1 volume start $V0 +EXPECT 'Started' get_volume_info 'Status'; + + +# Setting system limit +TEST $CLI_1 snapshot config activate-on-create enable + +TEST $CLI_1 snapshot create snap1 $V0 no-timestamp description "test" +TEST kill_glusterd 1 +#deactivate snapshot for changing snap version, so that handshake will +#happen when glusterd is restarted +TEST $CLI_2 snapshot deactivate snap1 +TEST start_glusterd 1 + +#Wait till handshake complete +EXPECT_WITHIN ${PROCESS_UP_TIMEOUT} 'Stopped' snapshot_status snap1 + +#Delete the snapshot, without this fix, delete will lead to assertion failure +$CLI_1 snapshot delete all +EXPECT '0' get_snap_count CLI_1; +cleanup; + |
