From 83d5830f452afe52028ff8e50d1d17af522afb47 Mon Sep 17 00:00:00 2001 From: bskjois Date: Thu, 6 Apr 2017 15:08:58 +0530 Subject: [PATCH] Fixed kpartx delete partition mapping test Problem Description : After executing the kpartx -d command, there was a minor delay to capture the required string hence the failure occurred. Fix : Modified the code to wait for max 10 seconds to get the string and then continue with the execution. Signed-off By: Kowshik Jois --- linux-tools/kpartx/kpartx.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-tools/kpartx/kpartx.sh b/linux-tools/kpartx/kpartx.sh index c8373ad77..7119cc789 100755 --- a/linux-tools/kpartx/kpartx.sh +++ b/linux-tools/kpartx/kpartx.sh @@ -86,7 +86,8 @@ function run_kpartx_tests() tc_register "Test kpartx -d" kpartx -d $kpartx_img >$stdout 2>$stderr - grep "loop deleted" $stdout | grep -q /dev/$loopdev + # wait for max 10 sec to update + tc_wait_for_file_text $stdout "loop deleted : /dev/$loopdev" tc_fail_if_bad $? "kpartx -d fail1" || return loopdev_free=`losetup -f | cut -d '/' -f3` test $loopdev == $loopdev_free