diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-21 15:57:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-21 15:57:23 +0200 |
commit | 500ad31d1bd1aee1458b17f05c2dfb7937786e87 (patch) | |
tree | a9089a812472cc69c68b404529a562c40ea56557 | |
parent | e9b344266a563a3dfcf693fc817f6b8cc0b7d815 (diff) | |
parent | 37ecff9157acc361b373c5c98c18d5f2e9af19fd (diff) | |
download | podman-500ad31d1bd1aee1458b17f05c2dfb7937786e87.tar.gz podman-500ad31d1bd1aee1458b17f05c2dfb7937786e87.tar.bz2 podman-500ad31d1bd1aee1458b17f05c2dfb7937786e87.zip |
Merge pull request #6307 from baude/v2remoteinit
enable remote integration tests for init
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 6 | ||||
-rw-r--r-- | test/e2e/init_test.go | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 828bfae5b..dcaac99f2 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -4,6 +4,7 @@ import ( "context" "io" "os" + "strings" "github.com/containers/common/pkg/config" "github.com/containers/image/v5/docker/reference" @@ -405,6 +406,11 @@ func (ic *ContainerEngine) ContainerInit(ctx context.Context, namesOrIds []strin } for _, ctr := range ctrs { err := containers.ContainerInit(ic.ClientCxt, ctr.ID) + // When using all, it is NOT considered an error if a container + // has already been init'd. + if err != nil && options.All && strings.Contains(errors.Cause(err).Error(), define.ErrCtrStateInvalid.Error()) { + err = nil + } reports = append(reports, &entities.ContainerInitReport{ Err: err, Id: ctr.ID, diff --git a/test/e2e/init_test.go b/test/e2e/init_test.go index 349487b03..721017d0c 100644 --- a/test/e2e/init_test.go +++ b/test/e2e/init_test.go @@ -90,7 +90,6 @@ var _ = Describe("Podman init", func() { }) It("podman init all three containers, one running", func() { - Skip(v2remotefail) session := podmanTest.Podman([]string{"create", "--name", "test1", "-d", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -121,11 +120,10 @@ var _ = Describe("Podman init", func() { }) It("podman init running container errors", func() { - Skip(v2remotefail) - session := podmanTest.Podman([]string{"run", "-d", ALPINE, "top"}) + session := podmanTest.Podman([]string{"run", "--name", "init_test", "-d", ALPINE, "top"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - init := podmanTest.Podman([]string{"init", "--latest"}) + init := podmanTest.Podman([]string{"init", "init_test"}) init.WaitWithDefaultTimeout() Expect(init.ExitCode()).To(Equal(125)) }) |