diff options
author | Charlie Doern <cdoern@redhat.com> | 2022-06-28 09:49:44 -0400 |
---|---|---|
committer | Charlie Doern <cdoern@redhat.com> | 2022-06-28 10:09:38 -0400 |
commit | 6c4c050d3df4f4e952273891bddfeb5b5bd8be5e (patch) | |
tree | add21fe8a6f35c9b12796f24c0bfb02c1147666b /test | |
parent | 4274906a80c830492e0634602350c1626288e968 (diff) | |
download | podman-6c4c050d3df4f4e952273891bddfeb5b5bd8be5e.tar.gz podman-6c4c050d3df4f4e952273891bddfeb5b5bd8be5e.tar.bz2 podman-6c4c050d3df4f4e952273891bddfeb5b5bd8be5e.zip |
fix volume reporting in system df
currently, podman system df incorrectly calculates the reclaimable storage for
volumes, using a cumulative reclaimable variable that is incremented and placed into each
report entry causing values to rise above 100%.
Switch this variables to be in the context of the loop, so it resets per volume just like the size variable does.
resolves #13516
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/system_df_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/e2e/system_df_test.go b/test/e2e/system_df_test.go index 5a23fc0bb..712d16a6a 100644 --- a/test/e2e/system_df_test.go +++ b/test/e2e/system_df_test.go @@ -70,6 +70,17 @@ var _ = Describe("podman system df", func() { Expect(containers[1]).To(Equal("2"), "total containers expected") Expect(volumes[2]).To(Equal("2"), "total volumes expected") Expect(volumes[6]).To(Equal("(50%)"), "percentage usage expected") + + session = podmanTest.Podman([]string{"rm", "container1"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + session = podmanTest.Podman([]string{"system", "df"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + volumes = strings.Fields(session.OutputToStringArray()[3]) + // percentages on volumes were being calculated incorrectly. Make sure we only report 100% and not above + Expect(volumes[6]).To(Equal("(100%)"), "percentage usage expected") + }) It("podman system df image with no tag", func() { |