mirror of
https://github.com/containers/podman.git
synced 2025-06-21 09:28:09 +08:00
Merge pull request #6330 from rhatdan/start
Fix podman-remote start tests
This commit is contained in:
@ -372,7 +372,11 @@ func startAndAttach(ic *ContainerEngine, name string, detachKeys *string, input,
|
|||||||
func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []string, options entities.ContainerStartOptions) ([]*entities.ContainerStartReport, error) {
|
func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []string, options entities.ContainerStartOptions) ([]*entities.ContainerStartReport, error) {
|
||||||
var reports []*entities.ContainerStartReport
|
var reports []*entities.ContainerStartReport
|
||||||
for _, name := range namesOrIds {
|
for _, name := range namesOrIds {
|
||||||
report := entities.ContainerStartReport{Id: name}
|
report := entities.ContainerStartReport{
|
||||||
|
Id: name,
|
||||||
|
RawInput: name,
|
||||||
|
ExitCode: 125,
|
||||||
|
}
|
||||||
if options.Attach {
|
if options.Attach {
|
||||||
report.Err = startAndAttach(ic, name, &options.DetachKeys, options.Stdin, options.Stdout, options.Stderr)
|
report.Err = startAndAttach(ic, name, &options.DetachKeys, options.Stdin, options.Stdout, options.Stderr)
|
||||||
if report.Err == nil {
|
if report.Err == nil {
|
||||||
|
@ -40,7 +40,6 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman start single container by id", func() {
|
It("podman start single container by id", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
session := podmanTest.Podman([]string{"create", "-d", ALPINE, "ls"})
|
session := podmanTest.Podman([]string{"create", "-d", ALPINE, "ls"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
@ -51,7 +50,6 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman container start single container by id", func() {
|
It("podman container start single container by id", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
|
session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
@ -63,7 +61,6 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman container start single container by short id", func() {
|
It("podman container start single container by short id", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
|
session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
@ -123,12 +120,11 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman failed to start with --rm should delete the container", func() {
|
It("podman failed to start with --rm should delete the container", func() {
|
||||||
SkipIfRemote()
|
session := podmanTest.Podman([]string{"create", "--name", "test1", "-it", "--rm", ALPINE, "foo"})
|
||||||
session := podmanTest.Podman([]string{"create", "-it", "--rm", ALPINE, "foo"})
|
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
|
||||||
start := podmanTest.Podman([]string{"start", "-l"})
|
start := podmanTest.Podman([]string{"start", "test1"})
|
||||||
start.WaitWithDefaultTimeout()
|
start.WaitWithDefaultTimeout()
|
||||||
Expect(start).To(ExitWithError())
|
Expect(start).To(ExitWithError())
|
||||||
|
|
||||||
@ -136,12 +132,11 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman failed to start without --rm should NOT delete the container", func() {
|
It("podman failed to start without --rm should NOT delete the container", func() {
|
||||||
SkipIfRemote()
|
|
||||||
session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
|
session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
|
|
||||||
start := podmanTest.Podman([]string{"start", "-l"})
|
start := podmanTest.Podman([]string{"start", session.OutputToString()})
|
||||||
start.WaitWithDefaultTimeout()
|
start.WaitWithDefaultTimeout()
|
||||||
Expect(start).To(ExitWithError())
|
Expect(start).To(ExitWithError())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user