summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-12-21 11:37:12 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-12-23 09:13:20 +0800
commit28138dafcc391b0d03633ee9c8e23ebc229842ba (patch)
treed373363d0d597c9e937afb3b4b6865f9950b645e /test
parent5c6b5ef34905f40562b518799c35be8d06694e65 (diff)
downloadpodman-28138dafcc391b0d03633ee9c8e23ebc229842ba.tar.gz
podman-28138dafcc391b0d03633ee9c8e23ebc229842ba.tar.bz2
podman-28138dafcc391b0d03633ee9c8e23ebc229842ba.zip
Fix missing options in volumes display while setting uid and gid
``` $ podman volume create testvol --opt o=uid=1001,gid=1001 $ ./bin/podman volume create testvol2 --opt o=uid=1001,gid=1001 $ podman volume inspect testvol "Options": {}, $ podman volume inspect testvol2 "Options": { "GID": "1001", "UID": "1001", "o": "uid=1001,gid=1001" }, ``` Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/volume_create_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/e2e/volume_create_test.go b/test/e2e/volume_create_test.go
index 8c44e57e4..544532ee0 100644
--- a/test/e2e/volume_create_test.go
+++ b/test/e2e/volume_create_test.go
@@ -82,5 +82,13 @@ var _ = Describe("Podman volume create", func() {
inspectGID.WaitWithDefaultTimeout()
Expect(inspectGID.ExitCode()).To(Equal(0))
Expect(inspectGID.OutputToString()).To(Equal(gid))
+
+ // options should containt `uid=3000,gid=4000:3000:4000`
+ optionFormat := `{{ .Options.o }}:{{ .Options.UID }}:{{ .Options.GID }}`
+ optionStrFormatExpect := fmt.Sprintf(`uid=%s,gid=%s:%s:%s`, uid, gid, uid, gid)
+ inspectOpts := podmanTest.Podman([]string{"volume", "inspect", "--format", optionFormat, volName})
+ inspectOpts.WaitWithDefaultTimeout()
+ Expect(inspectOpts.ExitCode()).To(Equal(0))
+ Expect(inspectOpts.OutputToString()).To(Equal(optionStrFormatExpect))
})
})