-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ZTS: Fix two bugs in the zpool dry run tests #17198
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
Conversation
Signed-off-by: Attila Fülöp <[email protected]>
Signed-off-by: Attila Fülöp <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for jumping on this. I was part-way through a very similar change late last night but I got tired and went to sleep instead 💤
Well, it's a matter of course, if I break things I should fix them. Sorry for the duplicate work. |
Bit hard to claim you broke it five years later :) But I appreciate the diligence! Incidentally, I've just been playing with this as maybe a useful library function: function capture_output {
typeset -n out=$1
typeset cmd=$2
shift 2
out=$($cmd $*)
}
typeset out
log_must capture_output out zpool status Seems to maybe solve both the need to capture output, and to ask for a test assert on the return value. But I'm just playing, haven't thought it through, and definitely not something this PR should block on I think. |
I like this idea, very elegant. The question would be where to put it. Adding a function which does what we need came to my mind as well, but I decided against it since it would just be used in four places. But that's something to think of tomorrow, it's bedtime in my timezone. |
There is a function Since this PR has already two reviews (thanks!) I'd prefer not to delay merging and to follow-up later. |
Motivation and Context
The output changes in #17045 broke the zpool dry run tests. This PR fixes the failing tests.
Description
Rework the tests to not depend on log output format. While here, fix a bug where "\n" was printed literally, not as a line break as intended.
How Has This Been Tested?
I've run the modified tests manually forcing test failures by editing the tests accordingly.
Types of changes
Checklist:
Signed-off-by
.