diff options
author | Sunny Kumar <sunkumar@redhat.com> | 2018-07-03 16:03:35 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-07-12 04:35:58 +0000 |
commit | b32ad78516a4edf59a4e9c3ef266e3d69f616b83 (patch) | |
tree | fca7ff780ba4b26a653d7924bfe86128420e6b90 /tests/bugs/snapshot/bug-1597662.t | |
parent | e893eb1b23f62477e98e409eaf96941beeb27177 (diff) |
snapshot : remove stale entry
During snap delete after removing brick-path we should remove
snap-path too i.e. /var/run/gluster/snaps/<snap-name>.
During snap deactivate also we should remove snap-path.
Change-Id: Ib80b5d8844d6479d31beafa732e5671b0322248b
fixes: bz#1597662
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'tests/bugs/snapshot/bug-1597662.t')
-rw-r--r-- | tests/bugs/snapshot/bug-1597662.t | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/bugs/snapshot/bug-1597662.t b/tests/bugs/snapshot/bug-1597662.t new file mode 100644 index 00000000000..dc87d17a0ef --- /dev/null +++ b/tests/bugs/snapshot/bug-1597662.t @@ -0,0 +1,57 @@ +#!/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; + +# snap is deactivated so snap_path should not exist +EXPECT "0" is_snap_path + +# activate snap again +$CLI snapshot activate 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; + |