From 1f2d30cbb735d2c7fd3eea6431f1a1e9555d5942 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Mon, 3 Oct 2016 10:10:33 +0300 Subject: [PATCH] qa/workunits/rbd: check status also in pool dir after asok commands wait_for_image_replay_stopped returns not when the state is stopped, but when the state is not replaying. So a race was possible when an asok command was running when the previos stop command was still in progress, leading to unexpected results. Signed-off-by: Mykola Golub (cherry picked from commit 2882f8c01a42ee3cfe22a838b64f21c93cf84d16) Conflicts: qa/workunits/rbd/rbd_mirror.sh (tests for not backported features) --- qa/workunits/rbd/rbd_mirror.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index 560f909a00b..5fa138a697d 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -46,34 +46,50 @@ testlog "TEST: stop/start/restart mirror via admin socket" admin_daemon ${CLUSTER1} rbd mirror stop wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped' admin_daemon ${CLUSTER1} rbd mirror start wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror restart wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror stop wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped' admin_daemon ${CLUSTER1} rbd mirror restart wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror stop ${POOL} ${CLUSTER2} wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+stopped' admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror start wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror start ${POOL} ${CLUSTER2} +wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror restart ${POOL}/${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} @@ -81,6 +97,8 @@ wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} admin_daemon ${CLUSTER1} rbd mirror restart ${POOL} ${CLUSTER2} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror flush admin_daemon ${CLUSTER1} rbd mirror status -- 2.47.3