Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion linux-tools/kpartx/kpartx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can add the failure string that comes in stderr , it gives a better understanding why the change is required.
Few things:

  • Can we add a check for "kpartx -d" first ?
    kpartx -d $kpartx_img >$stdout 2>$stderr
    tc_fail_if_bad $? "kpartx -d failed" || return

  • Followed by verifying the expected message in stdout
    tc_wait_for_file_text $stdout "loop deleted : /dev/$loopdev"

Also correct the error mesage: "kpartx -d fail1"

loopdev_free=`losetup -f | cut -d '/' -f3`
test $loopdev == $loopdev_free
Expand Down