-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix podman system df format error #7156
fix podman system df format error #7156
Conversation
Nice work! Please apply this patch and resubmit. Don't bother waiting for CI, it will fail without this patch. index a96507448..217357b37 100644
--- a/test/system/320-system-df.bats
+++ b/test/system/320-system-df.bats
@@ -24,9 +24,10 @@ function teardown() {
run_podman run -d -v /myvol2 --name c2 $IMAGE \
sh -c 'while ! test -e /stop; do sleep 0.1;done'
- run_podman system df --format '{{ .Type }}:{{ .Total }}:{{ .Active }}--'
- # FIXME: if/when #7149 gets fixed, split this into three tests (i.e. test "${lines[0]}", [1], [2] )
- is "$output" "Images:1:1--Containers:2:1--Local Volumes:2:1--"
+ run_podman system df --format '{{ .Type }}:{{ .Total }}:{{ .Active }}'
+ is "${lines[0]}" "Images:1:1" "system df : Images line"
+ is "${lines[1]}" "Containers:2:1" "system df : Containers line"
+ is "${lines[2]}" "Local Volumes:2:1" "system df : Volumes line"
# Try -v. (Grrr. No way to specify individual formats)
# |
Oh, and you have to use exact syntax for github to understand that this fixes an existing issue. In your PR description, change "fix" to "Fixes:". Thanks again! |
all has be done |
test/e2e/system_df_test.go
Outdated
session.WaitWithDefaultTimeout() | ||
Expect(session.ExitCode()).To(Equal(0)) | ||
// if userFmt is set, so there is no header, it will be 3 | ||
Expect(len(session.OutputToStringArray())).To(Equal(3)) |
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.
I know everyone is tired of hearing me say it, but this is not really a test. "Number of lines of output" is really pretty useless and just gives false confidence. Worse, there is no point to creating a volume or container here because none of that is checked. It just adds to test run time needlessly.
I would recommend scratching this and just relying on the system test. If there is a strong need to stick with e2e tests, please at least add actual validation of the output.
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.
Tend to agree, given this is just a duplication of the system test.
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.
all has be done
adf412f
to
4df4da4
Compare
Signed-off-by: zhangguanzhang <[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.
LGTM - it has the desired effect, including with \t
and -- should anyone ever need this in circumstances beyond my imagination -- \a
. I don't want to give the final slash-lgtm though.
Thank you so much for taking this on and for your quick response on my feedback!
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, rhatdan, zhangguanzhang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Signed-off-by: zhangguanzhang [email protected]
Fixes: #7149