mirror of
https://github.com/containers/podman.git
synced 2025-07-26 09:58:36 +08:00
generate systemd: add --start-timeout flag
Add a new flag to set the start timeout for a generated systemd unit. To make naming consistent, add a new --stop-timeout flag as well and let the previous --time map to it. Fixes: #11618 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
cmd/podman/generate
docs/source/markdown
pkg
api
bindings/generate
domain
systemd/generate
test
@ -147,6 +147,15 @@ var _ = Describe("Podman generate systemd", func() {
|
||||
session := podmanTest.Podman([]string{"generate", "systemd", "--time", "5", "nginx"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("TimeoutStopSec=65"))
|
||||
Expect(session.OutputToString()).ToNot(ContainSubstring("TimeoutStartSec="))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("podman stop -t 5"))
|
||||
|
||||
session = podmanTest.Podman([]string{"generate", "systemd", "--stop-timeout", "5", "--start-timeout", "123", "nginx"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("TimeoutStartSec=123"))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("TimeoutStopSec=65"))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("podman stop -t 5"))
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user