summaryrefslogtreecommitdiffstats
path: root/tests/bugs/snapshot/bug-1618004-fix-memory-corruption-in-snap-import.t
blob: a2c004e435ed49d91ec5188a0ced7a2d6caea666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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;