diff options
author | Kinga Stefaniuk <kinga.stefaniuk@intel.com> | 2024-10-10 08:35:46 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-11-13 14:17:35 +0100 |
commit | 478a2d477a2a0462d37fa87b8a494c8bb706956e (patch) | |
tree | 629a64478224724b12d2c19afb3e7dee9fb66863 | |
parent | imsm: add print license for VMD (diff) | |
download | mdadm-478a2d477a2a0462d37fa87b8a494c8bb706956e.tar.xz mdadm-478a2d477a2a0462d37fa87b8a494c8bb706956e.zip |
Fix 07reshape5initr test
This test could hang if "check" action is not written to sync_action. If
this value didn't appear, test hanged on infinite while loop. Add 5
second timeout to loop.
Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
-rw-r--r-- | tests/07reshape5intr | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/07reshape5intr b/tests/07reshape5intr index 0f4803ac..2af29101 100644 --- a/tests/07reshape5intr +++ b/tests/07reshape5intr @@ -31,7 +31,21 @@ do echo 1000 > /proc/sys/dev/raid/speed_limit_min echo 2000 > /proc/sys/dev/raid/speed_limit_max check wait - while ! echo check > /sys/block/md0/md/sync_action; do sleep 0.1; done + + max=5 + + for ((i = 0 ; i < max ; i++ )); do + if [[ $(echo check > /sys/block/md0/md/sync_action) != 0 ]]; then + break; + fi + sleep 1 + done + + if [[ i == max ]]; then + echo >&2 "Timeout waiting for check to succeed" + exit 1 + fi + check wait mm=`cat /sys/block/md0/md/mismatch_cnt` if [ $mm -gt 0 ] |