]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rbd/rbd_mirror_fsx_compare.sh
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / qa / workunits / rbd / rbd_mirror_fsx_compare.sh
1 #!/bin/sh -ex
2 #
3 # rbd_mirror_fsx_compare.sh - test rbd-mirror daemon under FSX workload
4 #
5 # The script is used to compare FSX-generated images between two clusters.
6 #
7
8 . $(dirname $0)/rbd_mirror_helpers.sh
9
10 trap 'cleanup $?' INT TERM EXIT
11
12 setup_tempdir
13
14 testlog "TEST: wait for all images"
15 image_count=$(rbd --cluster ${CLUSTER1} --pool ${POOL} ls | wc -l)
16 retrying_seconds=0
17 sleep_seconds=10
18 while [ ${retrying_seconds} -le 7200 ]; do
19 [ $(rbd --cluster ${CLUSTER2} --pool ${POOL} ls | wc -l) -ge ${image_count} ] && break
20 sleep ${sleep_seconds}
21 retrying_seconds=$(($retrying_seconds+${sleep_seconds}))
22 done
23
24 testlog "TEST: snapshot all pool images"
25 snap_id=`uuidgen`
26 for image in $(rbd --cluster ${CLUSTER1} --pool ${POOL} ls); do
27 create_snapshot ${CLUSTER1} ${POOL} ${image} ${snap_id}
28 done
29
30 testlog "TEST: wait for snapshots"
31 for image in $(rbd --cluster ${CLUSTER1} --pool ${POOL} ls); do
32 wait_for_snap_present ${CLUSTER2} ${POOL} ${image} ${snap_id}
33 done
34
35 testlog "TEST: compare image snapshots"
36 for image in $(rbd --cluster ${CLUSTER1} --pool ${POOL} ls); do
37 compare_image_snapshots ${POOL} ${image}
38 done