mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Merge pull request #6474 from QiWang19/remote-cidfile-test
Turn on remote rm_test
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -162,6 +163,14 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string,
|
|||||||
var (
|
var (
|
||||||
reports []*entities.RmReport
|
reports []*entities.RmReport
|
||||||
)
|
)
|
||||||
|
for _, cidFile := range options.CIDFiles {
|
||||||
|
content, err := ioutil.ReadFile(cidFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "error reading CIDFile %s", cidFile)
|
||||||
|
}
|
||||||
|
id := strings.Split(string(content), "\n")[0]
|
||||||
|
namesOrIds = append(namesOrIds, id)
|
||||||
|
}
|
||||||
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
|
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -141,7 +141,6 @@ var _ = Describe("Podman rm", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman rm --cidfile", func() {
|
It("podman rm --cidfile", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := ioutil.TempDir("", "")
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
@ -164,7 +163,6 @@ var _ = Describe("Podman rm", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman rm multiple --cidfile", func() {
|
It("podman rm multiple --cidfile", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "")
|
tmpDir, err := ioutil.TempDir("", "")
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
|
Reference in New Issue
Block a user