mirror of
https://github.com/containers/podman.git
synced 2025-12-05 12:52:12 +08:00
Merge pull request #16243 from alexlarsson/volume-create-ignore
Add podman volume create --ignore
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
## assert-key-is Unit RequiresMountsFor "%t/containers"
|
||||
## assert-key-is Service Type oneshot
|
||||
## assert-key-is Service RemainAfterExit yes
|
||||
## assert-key-is Service ExecCondition '/usr/bin/bash -c "! /usr/bin/podman volume exists systemd-basic"'
|
||||
## assert-key-is Service ExecStart "/usr/bin/podman volume create systemd-basic"
|
||||
## assert-key-is Service ExecStart "/usr/bin/podman volume create --ignore systemd-basic"
|
||||
## assert-key-is Service SyslogIdentifier "%N"
|
||||
|
||||
[Volume]
|
||||
|
||||
@@ -58,6 +58,28 @@ var _ = Describe("Podman volume create", func() {
|
||||
Expect(check.OutputToStringArray()).To(HaveLen(1))
|
||||
})
|
||||
|
||||
It("podman create volume with existing name fails", func() {
|
||||
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"volume", "create", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
})
|
||||
|
||||
It("podman create volume --ignore", func() {
|
||||
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
volName := session.OutputToString()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"volume", "create", "--ignore", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(Equal(volName))
|
||||
})
|
||||
|
||||
It("podman create and export volume", func() {
|
||||
if podmanTest.RemoteTest {
|
||||
Skip("Volume export check does not work with a remote client")
|
||||
|
||||
Reference in New Issue
Block a user