summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-21 02:06:56 +0200
committerGitHub <noreply@github.com>2020-05-21 02:06:56 +0200
commit8db7b9ea219ef06c50919dcfabdfdca5676e1456 (patch)
treeb0072940f318fbe34f6ee33750d61f320509eb15
parent02b29db3b7f9d2c9fd2342b00f0c1a9a7041779b (diff)
parent2624c043d1b8aef69355616037ee2305298bd08a (diff)
downloadpodman-8db7b9ea219ef06c50919dcfabdfdca5676e1456.tar.gz
podman-8db7b9ea219ef06c50919dcfabdfdca5676e1456.tar.bz2
podman-8db7b9ea219ef06c50919dcfabdfdca5676e1456.zip
Merge pull request #6284 from baude/v2remotetestfixes
Test fixes for remote integration
-rw-r--r--cmd/podman/containers/create.go4
-rw-r--r--cmd/podman/containers/rm.go2
-rw-r--r--pkg/bindings/images/images.go2
-rw-r--r--pkg/domain/infra/tunnel/images.go1
-rw-r--r--pkg/domain/infra/tunnel/manifest.go31
-rw-r--r--test/e2e/common_test.go2
-rw-r--r--test/e2e/create_test.go4
-rw-r--r--test/e2e/images_test.go10
-rw-r--r--test/e2e/kill_test.go2
-rw-r--r--test/e2e/manifest_test.go4
-rw-r--r--test/e2e/pause_test.go3
-rw-r--r--test/e2e/save_test.go1
-rw-r--r--test/e2e/stop_test.go1
-rw-r--r--test/e2e/untag_test.go2
14 files changed, 22 insertions, 47 deletions
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index 5058cdfe5..bb6cb5fdd 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -6,6 +6,8 @@ import (
"os"
"strings"
+ "github.com/containers/libpod/libpod/define"
+
"github.com/containers/common/pkg/config"
"github.com/containers/libpod/cmd/podman/common"
"github.com/containers/libpod/cmd/podman/registry"
@@ -203,7 +205,7 @@ func pullImage(imageName string) error {
}
if !br.Value || pullPolicy == config.PullImageAlways {
if pullPolicy == config.PullImageNever {
- return errors.New("unable to find a name and tag match for busybox in repotags: no such image")
+ return errors.Wrapf(define.ErrNoSuchImage, "unable to find a name and tag match for %s in repotags", imageName)
}
_, pullErr := registry.ImageEngine().Pull(registry.GetContext(), imageName, entities.ImagePullOptions{
Authfile: cliVals.Authfile,
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go
index 5ef2e23be..f01462447 100644
--- a/cmd/podman/containers/rm.go
+++ b/cmd/podman/containers/rm.go
@@ -128,5 +128,7 @@ func setExitCode(err error) {
registry.SetExitCode(1)
case cause == define.ErrCtrStateInvalid:
registry.SetExitCode(2)
+ case strings.Contains(cause.Error(), define.ErrCtrStateInvalid.Error()):
+ registry.SetExitCode(2)
}
}
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index a15ce56e5..69b9e9bbf 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -146,7 +146,7 @@ func Export(ctx context.Context, nameOrID string, w io.Writer, format *string, c
_, err = io.Copy(w, response.Body)
return err
}
- return nil
+ return response.Process(nil)
}
// Prune removes unused images from local storage. The optional filters can be used to further
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go
index 5a849d362..4d00d331b 100644
--- a/pkg/domain/infra/tunnel/images.go
+++ b/pkg/domain/infra/tunnel/images.go
@@ -190,7 +190,6 @@ func (ir *ImageEngine) Save(ctx context.Context, nameOrId string, tags []string,
f *os.File
err error
)
-
switch options.Format {
case "oci-dir", "docker-dir":
f, err = ioutil.TempFile("", "podman_save")
diff --git a/pkg/domain/infra/tunnel/manifest.go b/pkg/domain/infra/tunnel/manifest.go
index 9c1f5349a..beac378fe 100644
--- a/pkg/domain/infra/tunnel/manifest.go
+++ b/pkg/domain/infra/tunnel/manifest.go
@@ -57,46 +57,21 @@ func (ir *ImageEngine) ManifestAdd(ctx context.Context, opts entities.ManifestAd
}
manifestAddOpts.Annotation = annotations
}
- listID, err := manifests.Add(ctx, opts.Images[1], manifestAddOpts)
+ listID, err := manifests.Add(ir.ClientCxt, opts.Images[1], manifestAddOpts)
if err != nil {
return listID, errors.Wrapf(err, "error adding to manifest list %s", opts.Images[1])
}
return listID, nil
}
-// FIXME There is no endpoint for annotate and therefor this code is currently invalid
// ManifestAnnotate updates an entry of the manifest list
func (ir *ImageEngine) ManifestAnnotate(ctx context.Context, names []string, opts entities.ManifestAnnotateOptions) (string, error) {
return "", errors.New("not implemented")
- // manifestAnnotateOpts := image.ManifestAnnotateOpts{
- // Arch: opts.Arch,
- // Features: opts.Features,
- // OS: opts.OS,
- // OSFeatures: opts.OSFeatures,
- // OSVersion: opts.OSVersion,
- // Variant: opts.Variant,
- // }
- // if len(opts.Annotation) > 0 {
- // annotations := make(map[string]string)
- // for _, annotationSpec := range opts.Annotation {
- // spec := strings.SplitN(annotationSpec, "=", 2)
- // if len(spec) != 2 {
- // return "", errors.Errorf("no value given for annotation %q", spec[0])
- // }
- // annotations[spec[0]] = spec[1]
- // }
- // manifestAnnotateOpts.Annotation = annotations
- // }
- // updatedListID, err := manifests.Annotate(ctx, names[0], names[1], manifestAnnotateOpts)
- // if err != nil {
- // return updatedListID, errors.Wrapf(err, "error annotating %s of manifest list %s", names[1], names[0])
- // }
- // return fmt.Sprintf("%s :%s", updatedListID, names[1]), nil
}
// ManifestRemove removes the digest from manifest list
func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (string, error) {
- updatedListID, err := manifests.Remove(ctx, names[0], names[1])
+ updatedListID, err := manifests.Remove(ir.ClientCxt, names[0], names[1])
if err != nil {
return updatedListID, errors.Wrapf(err, "error removing from manifest %s", names[0])
}
@@ -105,6 +80,6 @@ func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (stri
// ManifestPush pushes a manifest list or image index to the destination
func (ir *ImageEngine) ManifestPush(ctx context.Context, names []string, opts entities.ManifestPushOptions) error {
- _, err := manifests.Push(ctx, names[0], &names[1], &opts.All)
+ _, err := manifests.Push(ir.ClientCxt, names[0], &names[1], &opts.All)
return err
}
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 6d6f1762d..80ee83f44 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -35,7 +35,7 @@ var (
INTEGRATION_ROOT string
CGROUP_MANAGER = "systemd"
ARTIFACT_DIR = "/tmp/.artifacts"
- RESTORE_IMAGES = []string{ALPINE, BB}
+ RESTORE_IMAGES = []string{ALPINE, BB, nginx}
defaultWaitTimeout = 90
)
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 9cdbe6287..7d4858551 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -235,11 +235,11 @@ var _ = Describe("Podman create", func() {
})
It("podman create --pull", func() {
- session := podmanTest.PodmanNoCache([]string{"create", "--pull", "never", "--name=foo", "nginx"})
+ session := podmanTest.PodmanNoCache([]string{"create", "--pull", "never", "--name=foo", "debian"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
- session = podmanTest.PodmanNoCache([]string{"create", "--pull", "always", "--name=foo", "nginx"})
+ session = podmanTest.PodmanNoCache([]string{"create", "--pull", "always", "--name=foo", "debian"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index 542f7f1e1..cd281e3c7 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -90,7 +90,7 @@ var _ = Describe("Podman images", func() {
session = podmanTest.PodmanNoCache([]string{"images", "-qn"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(len(session.OutputToStringArray())).To(BeNumerically("==", 2))
+ Expect(len(session.OutputToStringArray())).To(BeNumerically("==", 3))
})
It("podman images with digests", func() {
@@ -164,13 +164,13 @@ var _ = Describe("Podman images", func() {
retapline := podmanTest.PodmanNoCache([]string{"images", "-f", "reference=a*pine"})
retapline.WaitWithDefaultTimeout()
Expect(retapline).Should(Exit(0))
- Expect(len(retapline.OutputToStringArray())).To(Equal(2))
+ Expect(len(retapline.OutputToStringArray())).To(Equal(3))
Expect(retapline.LineInOutputContains("alpine")).To(BeTrue())
retapline = podmanTest.PodmanNoCache([]string{"images", "-f", "reference=alpine"})
retapline.WaitWithDefaultTimeout()
Expect(retapline).Should(Exit(0))
- Expect(len(retapline.OutputToStringArray())).To(Equal(2))
+ Expect(len(retapline.OutputToStringArray())).To(Equal(3))
Expect(retapline.LineInOutputContains("alpine")).To(BeTrue())
retnone := podmanTest.PodmanNoCache([]string{"images", "-q", "-f", "reference=bogus"})
@@ -321,12 +321,12 @@ ENV foo=bar
session := podmanTest.PodmanNoCache([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(len(session.OutputToStringArray())).To(Equal(4))
+ Expect(len(session.OutputToStringArray())).To(Equal(5))
session2 := podmanTest.PodmanNoCache([]string{"images", "--all"})
session2.WaitWithDefaultTimeout()
Expect(session2).Should(Exit(0))
- Expect(len(session2.OutputToStringArray())).To(Equal(6))
+ Expect(len(session2.OutputToStringArray())).To(Equal(7))
})
It("podman images filter by label", func() {
diff --git a/test/e2e/kill_test.go b/test/e2e/kill_test.go
index b0f9cd900..3f192fb55 100644
--- a/test/e2e/kill_test.go
+++ b/test/e2e/kill_test.go
@@ -100,7 +100,7 @@ var _ = Describe("Podman kill", func() {
})
It("podman kill latest container", func() {
- Skip(v2remotefail)
+ SkipIfRemote()
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go
index a1decde7d..c47e20276 100644
--- a/test/e2e/manifest_test.go
+++ b/test/e2e/manifest_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman manifest", func() {
)
BeforeEach(func() {
- Skip(v2remotefail)
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -103,6 +102,7 @@ var _ = Describe("Podman manifest", func() {
})
It("podman manifest annotate", func() {
+ SkipIfRemote()
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -155,6 +155,7 @@ var _ = Describe("Podman manifest", func() {
})
It("podman manifest push", func() {
+ Skip(v2remotefail)
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -184,6 +185,7 @@ var _ = Describe("Podman manifest", func() {
})
It("podman manifest push purge", func() {
+ Skip(v2remotefail)
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index 162138a43..2faa4bc3f 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -132,7 +132,6 @@ var _ = Describe("Podman pause", func() {
})
It("podman remove a paused container by id without force", func() {
- Skip(v2remotefail)
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -175,7 +174,6 @@ var _ = Describe("Podman pause", func() {
})
It("podman stop a paused container by id", func() {
- Skip(v2remotefail)
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -272,7 +270,6 @@ var _ = Describe("Podman pause", func() {
})
It("Pause a bunch of running containers", func() {
- Skip(v2remotefail)
for i := 0; i < 3; i++ {
name := fmt.Sprintf("test%d", i)
run := podmanTest.Podman([]string{"run", "-dt", "--name", name, nginx})
diff --git a/test/e2e/save_test.go b/test/e2e/save_test.go
index 69454f6a9..aaa5ae180 100644
--- a/test/e2e/save_test.go
+++ b/test/e2e/save_test.go
@@ -68,7 +68,6 @@ var _ = Describe("Podman save", func() {
})
It("podman save bogus image", func() {
- Skip(v2remotefail)
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
save := podmanTest.PodmanNoCache([]string{"save", "-o", outfile, "FOOBAR"})
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index 8c845e90a..8e49e3bd0 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -198,7 +198,6 @@ var _ = Describe("Podman stop", func() {
})
It("podman stop all containers with one stopped", func() {
- Skip(v2remotefail)
session := podmanTest.RunTopContainer("test1")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/untag_test.go b/test/e2e/untag_test.go
index c61f57a9c..43b874d47 100644
--- a/test/e2e/untag_test.go
+++ b/test/e2e/untag_test.go
@@ -59,7 +59,7 @@ var _ = Describe("Podman untag", func() {
results := podmanTest.PodmanNoCache([]string{"images"})
results.WaitWithDefaultTimeout()
Expect(results.ExitCode()).To(Equal(0))
- Expect(results.OutputToStringArray()).To(HaveLen(5))
+ Expect(results.OutputToStringArray()).To(HaveLen(6))
Expect(results.LineInOuputStartsWith("docker.io/library/alpine")).To(BeTrue())
Expect(results.LineInOuputStartsWith("localhost/foo")).To(BeTrue())
Expect(results.LineInOuputStartsWith("localhost/bar")).To(BeTrue())