mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +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).
|
||||
func (p *PodmanTestIntegration) PodmanExitCleanly(args ...string) *PodmanSessionIntegration {
|
||||
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()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
return session
|
||||
|
@ -457,11 +457,9 @@ var _ = Describe("Podman exec", func() {
|
||||
files := []*os.File{
|
||||
devNull,
|
||||
}
|
||||
session := podmanTest.PodmanWithOptions(PodmanExecOptions{
|
||||
podmanTest.PodmanExitCleanlyWithOptions(PodmanExecOptions{
|
||||
ExtraFiles: files,
|
||||
}, "exec", "--preserve-fds", "1", "test1", "ls")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman exec preserves --group-add groups", func() {
|
||||
|
Reference in New Issue
Block a user