Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed kpartx delete partition mapping test #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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]>
@@ -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"

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