summaryrefslogtreecommitdiffstats
path: root/tests/geo-rep/georep-basic-dr-tarssh.t
blob: ccf688c2701f0ff881c5ff8dc20dcac5b81dee7b (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash

. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
. $(dirname $0)/../geo-rep.rc

#################################################
# BASIC TESTS WITH DISTRIBUTE REPLICATE VOLUMES
#################################################

##Cleanup and start glusterd
cleanup;
TEST glusterd;
TEST pidof glusterd


##Variables
GEOREP_CLI="$CLI volume geo-replication"
master=$GMV0
slave=${H0}::${GSV0}
num_active=2
num_passive=2
master_mnt=$M0
slave_mnt=$M1

############################################################
#SETUP VOLUMES AND GEO-REPLICATION
############################################################

##create_and_start_master_volume
TEST $CLI volume create $GMV0 replica 2 $H0:$B0/${GMV0}{1,2,3,4};
TEST $CLI volume start $GMV0

##create_and_start_slave_volume
TEST $CLI volume create $GSV0 replica 2 $H0:$B0/${GSV0}{1,2,3,4};   #5
TEST $CLI volume start $GSV0

##Create, start and mount meta_volume
TEST $CLI volume create $META_VOL replica 3 $H0:$B0/${META_VOL}{1,2,3};
TEST $CLI volume start $META_VOL
TEST mkdir -p $META_MNT
TEST glusterfs -s $H0 --volfile-id $META_VOL $META_MNT     #10

##Mount master
TEST glusterfs -s $H0 --volfile-id $GMV0 $M0

##Mount slave
TEST glusterfs -s $H0 --volfile-id $GSV0 $M1

############################################################
#BASIC GEO-REPLICATION TESTS
############################################################

#Check Hybrid Crawl
TEST create_data "hybrid"
TEST create_georep_session $master $slave
EXPECT 4 check_status_num_rows "Created"             #15

#Enable_metavolume
TEST $GEOREP_CLI $master $slave config use_meta_volume true

#Config tarssh as sync-engine
TEST $GEOREP_CLI $master $slave config use_tarssh true

#Start_georep
TEST $GEOREP_CLI $master $slave start

sleep 10
EXPECT 2 check_status_num_rows "Active"
EXPECT 2 check_status_num_rows "Passive"            #20

#DATA_TESTS HYBRID
sleep 10
TEST regular_file_ok ${slave_mnt}/hybrid_f1
TEST directory_ok ${slave_mnt}/$hybrid_d1
TEST rename_ok ${slave_mnt}/hybrid_f3 ${slave_mnt}/hybrid_f4
TEST rename_ok ${slave_mnt}/hybrid_d3 ${slave_mnt}/hybrid_d4
TEST symlink_ok hybrid_f1 ${slave_mnt}/hybrid_sl1                    #25
TEST hardlink_file_ok ${slave_mnt}/hybrid_f1 ${slave_mnt}/hybrid_hl1
TEST unlink_ok ${slave_mnt}/hybrid_f2
TEST unlink_ok ${slave_mnt}/hybrid_d2
TEST data_ok ${slave_mnt}/hybrid_f1 "HelloWorld!"

#Check History Crawl.
TEST $GEOREP_CLI $master $slave stop                #30
TEST create_data "history"
TEST $GEOREP_CLI $master $slave start
sleep 10
EXPECT 2 check_status_num_rows "Active"
EXPECT 2 check_status_num_rows "Passive"
#data_tests "history"
sleep 10
TEST regular_file_ok ${slave_mnt}/history_f1        #35
TEST directory_ok ${slave_mnt}/history_d1
TEST rename_ok ${slave_mnt}/history_f3 ${slave_mnt}/history_f4
TEST rename_ok ${slave_mnt}/history_d3 ${slave_mnt}/history_d4
TEST symlink_ok history_f1 ${slave_mnt}/history_sl1
TEST hardlink_file_ok ${slave_mnt}/history_f1 ${slave_mnt}/history_hl1   #40
TEST unlink_ok ${slave_mnt}/history_f2
TEST unlink_ok ${slave_mnt}/history_d2
TEST data_ok ${slave_mnt}/history_f1 "HelloWorld!"

#Check History Crawl.
TEST create_data "changelog"
sleep 15
TEST check_status "Changelog Crawl"                    #45
#data_tests "changelog"
sleep 10
TEST regular_file_ok ${slave_mnt}/changelog_f1
TEST directory_ok ${slave_mnt}/changelog_d1
TEST rename_ok ${slave_mnt}/changelog_f3 ${slave_mnt}/changelog_f4
TEST rename_ok ${slave_mnt}/changelog_d3 ${slave_mnt}/changelog_d4
TEST symlink_ok changelog_f1 ${slave_mnt}/changelog_sl1                    #50
TEST hardlink_file_ok ${slave_mnt}/changelog_f1 ${slave_mnt}/changelog_hl1
TEST unlink_ok ${slave_mnt}/changelog_f2
TEST unlink_ok ${slave_mnt}/changelog_d2
TEST data_ok ${slave_mnt}/changelog_f1 "HelloWorld!"

#Stop Geo-rep
TEST $GEOREP_CLI $master $slave stop                                 #55

#Delete Geo-rep
TEST $GEOREP_CLI $master $slave delete

cleanup;