Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix remote test --ignore & turn on more tests #6485

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/domain/infra/tunnel/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
reports []*entities.StopReport
)
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
if err != nil {
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchCtr) {
return nil, err
}
for _, c := range ctrs {
Expand Down Expand Up @@ -172,7 +172,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string,
namesOrIds = append(namesOrIds, id)
}
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
if err != nil {
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchCtr) {
return nil, err
}
// TODO there is no endpoint for container eviction. Need to discuss
Expand Down
5 changes: 3 additions & 2 deletions pkg/domain/infra/tunnel/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tunnel
import (
"context"

"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/pkg/bindings/pods"
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/specgen"
Expand Down Expand Up @@ -89,7 +90,7 @@ func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opt
timeout int = -1
)
foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds)
if err != nil {
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) {
return nil, err
}
if options.Timeout != -1 {
Expand Down Expand Up @@ -155,7 +156,7 @@ func (ic *ContainerEngine) PodStart(ctx context.Context, namesOrIds []string, op
func (ic *ContainerEngine) PodRm(ctx context.Context, namesOrIds []string, options entities.PodRmOptions) ([]*entities.PodRmReport, error) {
var reports []*entities.PodRmReport
foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds)
if err != nil {
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) {
return nil, err
}
for _, p := range foundPods {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/pod_rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ var _ = Describe("Podman pod rm", func() {
})

It("podman rm --ignore bogus pod and a running pod", func() {
SkipIfRemote()

_, ec, podid1 := podmanTest.CreatePod("")
Expect(ec).To(Equal(0))
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/pod_stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ var _ = Describe("Podman pod stop", func() {
})

It("podman pod stop --ignore bogus pod", func() {
SkipIfRemote()

session := podmanTest.Podman([]string{"pod", "stop", "--ignore", "123"})
session.WaitWithDefaultTimeout()
Expand All @@ -60,7 +59,6 @@ var _ = Describe("Podman pod stop", func() {
})

It("podman stop --ignore bogus pod and a running pod", func() {
SkipIfRemote()

_, ec, podid1 := podmanTest.CreatePod("")
Expect(ec).To(Equal(0))
Expand Down
1 change: 0 additions & 1 deletion test/e2e/rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ var _ = Describe("Podman rm", func() {
})

It("podman rm --ignore bogus container and a running container", func() {
SkipIfRemote()

session := podmanTest.RunTopContainer("test1")
session.WaitWithDefaultTimeout()
Expand Down