]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/rbd/rbd_mirror.sh
bump version to 12.1.2-pve1
[ceph.git] / ceph / qa / workunits / rbd / rbd_mirror.sh
CommitLineData
7c673cae
FG
1#!/bin/sh
2#
3# rbd_mirror.sh - test rbd-mirror daemon
4#
5# The scripts starts two ("local" and "remote") clusters using mstart.sh script,
6# creates a temporary directory, used for cluster configs, daemon logs, admin
7# socket, temporary files, and launches rbd-mirror daemon.
8#
9
10. $(dirname $0)/rbd_mirror_helpers.sh
11
12testlog "TEST: add image and test replay"
13start_mirror ${CLUSTER1}
14image=test
15create_image ${CLUSTER2} ${POOL} ${image}
16wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
17write_image ${CLUSTER2} ${POOL} ${image} 100
18wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
19wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
20if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
21 wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'down+unknown'
22fi
23compare_images ${POOL} ${image}
24
25testlog "TEST: stop mirror, add image, start mirror and test replay"
26stop_mirror ${CLUSTER1}
27image1=test1
28create_image ${CLUSTER2} ${POOL} ${image1}
29write_image ${CLUSTER2} ${POOL} ${image1} 100
30start_mirror ${CLUSTER1}
31wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
32wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image1}
33wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' 'master_position'
34if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
35 wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image1} 'down+unknown'
36fi
37compare_images ${POOL} ${image1}
38
39testlog "TEST: test the first image is replaying after restart"
40write_image ${CLUSTER2} ${POOL} ${image} 100
41wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
42wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
43wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
44compare_images ${POOL} ${image}
45
46testlog "TEST: stop/start/restart mirror via admin socket"
47admin_daemon ${CLUSTER1} rbd mirror stop
48wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
49wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
50wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
51wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped'
52
53admin_daemon ${CLUSTER1} rbd mirror start
54wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
55wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
56wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
57wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying'
58
59admin_daemon ${CLUSTER1} rbd mirror restart
60wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
61wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
62wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
63wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying'
64
65admin_daemon ${CLUSTER1} rbd mirror stop
66wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
67wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
68wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
69wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped'
70
71admin_daemon ${CLUSTER1} rbd mirror restart
72wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
73wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
74wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
75wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying'
76
77admin_daemon ${CLUSTER1} rbd mirror stop ${POOL} ${CLUSTER2}
78wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
79wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
80wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
81wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped'
82
83admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
84wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
85wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
86
87admin_daemon ${CLUSTER1} rbd mirror start ${POOL} ${CLUSTER2}
88wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
89wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying'
90
91admin_daemon ${CLUSTER1} rbd mirror restart ${POOL}/${image}
92wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
93wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
94
95admin_daemon ${CLUSTER1} rbd mirror restart ${POOL} ${CLUSTER2}
96wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
97wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
98
99admin_daemon ${CLUSTER1} rbd mirror stop ${POOL} ${CLUSTER2}
100wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
101wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
102wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
103wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped'
104
105admin_daemon ${CLUSTER1} rbd mirror restart ${POOL} ${CLUSTER2}
106wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
107wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
108wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
109wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying'
110
111admin_daemon ${CLUSTER1} rbd mirror flush
112admin_daemon ${CLUSTER1} rbd mirror status
113
114testlog "TEST: failover and failback"
115start_mirror ${CLUSTER2}
116
117# demote and promote same cluster
118demote_image ${CLUSTER2} ${POOL} ${image}
119wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
c07f9fc5
FG
120wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+unknown'
121wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+unknown'
7c673cae
FG
122promote_image ${CLUSTER2} ${POOL} ${image}
123wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
124write_image ${CLUSTER2} ${POOL} ${image} 100
125wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
126wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
127wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
128compare_images ${POOL} ${image}
129
130# failover (unmodified)
131demote_image ${CLUSTER2} ${POOL} ${image}
132wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
c07f9fc5
FG
133wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+unknown'
134wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+unknown'
7c673cae
FG
135promote_image ${CLUSTER1} ${POOL} ${image}
136wait_for_image_replay_started ${CLUSTER2} ${POOL} ${image}
137
138# failback (unmodified)
139demote_image ${CLUSTER1} ${POOL} ${image}
140wait_for_image_replay_stopped ${CLUSTER2} ${POOL} ${image}
c07f9fc5
FG
141wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+unknown'
142wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+unknown'
7c673cae
FG
143promote_image ${CLUSTER2} ${POOL} ${image}
144wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
145wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
146wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
147wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
148compare_images ${POOL} ${image}
149
150# failover
151demote_image ${CLUSTER2} ${POOL} ${image}
152wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
c07f9fc5
FG
153wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+unknown'
154wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+unknown'
7c673cae
FG
155promote_image ${CLUSTER1} ${POOL} ${image}
156wait_for_image_replay_started ${CLUSTER2} ${POOL} ${image}
157write_image ${CLUSTER1} ${POOL} ${image} 100
158wait_for_replay_complete ${CLUSTER2} ${CLUSTER1} ${POOL} ${image}
159wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
160wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+replaying' 'master_position'
161compare_images ${POOL} ${image}
162
163# failback
164demote_image ${CLUSTER1} ${POOL} ${image}
165wait_for_image_replay_stopped ${CLUSTER2} ${POOL} ${image}
c07f9fc5
FG
166wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+unknown'
167wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+unknown'
7c673cae
FG
168promote_image ${CLUSTER2} ${POOL} ${image}
169wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
170write_image ${CLUSTER2} ${POOL} ${image} 100
171wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
172wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
173wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
174compare_images ${POOL} ${image}
175
176# force promote
177force_promote_image=test_force_promote
178create_image ${CLUSTER2} ${POOL} ${force_promote_image}
179write_image ${CLUSTER2} ${POOL} ${force_promote_image} 100
180wait_for_image_replay_stopped ${CLUSTER2} ${POOL} ${force_promote_image}
181wait_for_image_replay_started ${CLUSTER1} ${POOL} ${force_promote_image}
182wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${force_promote_image}
183wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${force_promote_image} 'up+replaying' 'master_position'
184wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${force_promote_image} 'up+stopped'
185promote_image ${CLUSTER1} ${POOL} ${force_promote_image} '--force'
186wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${force_promote_image}
187wait_for_image_replay_stopped ${CLUSTER2} ${POOL} ${force_promote_image}
188wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${force_promote_image} 'up+stopped'
189wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${force_promote_image} 'up+stopped'
190write_image ${CLUSTER1} ${POOL} ${force_promote_image} 100
191write_image ${CLUSTER2} ${POOL} ${force_promote_image} 100
192
193testlog "TEST: cloned images"
194parent_image=test_parent
195parent_snap=snap
196create_image ${CLUSTER2} ${PARENT_POOL} ${parent_image}
197write_image ${CLUSTER2} ${PARENT_POOL} ${parent_image} 100
198create_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
199protect_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
200
201clone_image=test_clone
202clone_image ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap} ${POOL} ${clone_image}
203write_image ${CLUSTER2} ${POOL} ${clone_image} 100
204
205enable_mirror ${CLUSTER2} ${PARENT_POOL} ${parent_image}
206wait_for_image_replay_started ${CLUSTER1} ${PARENT_POOL} ${parent_image}
207wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${PARENT_POOL} ${parent_image}
208wait_for_status_in_pool_dir ${CLUSTER1} ${PARENT_POOL} ${parent_image} 'up+replaying' 'master_position'
209compare_images ${PARENT_POOL} ${parent_image}
210
211wait_for_image_replay_started ${CLUSTER1} ${POOL} ${clone_image}
212wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${clone_image}
213wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${clone_image} 'up+replaying' 'master_position'
214compare_images ${POOL} ${clone_image}
215
216expect_failure "is non-primary" clone_image ${CLUSTER1} ${PARENT_POOL} \
217 ${parent_image} ${parent_snap} ${POOL} ${clone_image}1
218
219testlog "TEST: disable mirroring / delete non-primary image"
220image2=test2
221image3=test3
222image4=test4
223image5=test5
224for i in ${image2} ${image3} ${image4} ${image5}; do
225 create_image ${CLUSTER2} ${POOL} ${i}
226 write_image ${CLUSTER2} ${POOL} ${i} 100
227 create_snapshot ${CLUSTER2} ${POOL} ${i} 'snap1'
228 create_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2'
229 if [ "${i}" = "${image4}" ] || [ "${i}" = "${image5}" ]; then
230 protect_snapshot ${CLUSTER2} ${POOL} ${i} 'snap1'
231 protect_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2'
232 fi
233 write_image ${CLUSTER2} ${POOL} ${i} 100
234 wait_for_image_present ${CLUSTER1} ${POOL} ${i} 'present'
235 wait_for_snap_present ${CLUSTER1} ${POOL} ${i} 'snap2'
236done
237
238set_pool_mirror_mode ${CLUSTER2} ${POOL} 'image'
239for i in ${image2} ${image4}; do
240 disable_mirror ${CLUSTER2} ${POOL} ${i}
241done
242
243unprotect_snapshot ${CLUSTER2} ${POOL} ${image5} 'snap1'
244unprotect_snapshot ${CLUSTER2} ${POOL} ${image5} 'snap2'
245for i in ${image3} ${image5}; do
246 remove_snapshot ${CLUSTER2} ${POOL} ${i} 'snap1'
247 remove_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2'
248 remove_image_retry ${CLUSTER2} ${POOL} ${i}
249done
250
251for i in ${image2} ${image3} ${image4} ${image5}; do
252 wait_for_image_present ${CLUSTER1} ${POOL} ${i} 'deleted'
253done
254
255set_pool_mirror_mode ${CLUSTER2} ${POOL} 'pool'
256for i in ${image2} ${image4}; do
257 wait_for_image_present ${CLUSTER1} ${POOL} ${i} 'present'
258 wait_for_snap_present ${CLUSTER1} ${POOL} ${i} 'snap2'
259 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${i}
260 wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${i}
261 compare_images ${POOL} ${i}
262done
263
264testlog "TEST: snapshot rename"
265snap_name='snap_rename'
266create_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_0"
267for i in `seq 1 20`; do
268 rename_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_$(expr ${i} - 1)" "${snap_name}_${i}"
269done
270wait_for_snap_present ${CLUSTER1} ${POOL} ${image2} "${snap_name}_${i}"
271
272testlog "TEST: disable mirror while daemon is stopped"
273stop_mirror ${CLUSTER1}
274stop_mirror ${CLUSTER2}
275set_pool_mirror_mode ${CLUSTER2} ${POOL} 'image'
276disable_mirror ${CLUSTER2} ${POOL} ${image}
277if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
278 test_image_present ${CLUSTER1} ${POOL} ${image} 'present'
279fi
280start_mirror ${CLUSTER1}
281wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
282set_pool_mirror_mode ${CLUSTER2} ${POOL} 'pool'
283wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'present'
284wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
285
286testlog "TEST: simple image resync"
287request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
288wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' ${image_id}
289wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
290wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
291compare_images ${POOL} ${image}
292
293testlog "TEST: image resync while replayer is stopped"
294admin_daemon ${CLUSTER1} rbd mirror stop ${POOL}/${image}
295wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
296request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
297admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
298wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' ${image_id}
299admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
300wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
301wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
302compare_images ${POOL} ${image}
303
304testlog "TEST: request image resync while daemon is offline"
305stop_mirror ${CLUSTER1}
306request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
307start_mirror ${CLUSTER1}
308wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' ${image_id}
309wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
310wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
311compare_images ${POOL} ${image}
312
313testlog "TEST: client disconnect"
314image=laggy
315create_image ${CLUSTER2} ${POOL} ${image} 128 --journal-object-size 64K
316write_image ${CLUSTER2} ${POOL} ${image} 10
317
318testlog " - replay stopped after disconnect"
319wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
320wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
321test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
322disconnect_image ${CLUSTER2} ${POOL} ${image}
323test -z "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
324wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
325wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
326
327testlog " - replay started after resync requested"
328request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
329wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' ${image_id}
330wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
331wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
332test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
333compare_images ${POOL} ${image}
334
335testlog " - disconnected after max_concurrent_object_sets reached"
336admin_daemon ${CLUSTER1} rbd mirror stop ${POOL}/${image}
337wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
338test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
339set_image_meta ${CLUSTER2} ${POOL} ${image} \
340 conf_rbd_journal_max_concurrent_object_sets 1
341write_image ${CLUSTER2} ${POOL} ${image} 20 16384
342write_image ${CLUSTER2} ${POOL} ${image} 20 16384
343test -z "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
344set_image_meta ${CLUSTER2} ${POOL} ${image} \
345 conf_rbd_journal_max_concurrent_object_sets 0
346
347testlog " - replay is still stopped (disconnected) after restart"
348admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
349wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
350wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
351
352testlog " - replay started after resync requested"
353request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
354wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' ${image_id}
355wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
356wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
357test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
358compare_images ${POOL} ${image}
359
360testlog " - rbd_mirroring_resync_after_disconnect config option"
361set_image_meta ${CLUSTER2} ${POOL} ${image} \
362 conf_rbd_mirroring_resync_after_disconnect true
363wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
364disconnect_image ${CLUSTER2} ${POOL} ${image}
365wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
366wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
367wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
368test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
369compare_images ${POOL} ${image}
370set_image_meta ${CLUSTER2} ${POOL} ${image} \
371 conf_rbd_mirroring_resync_after_disconnect false
372wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
373disconnect_image ${CLUSTER2} ${POOL} ${image}
374test -z "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
375wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
376wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
377
378testlog "TEST: split-brain"
379image=split-brain
380create_image ${CLUSTER2} ${POOL} ${image}
381wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
382demote_image ${CLUSTER2} ${POOL} ${image}
c07f9fc5 383wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+unknown'
7c673cae
FG
384promote_image ${CLUSTER1} ${POOL} ${image}
385write_image ${CLUSTER1} ${POOL} ${image} 10
386demote_image ${CLUSTER1} ${POOL} ${image}
387promote_image ${CLUSTER2} ${POOL} ${image}
388wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'split-brain'
389request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
390wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
391
31f18b77 392testlog "TEST: no blacklists"
c07f9fc5
FG
393CEPH_ARGS='--id admin' ceph --cluster ${CLUSTER1} osd blacklist ls 2>&1 | grep -q "listed 0 entries"
394CEPH_ARGS='--id admin' ceph --cluster ${CLUSTER2} osd blacklist ls 2>&1 | grep -q "listed 0 entries"
31f18b77 395
7c673cae 396echo OK