mirror of
https://github.com/containers/podman.git
synced 2025-05-19 16:18:51 +08:00
Define, and use, PodmanExitCleanlyWithOptions
This is a generalization of PodmanExitCleanly, scalable to an arbitrary number of possible options. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@ -492,7 +492,14 @@ func (s *PodmanSessionIntegration) InspectImageJSON() []inspect.ImageData {
|
|||||||
// It returns the session (to allow consuming output if desired).
|
// It returns the session (to allow consuming output if desired).
|
||||||
func (p *PodmanTestIntegration) PodmanExitCleanly(args ...string) *PodmanSessionIntegration {
|
func (p *PodmanTestIntegration) PodmanExitCleanly(args ...string) *PodmanSessionIntegration {
|
||||||
GinkgoHelper()
|
GinkgoHelper()
|
||||||
session := p.Podman(args)
|
return p.PodmanExitCleanlyWithOptions(PodmanExecOptions{}, args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PodmanExitCleanlyWithOptions runs a podman command with (optinos, args), and expects it to ExitCleanly within the default timeout.
|
||||||
|
// It returns the session (to allow consuming output if desired).
|
||||||
|
func (p *PodmanTestIntegration) PodmanExitCleanlyWithOptions(options PodmanExecOptions, args ...string) *PodmanSessionIntegration {
|
||||||
|
GinkgoHelper()
|
||||||
|
session := p.PodmanWithOptions(options, args...)
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
return session
|
return session
|
||||||
|
@ -457,11 +457,9 @@ var _ = Describe("Podman exec", func() {
|
|||||||
files := []*os.File{
|
files := []*os.File{
|
||||||
devNull,
|
devNull,
|
||||||
}
|
}
|
||||||
session := podmanTest.PodmanWithOptions(PodmanExecOptions{
|
podmanTest.PodmanExitCleanlyWithOptions(PodmanExecOptions{
|
||||||
ExtraFiles: files,
|
ExtraFiles: files,
|
||||||
}, "exec", "--preserve-fds", "1", "test1", "ls")
|
}, "exec", "--preserve-fds", "1", "test1", "ls")
|
||||||
session.WaitWithDefaultTimeout()
|
|
||||||
Expect(session).Should(ExitCleanly())
|
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec preserves --group-add groups", func() {
|
It("podman exec preserves --group-add groups", func() {
|
||||||
|
Reference in New Issue
Block a user