Skip to content

Conversation

@bskjois
Copy link
Contributor

@bskjois bskjois commented Apr 6, 2017

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 10 seconds to get the string and then continue with the execution.

Signed-off By: Kowshik Jois [email protected]

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 <[email protected]>
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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants