ZTS: Fix two bugs in the zpool dry run tests#17198
ZTS: Fix two bugs in the zpool dry run tests#17198AttilaFueloep wants to merge 2 commits intoopenzfs:masterfrom
Conversation
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
robn
left a comment
There was a problem hiding this comment.
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 statusSeems 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.