diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-25 18:22:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 18:22:50 +0000 |
commit | bb8e77d7f42ae361d11161239bd5c7ac6fa5d719 (patch) | |
tree | b5baf2651f434559093921a4948b1924682d3b6a | |
parent | 17db9851d05544ef49f8bce0deec452a99aae2a9 (diff) | |
parent | 65f2f1a7639eb5bc12e6c522c111be18786870c9 (diff) | |
download | podman-bb8e77d7f42ae361d11161239bd5c7ac6fa5d719.tar.gz podman-bb8e77d7f42ae361d11161239bd5c7ac6fa5d719.tar.bz2 podman-bb8e77d7f42ae361d11161239bd5c7ac6fa5d719.zip |
Merge pull request #7785 from mheon/backports_211
Backports for v2.1.1
74 files changed, 422 insertions, 221 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cabfafabb..7313a9456 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,25 @@ # Release Notes +## 2.1.1 +### Changes +- The `podman info` command now includes the cgroup manager Podman is using. + +### Bugfixes +- Fixed a bug where Podman would not build with the `varlink` build tag enabled. +- Fixed a bug where the `podman save` command could, when asked to save multiple images, write its progress bar to the archive instead of the terminal, producing a corrupted archive. +- Fixed a bug where the `json-file` log driver did not write logs. +- Fixed a bug where `podman-remote start --attach` did not properly handle detaching using the detach keys. +- Fixed a bug where `podman pod ps --filter label=...` did not work. +- Fixed a bug where the `podman build` command did not respect the `--runtime` flag. + +### API +- The REST API now includes a Server header in all responses. +- Fixed a bug where the Libpod and Compat Attach endpoints could terminate early, before sending all output from the container. +- Fixed a bug where the Compat Create endpoint for containers did not properly handle the Interactive parameter. +- Fixed a bug where the Compat Kill endpoint for containers could continue to run after a fatal error. +- Fixed a bug where the Limit parameter of the Compat List endpoint for Containers did not properly handle a limit of 0 (returning nothing, instead of all containers) ([#7722](https://github.com/containers/podman/issues/7722)). +- The Libpod Stats endpoint for containers is being deprecated and will be replaced by a similar endpoint with additional features in a future release. + ## 2.1.0 ### Features - A new command, `podman image mount`, has been added. This allows for an image to be mounted, read-only, to inspect its contents without creating a container from it ([#1433](https://github.com/containers/podman/issues/1433)). diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 00777c48c..d24bb18b6 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -436,6 +436,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil Quiet: flags.Quiet, RemoveIntermediateCtrs: flags.Rm, ReportWriter: reporter, + Runtime: containerConfig.RuntimePath, RuntimeArgs: runtimeFlags, SignBy: flags.SignBy, SignaturePolicyPath: flags.SignaturePolicy, diff --git a/cmd/podman/images/save.go b/cmd/podman/images/save.go index c57f61221..b164a2534 100644 --- a/cmd/podman/images/save.go +++ b/cmd/podman/images/save.go @@ -94,6 +94,7 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { return errors.Errorf("--compress can only be set when --format is either 'oci-dir' or 'docker-dir'") } if len(saveOpts.Output) == 0 { + saveOpts.Quiet = true fi := os.Stdout if terminal.IsTerminal(int(fi.Fd())) { return errors.Errorf("refusing to save to terminal. Use -o flag or redirect") @@ -122,12 +123,6 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { tags = args[1:] } - // Decide whether c/image's progress bars should use stderr or stdout. - // If the output is set of stdout, any log message there would corrupt - // the tarfile. - if saveOpts.Output == os.Stdout.Name() { - saveOpts.Quiet = true - } err := registry.ImageEngine().Save(context.Background(), args[0], tags, saveOpts) if err == nil { succeeded = true diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go index 97e528c7c..7b755cb22 100644 --- a/cmd/podman/pods/ps.go +++ b/cmd/podman/pods/ps.go @@ -73,7 +73,7 @@ func pods(cmd *cobra.Command, _ []string) error { if cmd.Flag("filter").Changed { psInput.Filters = make(map[string][]string) for _, f := range inputFilters { - split := strings.Split(f, "=") + split := strings.SplitN(f, "=", 2) if len(split) < 2 { return errors.Errorf("filter input must be in the form of filter=value: %s is invalid", f) } diff --git a/docs/source/markdown/podman-load.1.md b/docs/source/markdown/podman-load.1.md index 917f102f6..308a3493b 100644 --- a/docs/source/markdown/podman-load.1.md +++ b/docs/source/markdown/podman-load.1.md @@ -9,9 +9,11 @@ podman\-load - Load an image from a container image archive into container stora **podman image load** [*options*] [*name*[:*tag*]] ## DESCRIPTION -**podman load** loads an image from either an **oci-archive** or **docker-archive** stored on the local machine into container storage. **podman load** reads from stdin by default or a file if the **input** option is set. +**podman load** loads an image from either an **oci-archive** or a **docker-archive** stored on the local machine into container storage. **podman load** reads from stdin by default or a file if the **input** option is set. You can also specify a name for the image if the archive does not contain a named reference, of if you want an additional name for the local image. +The local client further supports loading an **oci-dir** or a **docker-dir** as created with **podman save** (1). + The **quiet** option suppresses the progress output when set. Note: `:` is a restricted character and cannot be part of the file name. diff --git a/libpod/define/info.go b/libpod/define/info.go index 47c53d067..f0e05801c 100644 --- a/libpod/define/info.go +++ b/libpod/define/info.go @@ -15,6 +15,7 @@ type Info struct { type HostInfo struct { Arch string `json:"arch"` BuildahVersion string `json:"buildahVersion"` + CgroupManager string `json:"cgroupManager"` CGroupsVersion string `json:"cgroupVersion"` Conmon *ConmonInfo `json:"conmon"` CPUs int `json:"cpus"` diff --git a/libpod/info.go b/libpod/info.go index 153000b6f..dd7a521c1 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -87,6 +87,7 @@ func (r *Runtime) hostInfo() (*define.HostInfo, error) { info := define.HostInfo{ Arch: runtime.GOARCH, BuildahVersion: buildah.Version, + CgroupManager: r.config.Engine.CgroupManager, Linkmode: linkmode.Linkmode(), CPUs: runtime.NumCPU(), Distribution: hostDistributionInfo, diff --git a/libpod/oci_conmon_exec_linux.go b/libpod/oci_conmon_exec_linux.go index c18da68fe..8651c1dc5 100644 --- a/libpod/oci_conmon_exec_linux.go +++ b/libpod/oci_conmon_exec_linux.go @@ -537,9 +537,6 @@ func attachExecHTTP(c *Container, sessionID string, r *http.Request, w http.Resp } }() - // Make a channel to pass errors back - errChan := make(chan error) - attachStdout := true attachStderr := true attachStdin := true @@ -580,13 +577,16 @@ func attachExecHTTP(c *Container, sessionID string, r *http.Request, w http.Resp hijackWriteErrorAndClose(deferredErr, c.ID(), isTerminal, httpCon, httpBuf) }() + stdoutChan := make(chan error) + stdinChan := make(chan error) + // Next, STDIN. Avoid entirely if attachStdin unset. if attachStdin { go func() { logrus.Debugf("Beginning STDIN copy") _, err := utils.CopyDetachable(conn, httpBuf, detachKeys) logrus.Debugf("STDIN copy completed") - errChan <- err + stdinChan <- err }() } @@ -613,19 +613,24 @@ func attachExecHTTP(c *Container, sessionID string, r *http.Request, w http.Resp logrus.Debugf("Performing non-terminal HTTP attach for container %s", c.ID()) err = httpAttachNonTerminalCopy(conn, httpBuf, c.ID(), attachStdin, attachStdout, attachStderr) } - errChan <- err + stdoutChan <- err logrus.Debugf("STDOUT/ERR copy completed") }() - if cancel != nil { + for { select { - case err := <-errChan: - return err + case err := <-stdoutChan: + if err != nil { + return err + } + + return nil + case err := <-stdinChan: + if err != nil { + return err + } case <-cancel: return nil } - } else { - var connErr error = <-errChan - return connErr } } diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 5769e5580..1d4f33794 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -555,9 +555,6 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http. return err } - // Make a channel to pass errors back - errChan := make(chan error) - attachStdout := true attachStderr := true attachStdin := true @@ -672,6 +669,9 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http. logrus.Debugf("Forwarding attach output for container %s", ctr.ID()) + stdoutChan := make(chan error) + stdinChan := make(chan error) + // Handle STDOUT/STDERR go func() { var err error @@ -690,7 +690,7 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http. logrus.Debugf("Performing non-terminal HTTP attach for container %s", ctr.ID()) err = httpAttachNonTerminalCopy(conn, httpBuf, ctr.ID(), attachStdin, attachStdout, attachStderr) } - errChan <- err + stdoutChan <- err logrus.Debugf("STDOUT/ERR copy completed") }() // Next, STDIN. Avoid entirely if attachStdin unset. @@ -698,20 +698,25 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http. go func() { _, err := utils.CopyDetachable(conn, httpBuf, detach) logrus.Debugf("STDIN copy completed") - errChan <- err + stdinChan <- err }() } - if cancel != nil { + for { select { - case err := <-errChan: - return err + case err := <-stdoutChan: + if err != nil { + return err + } + + return nil + case err := <-stdinChan: + if err != nil { + return err + } case <-cancel: return nil } - } else { - var connErr error = <-errChan - return connErr } } @@ -1330,10 +1335,10 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p switch logDriver { case define.JournaldLogging: logDriverArg = define.JournaldLogging - case define.JSONLogging: - fallthrough case define.NoLogging: logDriverArg = define.NoLogging + case define.JSONLogging: + fallthrough default: //nolint-stylecheck // No case here should happen except JSONLogging, but keep this here in case the options are extended logrus.Errorf("%s logging specified but not supported. Choosing k8s-file logging instead", ctr.LogDriver()) diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index b1ef08cda..3a904ba87 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -17,6 +17,7 @@ import ( "github.com/docker/go-connections/nat" "github.com/gorilla/schema" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) func RemoveContainer(w http.ResponseWriter, r *http.Request) { @@ -44,8 +45,25 @@ func RemoveContainer(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) name := utils.GetName(r) con, err := runtime.LookupContainer(name) - if err != nil { - utils.ContainerNotFound(w, name, err) + if err != nil && errors.Cause(err) == define.ErrNoSuchCtr { + // Failed to get container. If force is specified, get the container's ID + // and evict it + if !query.Force { + utils.ContainerNotFound(w, name, err) + return + } + + if _, err := runtime.EvictContainer(r.Context(), name, query.Vols); err != nil { + if errors.Cause(err) == define.ErrNoSuchCtr { + logrus.Debugf("Ignoring error (--allow-missing): %q", err) + w.WriteHeader(http.StatusNoContent) + return + } + logrus.Warn(errors.Wrapf(err, "Failed to evict container: %q", name)) + utils.InternalServerError(w, err) + return + } + w.WriteHeader(http.StatusNoContent) return } @@ -85,7 +103,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) { utils.InternalServerError(w, err) return } - if _, found := r.URL.Query()["limit"]; found && query.Limit != -1 { + if _, found := r.URL.Query()["limit"]; found && query.Limit > 0 { last := query.Limit if len(containers) > last { containers = containers[len(containers)-last:] @@ -175,6 +193,7 @@ func KillContainer(w http.ResponseWriter, r *http.Request) { err = con.Kill(signal) if err != nil { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrapf(err, "unable to kill Container %s", name)) + return } // Docker waits for the container to stop if the signal is 0 or diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go index 93e4fe540..1d0b4c45d 100644 --- a/pkg/api/handlers/compat/containers_create.go +++ b/pkg/api/handlers/compat/containers_create.go @@ -210,7 +210,7 @@ func makeCreateConfig(ctx context.Context, containerConfig *config.Config, input ImageID: newImage.ID(), BuiltinImgVolumes: nil, // podman ImageVolumeType: "", // podman - Interactive: false, + Interactive: input.OpenStdin, // IpcMode: input.HostConfig.IpcMode, Labels: input.Labels, LogDriver: input.HostConfig.LogConfig.Type, // is this correct diff --git a/pkg/api/server/handler_api.go b/pkg/api/server/handler_api.go index f2ce0301b..920811c51 100644 --- a/pkg/api/server/handler_api.go +++ b/pkg/api/server/handler_api.go @@ -34,15 +34,18 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc { } // TODO: Use r.ConnContext when ported to go 1.13 - c := context.WithValue(r.Context(), "decoder", s.Decoder) //nolint - c = context.WithValue(c, "runtime", s.Runtime) //nolint - c = context.WithValue(c, "shutdownFunc", s.Shutdown) //nolint - c = context.WithValue(c, "idletracker", s.idleTracker) //nolint + c := context.WithValue(r.Context(), "decoder", s.Decoder) // nolint + c = context.WithValue(c, "runtime", s.Runtime) // nolint + c = context.WithValue(c, "shutdownFunc", s.Shutdown) // nolint + c = context.WithValue(c, "idletracker", s.idleTracker) // nolint r = r.WithContext(c) - v := utils.APIVersion[utils.CompatTree][utils.CurrentAPIVersion] - w.Header().Set("API-Version", fmt.Sprintf("%d.%d", v.Major, v.Minor)) - w.Header().Set("Libpod-API-Version", utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String()) + cv := utils.APIVersion[utils.CompatTree][utils.CurrentAPIVersion] + w.Header().Set("API-Version", fmt.Sprintf("%d.%d", cv.Major, cv.Minor)) + + lv := utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String() + w.Header().Set("Libpod-API-Version", lv) + w.Header().Set("Server", "Libpod/"+lv+" ("+runtime.GOOS+")") h(w, r) } diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index d0f90d900..7ea3b16a6 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -481,27 +481,67 @@ func startAndAttach(ic *ContainerEngine, name string, detachKeys *string, input, func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []string, options entities.ContainerStartOptions) ([]*entities.ContainerStartReport, error) { reports := []*entities.ContainerStartReport{} - for _, name := range namesOrIds { + var exitCode = define.ExecErrorCodeGeneric + ctrs, err := getContainersByContext(ic.ClientCxt, false, false, namesOrIds) + if err != nil { + return nil, err + } + // There can only be one container if attach was used + for i, ctr := range ctrs { + name := ctr.ID report := entities.ContainerStartReport{ Id: name, - RawInput: name, - ExitCode: 125, + RawInput: namesOrIds[i], + ExitCode: exitCode, } + ctrRunning := ctr.State == define.ContainerStateRunning.String() if options.Attach { - report.Err = startAndAttach(ic, name, &options.DetachKeys, options.Stdin, options.Stdout, options.Stderr) - if report.Err == nil { - exitCode, err := containers.Wait(ic.ClientCxt, name, nil) - if err == nil { - report.ExitCode = int(exitCode) + err = startAndAttach(ic, name, &options.DetachKeys, options.Stdin, options.Stdout, options.Stderr) + if err == define.ErrDetach { + // User manually detached + // Exit cleanly immediately + report.Err = err + reports = append(reports, &report) + return reports, nil + } + if ctrRunning { + reports = append(reports, &report) + return reports, nil + } + + if err != nil { + report.ExitCode = define.ExitCode(report.Err) + report.Err = err + reports = append(reports, &report) + return reports, errors.Wrapf(report.Err, "unable to start container %s", name) + } + exitCode, err := containers.Wait(ic.ClientCxt, name, nil) + if err == define.ErrNoSuchCtr { + // Check events + event, err := ic.GetLastContainerEvent(ctx, name, events.Exited) + if err != nil { + logrus.Errorf("Cannot get exit code: %v", err) + report.ExitCode = define.ExecErrorCodeNotFound + } else { + report.ExitCode = event.ContainerExitCode } } else { - report.ExitCode = define.ExitCode(report.Err) + report.ExitCode = int(exitCode) } reports = append(reports, &report) return reports, nil } - report.Err = containers.Start(ic.ClientCxt, name, &options.DetachKeys) - report.ExitCode = define.ExitCode(report.Err) + // Start the container if it's not running already. + if !ctrRunning { + err = containers.Start(ic.ClientCxt, name, &options.DetachKeys) + if err != nil { + report.Err = errors.Wrapf(err, "unable to start container %q", name) + report.ExitCode = define.ExitCode(err) + reports = append(reports, &report) + continue + } + } + report.ExitCode = 0 reports = append(reports, &report) } return reports, nil diff --git a/pkg/domain/infra/tunnel/events.go b/pkg/domain/infra/tunnel/events.go index e6f4834b9..53bae6cef 100644 --- a/pkg/domain/infra/tunnel/events.go +++ b/pkg/domain/infra/tunnel/events.go @@ -2,8 +2,10 @@ package tunnel import ( "context" + // "fmt" "strings" + "github.com/containers/podman/v2/libpod/events" "github.com/containers/podman/v2/pkg/bindings/system" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/pkg/errors" @@ -29,3 +31,33 @@ func (ic *ContainerEngine) Events(ctx context.Context, opts entities.EventsOptio }() return system.Events(ic.ClientCxt, binChan, nil, &opts.Since, &opts.Until, filters, &opts.Stream) } + +// GetLastContainerEvent takes a container name or ID and an event status and returns +// the last occurrence of the container event +func (ic *ContainerEngine) GetLastContainerEvent(ctx context.Context, nameOrID string, containerEvent events.Status) (*events.Event, error) { + // check to make sure the event.Status is valid + if _, err := events.StringToStatus(containerEvent.String()); err != nil { + return nil, err + } + var event events.Event + return &event, nil + + /* + FIXME: We need new bindings for this section + filters := []string{ + fmt.Sprintf("container=%s", nameOrID), + fmt.Sprintf("event=%s", containerEvent), + "type=container", + } + + containerEvents, err := system.GetEvents(ctx, entities.EventsOptions{Filter: filters}) + if err != nil { + return nil, err + } + if len(containerEvents) < 1 { + return nil, errors.Wrapf(events.ErrEventNotFound, "%s not found", containerEvent.String()) + } + // return the last element in the slice + return containerEvents[len(containerEvents)-1], nil + */ +} diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 332a7c2eb..981884109 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -199,6 +199,13 @@ func (ir *ImageEngine) Load(ctx context.Context, opts entities.ImageLoadOptions) return nil, err } defer f.Close() + fInfo, err := f.Stat() + if err != nil { + return nil, err + } + if fInfo.IsDir() { + return nil, errors.Errorf("remote client supports archives only but %q is a directory", opts.Input) + } ref := opts.Name if len(opts.Tag) > 0 { ref += ":" + opts.Tag diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index 9ea3cb7ed..187073fb9 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -176,6 +176,31 @@ t GET containers/$cid/json 200 \ .Config.Cmd='[]' \ .Path="echo" \ .Args[0]="param1" + +# create a running container for after +t POST containers/create '"Image":"'$IMAGE'","Entrypoint":["top"]' 201 \ + .Id~[0-9a-f]\\{64\\} +cid_top=$(jq -r '.Id' <<<"$output") +t GET containers/${cid_top}/json 200 \ + .Config.Entrypoint[0]="top" \ + .Config.Cmd='[]' \ + .Path="top" +t POST containers/${cid_top}/start '' 204 +# make sure the container is running +t GET containers/${cid_top}/json 200 \ + .State.Status="running" + +# 0 means unlimited, need same with docker +t GET containers/json?limit=0 200 \ + .[0].Id~[0-9a-f]\\{64\\} + +t GET 'containers/json?limit=0&all=1' 200 \ + .[0].Id~[0-9a-f]\\{64\\} \ + .[1].Id~[0-9a-f]\\{64\\} + +t POST containers/${cid_top}/stop "" 204 + t DELETE containers/$cid 204 +t DELETE containers/$cid_top 204 # vim: filetype=sh diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 06054bcb4..e3e1044aa 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -38,7 +38,6 @@ var _ = Describe("Podman build", func() { // Let's first do the most simple build possible to make sure stuff is // happy and then clean up after ourselves to make sure that works too. It("podman build and remove basic alpine", func() { - SkipIfRemote() session := podmanTest.PodmanNoCache([]string{"build", "build/basicalpine"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -58,7 +57,6 @@ var _ = Describe("Podman build", func() { }) It("podman build with logfile", func() { - SkipIfRemote() logfile := filepath.Join(podmanTest.TempDir, "logfile") session := podmanTest.PodmanNoCache([]string{"build", "--tag", "test", "--logfile", logfile, "build/basicalpine"}) session.WaitWithDefaultTimeout() @@ -91,7 +89,7 @@ var _ = Describe("Podman build", func() { // Check that builds with different values for the squash options // create the appropriate number of layers, then clean up after. It("podman build basic alpine with squash", func() { - SkipIfRemote() + SkipIfRemote("FIXME: This is broken should be fixed") session := podmanTest.PodmanNoCache([]string{"build", "-f", "build/squash/Dockerfile.squash-a", "-t", "test-squash-a:latest", "build/squash"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -223,7 +221,7 @@ var _ = Describe("Podman build", func() { }) It("podman build --http_proxy flag", func() { - SkipIfRemote() + SkipIfRemote("FIXME: This is broken should be fixed") os.Setenv("http_proxy", "1.2.3.4") podmanTest.RestoreAllArtifacts() dockerfile := `FROM docker.io/library/alpine:latest diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index c1a213c00..3c7bbca66 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -210,7 +210,7 @@ var _ = Describe("Podman commit", func() { It("podman commit with volume mounts and --include-volumes", func() { // We need to figure out how volumes are going to work correctly with the remote // client. This does not currently work. - SkipIfRemote() + SkipIfRemote("--testing Remote Volumes") s := podmanTest.Podman([]string{"run", "--name", "test1", "-v", "/tmp:/foo", "alpine", "date"}) s.WaitWithDefaultTimeout() Expect(s.ExitCode()).To(Equal(0)) diff --git a/test/e2e/config.go b/test/e2e/config.go index 71c4dee31..0e1850614 100644 --- a/test/e2e/config.go +++ b/test/e2e/config.go @@ -27,8 +27,4 @@ var ( // v2fail is a temporary variable to help us track // tests that fail in v2 v2fail = "does not pass integration tests with v2 podman" - - // v2remotefail is a temporary variable to help us track - // tests that fail in v2 remote - v2remotefail = "does not pass integration tests with v2 podman remote" ) diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go index df43c1b87..a53485fa4 100644 --- a/test/e2e/cp_test.go +++ b/test/e2e/cp_test.go @@ -141,7 +141,7 @@ var _ = Describe("Podman cp", func() { }) It("podman cp stdin/stdout", func() { - SkipIfRemote() + SkipIfRemote("FIXME: podman-remote cp not implemented yet") session := podmanTest.Podman([]string{"create", ALPINE, "ls", "foo"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 6022be5f6..3fce536e2 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -108,13 +108,12 @@ var _ = Describe("Podman create", func() { }) It("podman create --entrypoint \"\"", func() { - Skip(v2remotefail) session := podmanTest.Podman([]string{"create", "--entrypoint", "", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(podmanTest.NumberOfContainers()).To(Equal(1)) - result := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{.Config.Entrypoint}}"}) + result := podmanTest.Podman([]string{"inspect", session.OutputToString(), "--format", "{{.Config.Entrypoint}}"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) Expect(result.OutputToString()).To(Equal("")) @@ -134,7 +133,6 @@ var _ = Describe("Podman create", func() { }) It("podman create --mount flag with multiple mounts", func() { - Skip(v2remotefail) vol1 := filepath.Join(podmanTest.TempDir, "vol-test1") err := os.MkdirAll(vol1, 0755) Expect(err).To(BeNil()) @@ -160,7 +158,6 @@ var _ = Describe("Podman create", func() { if podmanTest.Host.Arch == "ppc64le" { Skip("skip failing test on ppc64le") } - Skip(v2remotefail) mountPath := filepath.Join(podmanTest.TempDir, "secrets") os.Mkdir(mountPath, 0755) session := podmanTest.Podman([]string{"create", "--name", "test", "--mount", fmt.Sprintf("type=bind,src=%s,target=/create/test", mountPath), ALPINE, "grep", "/create/test", "/proc/self/mountinfo"}) @@ -346,7 +343,7 @@ var _ = Describe("Podman create", func() { }) It("podman create --signature-policy", func() { - SkipIfRemote() // SigPolicy not handled by remote + SkipIfRemote("SigPolicy not handled by remote") session := podmanTest.Podman([]string{"create", "--pull=always", "--signature-policy", "/no/such/file", ALPINE}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Not(Equal(0))) diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index 6841aa5a2..7d50c02b2 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -67,13 +67,14 @@ var _ = Describe("Podman exec", func() { }) It("podman exec simple command using latest", func() { - // the remote client doesn't use latest - SkipIfRemote() setup := podmanTest.RunTopContainer("test1") setup.WaitWithDefaultTimeout() Expect(setup.ExitCode()).To(Equal(0)) - - session := podmanTest.Podman([]string{"exec", "-l", "ls"}) + cid := "-l" + if IsRemote() { + cid = "test1" + } + session := podmanTest.Podman([]string{"exec", cid, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) @@ -122,13 +123,12 @@ var _ = Describe("Podman exec", func() { }) It("podman exec terminal doesn't hang", func() { - Skip(v2remotefail) - setup := podmanTest.Podman([]string{"run", "-dti", fedoraMinimal, "sleep", "+Inf"}) + setup := podmanTest.Podman([]string{"run", "-dti", "--name", "test1", fedoraMinimal, "sleep", "+Inf"}) setup.WaitWithDefaultTimeout() Expect(setup.ExitCode()).To(Equal(0)) for i := 0; i < 5; i++ { - session := podmanTest.Podman([]string{"exec", "-lti", "true"}) + session := podmanTest.Podman([]string{"exec", "-ti", "test1", "true"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) } @@ -284,7 +284,8 @@ var _ = Describe("Podman exec", func() { }) It("podman exec preserves container groups with --user and --group-add", func() { - SkipIfRemote() + SkipIfRemote("FIXME: This is broken SECCOMP Failues?") + dockerfile := `FROM fedora-minimal RUN groupadd -g 4000 first RUN groupadd -g 4001 second diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index c020860ea..71e73af9c 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -174,7 +174,6 @@ var _ = Describe("Podman healthcheck run", func() { }) It("podman healthcheck single healthy result changes failed to healthy", func() { - Skip(v2remotefail) session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--health-retries", "2", "--health-cmd", "ls /foo || exit 1", ALPINE, "top"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index ddf2e20b8..d9ad10fe9 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -176,7 +176,7 @@ var _ = Describe("Podman images", func() { }) It("podman images filter before image", func() { - Skip(v2remotefail) + SkipIfRemote("FIXME This should work on podman-remote") dockerfile := `FROM docker.io/library/alpine:latest RUN apk update && apk add strace ` @@ -189,7 +189,6 @@ RUN apk update && apk add strace }) It("podman images workingdir from image", func() { - Skip(v2remotefail) dockerfile := `FROM docker.io/library/alpine:latest WORKDIR /test ` @@ -341,7 +340,7 @@ WORKDIR /test }) It("podman images --all flag", func() { - Skip(v2remotefail) + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.RestoreAllArtifacts() dockerfile := `FROM docker.io/library/alpine:latest RUN mkdir hello @@ -361,7 +360,6 @@ ENV foo=bar }) It("podman images filter by label", func() { - Skip(v2remotefail) dockerfile := `FROM docker.io/library/alpine:latest LABEL version="1.0" LABEL "com.example.vendor"="Example Vendor" @@ -374,7 +372,7 @@ LABEL "com.example.vendor"="Example Vendor" }) It("podman with images with no layers", func() { - Skip(v2remotefail) + SkipIfRemote("FIXME This should work on podman-remote") dockerfile := strings.Join([]string{ `FROM scratch`, `LABEL org.opencontainers.image.authors="<somefolks@example.org>"`, diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go index 6ca75848c..bcbfdd80a 100644 --- a/test/e2e/info_test.go +++ b/test/e2e/info_test.go @@ -79,7 +79,7 @@ var _ = Describe("Podman Info", func() { if !rootless.IsRootless() { Skip("test of rootless_storage_path is only meaningful as rootless") } - SkipIfRemote() + SkipIfRemote("Only tests storage on local client") oldHOME, hasHOME := os.LookupEnv("HOME") defer func() { if hasHOME { diff --git a/test/e2e/init_test.go b/test/e2e/init_test.go index 068da5f2a..baa5c5717 100644 --- a/test/e2e/init_test.go +++ b/test/e2e/init_test.go @@ -75,7 +75,7 @@ var _ = Describe("Podman init", func() { }) It("podman init latest container", func() { - SkipIfRemote() + SkipIfRemote("--latest flag n/a") session := podmanTest.Podman([]string{"create", "-d", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go index f7b953356..d4de7a65c 100644 --- a/test/e2e/inspect_test.go +++ b/test/e2e/inspect_test.go @@ -126,7 +126,7 @@ var _ = Describe("Podman inspect", func() { }) It("podman inspect -l with additional input should fail", func() { - SkipIfRemote() + SkipIfRemote("--latest flag n/a") result := podmanTest.Podman([]string{"inspect", "-l", "1234foobar"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(125)) @@ -173,7 +173,7 @@ var _ = Describe("Podman inspect", func() { }) It("podman inspect --latest with no container fails", func() { - SkipIfRemote() + SkipIfRemote("testing --latest flag") session := podmanTest.Podman([]string{"inspect", "--latest"}) session.WaitWithDefaultTimeout() diff --git a/test/e2e/kill_test.go b/test/e2e/kill_test.go index 3984c3414..10976fd83 100644 --- a/test/e2e/kill_test.go +++ b/test/e2e/kill_test.go @@ -100,12 +100,15 @@ var _ = Describe("Podman kill", func() { }) It("podman kill latest container", func() { - SkipIfRemote() - session := podmanTest.RunTopContainer("") + session := podmanTest.RunTopContainer("test1") session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - result := podmanTest.Podman([]string{"kill", "-l"}) + cid := "-l" + if IsRemote() { + cid = "test1" + } + result := podmanTest.Podman([]string{"kill", cid}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0)) diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go index e74d9bf7c..c7e667b57 100644 --- a/test/e2e/libpod_suite_remote_test.go +++ b/test/e2e/libpod_suite_remote_test.go @@ -23,8 +23,8 @@ func IsRemote() bool { return true } -func SkipIfRemote() { - ginkgo.Skip("This function is not enabled for remote podman") +func SkipIfRemote(reason string) { + ginkgo.Skip("[remote]: " + reason) } func SkipIfRootless() { diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 0f33798b7..d6e0789eb 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -16,7 +16,7 @@ func IsRemote() bool { return false } -func SkipIfRemote() { +func SkipIfRemote(string) { } func SkipIfRootless() { diff --git a/test/e2e/libpod_suite_varlink_test.go b/test/e2e/libpod_suite_varlink_test.go index 0d7032429..903e92647 100644 --- a/test/e2e/libpod_suite_varlink_test.go +++ b/test/e2e/libpod_suite_varlink_test.go @@ -23,8 +23,8 @@ func IsRemote() bool { return true } -func SkipIfRemote() { - ginkgo.Skip("This function is not enabled for remote podman") +func SkipIfRemote(reason string) { + ginkgo.Skip("[remote]: " + reason) } func SkipIfRootless() { diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go index 2b401a09d..eab70fd08 100644 --- a/test/e2e/load_test.go +++ b/test/e2e/load_test.go @@ -123,7 +123,7 @@ var _ = Describe("Podman load", func() { }) It("podman load directory", func() { - SkipIfRemote() + SkipIfRemote("FIXME: Remote Load is broken.") outdir := filepath.Join(podmanTest.TempDir, "alpine") save := podmanTest.PodmanNoCache([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE}) @@ -139,6 +139,22 @@ var _ = Describe("Podman load", func() { Expect(result.ExitCode()).To(Equal(0)) }) + It("podman-remote load directory", func() { + // Remote-only test looking for the specific remote error + // message when trying to load a directory. + if !IsRemote() { + Skip("Remote only test") + } + + result := podmanTest.Podman([]string{"load", "-i", podmanTest.TempDir}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(125)) + + errMsg := fmt.Sprintf("remote client supports archives only but %q is a directory", podmanTest.TempDir) + found, _ := result.ErrorGrepString(errMsg) + Expect(found).Should(BeTrue()) + }) + It("podman load bogus file", func() { save := podmanTest.PodmanNoCache([]string{"load", "-i", "foobar.tar"}) save.WaitWithDefaultTimeout() @@ -227,7 +243,7 @@ var _ = Describe("Podman load", func() { }) It("podman load localhost registry from dir", func() { - SkipIfRemote() + SkipIfRemote("FIXME: podman-remote load is currently broken.") outfile := filepath.Join(podmanTest.TempDir, "load") setup := podmanTest.PodmanNoCache([]string{"tag", BB, "hello:world"}) diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go index e63bce3fe..3aa3cf409 100644 --- a/test/e2e/logs_test.go +++ b/test/e2e/logs_test.go @@ -127,7 +127,7 @@ var _ = Describe("Podman logs", func() { }) It("two containers showing short container IDs", func() { - SkipIfRemote() // remote does not support multiple containers + SkipIfRemote("FIXME: remote does not support multiple containers") log1 := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"}) log1.WaitWithDefaultTimeout() Expect(log1.ExitCode()).To(Equal(0)) diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go index 69b7b771b..33aac48d5 100644 --- a/test/e2e/manifest_test.go +++ b/test/e2e/manifest_test.go @@ -102,7 +102,7 @@ var _ = Describe("Podman manifest", func() { }) It("podman manifest annotate", func() { - SkipIfRemote() + SkipIfRemote("Not supporting annotate on remote connections") session := podmanTest.Podman([]string{"manifest", "create", "foo"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -184,8 +184,7 @@ var _ = Describe("Podman manifest", func() { }) It("podman manifest push purge", func() { - // remote does not support --purge - SkipIfRemote() + SkipIfRemote("remote does not support --purge") session := podmanTest.Podman([]string{"manifest", "create", "foo"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/namespace_test.go b/test/e2e/namespace_test.go index 916ceada0..92df3df48 100644 --- a/test/e2e/namespace_test.go +++ b/test/e2e/namespace_test.go @@ -33,7 +33,7 @@ var _ = Describe("Podman namespaces", func() { }) It("podman namespace test", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on Remote") podman1 := podmanTest.Podman([]string{"--namespace", "test1", "run", "-d", ALPINE, "echo", "hello"}) podman1.WaitWithDefaultTimeout() Expect(podman1.ExitCode()).To(Equal(0)) diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go index 13d515d8e..8d289d6e6 100644 --- a/test/e2e/network_create_test.go +++ b/test/e2e/network_create_test.go @@ -137,7 +137,7 @@ var _ = Describe("Podman network create", func() { }) It("podman network create with name and subnet", func() { - SkipIfRemote() + SkipIfRemote("FIXME, this should work on --remote") var ( results []network.NcList ) @@ -178,7 +178,6 @@ var _ = Describe("Podman network create", func() { }) It("podman network create with name and IPv6 subnet", func() { - SkipIfRemote() SkipIfRootless() var ( results []network.NcList diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 7a5aebcc2..d771860d8 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -591,7 +591,6 @@ var _ = Describe("Podman generate kube", func() { }) It("podman play kube test correct command", func() { - SkipIfRemote() pod := getPod() err := generatePodKubeYaml(pod, kubeYaml) Expect(err).To(BeNil()) @@ -609,7 +608,6 @@ var _ = Describe("Podman generate kube", func() { }) It("podman play kube test correct command with only set command in yaml file", func() { - SkipIfRemote() pod := getPod(withCtr(getCtr(withCmd([]string{"echo", "hello"}), withArg(nil)))) err := generatePodKubeYaml(pod, kubeYaml) Expect(err).To(BeNil()) @@ -644,7 +642,6 @@ var _ = Describe("Podman generate kube", func() { }) It("podman play kube test correct output", func() { - SkipIfRemote() p := getPod(withCtr(getCtr(withCmd([]string{"echo", "hello"}), withArg([]string{"world"})))) err := generatePodKubeYaml(p, kubeYaml) @@ -796,7 +793,7 @@ var _ = Describe("Podman generate kube", func() { }) It("podman play kube seccomp container level", func() { - SkipIfRemote() + SkipIfRemote("FIXME This is broken") // expect play kube is expected to set a seccomp label if it's applied as an annotation jsonFile, err := podmanTest.CreateSeccompJson(seccompPwdEPERM) if err != nil { @@ -823,7 +820,7 @@ var _ = Describe("Podman generate kube", func() { }) It("podman play kube seccomp pod level", func() { - SkipIfRemote() + SkipIfRemote("FIXME: This should work with --remote") // expect play kube is expected to set a seccomp label if it's applied as an annotation jsonFile, err := podmanTest.CreateSeccompJson(seccompPwdEPERM) if err != nil { @@ -975,7 +972,6 @@ spec: // Deployment related tests It("podman play kube deployment 1 replica test correct command", func() { - SkipIfRemote() deployment := getDeployment() err := generateDeploymentKubeYaml(deployment, kubeYaml) Expect(err).To(BeNil()) @@ -994,7 +990,6 @@ spec: }) It("podman play kube deployment more than 1 replica test correct command", func() { - SkipIfRemote() var i, numReplicas int32 numReplicas = 5 deployment := getDeployment(withReplicas(numReplicas)) @@ -1160,7 +1155,6 @@ spec: }) It("podman play kube applies labels to pods", func() { - SkipIfRemote() var numReplicas int32 = 5 expectedLabelKey := "key1" expectedLabelValue := "value1" diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index 168150bff..ce0b51517 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -124,7 +124,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with --no-hosts", func() { - SkipIfRemote() name := "test" podCreate := podmanTest.Podman([]string{"pod", "create", "--no-hosts", "--name", name}) podCreate.WaitWithDefaultTimeout() @@ -141,7 +140,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with --no-hosts and no infra should fail", func() { - SkipIfRemote() name := "test" podCreate := podmanTest.Podman([]string{"pod", "create", "--no-hosts", "--name", name, "--infra=false"}) podCreate.WaitWithDefaultTimeout() @@ -149,7 +147,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with --add-host", func() { - SkipIfRemote() name := "test" podCreate := podmanTest.Podman([]string{"pod", "create", "--add-host", "test.example.com:12.34.56.78", "--name", name}) podCreate.WaitWithDefaultTimeout() @@ -162,7 +159,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with --add-host and no infra should fail", func() { - SkipIfRemote() name := "test" podCreate := podmanTest.Podman([]string{"pod", "create", "--add-host", "test.example.com:12.34.56.78", "--name", name, "--infra=false"}) podCreate.WaitWithDefaultTimeout() @@ -170,7 +166,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with DNS server set", func() { - SkipIfRemote() name := "test" server := "12.34.56.78" podCreate := podmanTest.Podman([]string{"pod", "create", "--dns", server, "--name", name}) @@ -184,7 +179,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with DNS server set and no infra should fail", func() { - SkipIfRemote() name := "test" server := "12.34.56.78" podCreate := podmanTest.Podman([]string{"pod", "create", "--dns", server, "--name", name, "--infra=false"}) @@ -193,7 +187,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with DNS option set", func() { - SkipIfRemote() name := "test" option := "attempts:5" podCreate := podmanTest.Podman([]string{"pod", "create", "--dns-opt", option, "--name", name}) @@ -207,7 +200,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with DNS option set and no infra should fail", func() { - SkipIfRemote() name := "test" option := "attempts:5" podCreate := podmanTest.Podman([]string{"pod", "create", "--dns-opt", option, "--name", name, "--infra=false"}) @@ -216,7 +208,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with DNS search domain set", func() { - SkipIfRemote() name := "test" search := "example.com" podCreate := podmanTest.Podman([]string{"pod", "create", "--dns-search", search, "--name", name}) @@ -230,7 +221,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with DNS search domain set and no infra should fail", func() { - SkipIfRemote() name := "test" search := "example.com" podCreate := podmanTest.Podman([]string{"pod", "create", "--dns-search", search, "--name", name, "--infra=false"}) @@ -256,7 +246,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with IP address and no infra should fail", func() { - SkipIfRemote() name := "test" ip := GetRandomIPAddress() podCreate := podmanTest.Podman([]string{"pod", "create", "--ip", ip, "--name", name, "--infra=false"}) @@ -265,7 +254,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with MAC address", func() { - SkipIfRemote() name := "test" mac := "92:d0:c6:0a:29:35" podCreate := podmanTest.Podman([]string{"pod", "create", "--mac-address", mac, "--name", name}) @@ -283,7 +271,6 @@ var _ = Describe("Podman pod create", func() { }) It("podman create pod with MAC address and no infra should fail", func() { - SkipIfRemote() name := "test" mac := "92:d0:c6:0a:29:35" podCreate := podmanTest.Podman([]string{"pod", "create", "--mac-address", mac, "--name", name, "--infra=false"}) diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go index 98f1b5174..515391f92 100644 --- a/test/e2e/pod_infra_container_test.go +++ b/test/e2e/pod_infra_container_test.go @@ -225,7 +225,7 @@ var _ = Describe("Podman pod create", func() { }) It("podman pod container can override pod pid NS", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"pod", "create", "--share", "pid"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -257,7 +257,7 @@ var _ = Describe("Podman pod create", func() { }) It("podman pod container can override pod not sharing pid", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"pod", "create", "--share", "net"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -283,7 +283,7 @@ var _ = Describe("Podman pod create", func() { }) It("podman pod container can override pod ipc NS", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"pod", "create", "--share", "ipc"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -380,6 +380,7 @@ var _ = Describe("Podman pod create", func() { }) It("podman run --add-host in pod", func() { + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"pod", "create"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/pod_kill_test.go b/test/e2e/pod_kill_test.go index d7462e16d..f968f73a6 100644 --- a/test/e2e/pod_kill_test.go +++ b/test/e2e/pod_kill_test.go @@ -100,7 +100,6 @@ var _ = Describe("Podman pod kill", func() { }) It("podman pod kill latest pod", func() { - SkipIfRemote() _, ec, podid := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) @@ -118,8 +117,10 @@ var _ = Describe("Podman pod kill", func() { session = podmanTest.RunTopContainerInPod("", podid2) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - - result := podmanTest.Podman([]string{"pod", "kill", "-l"}) + if !IsRemote() { + podid2 = "-l" + } + result := podmanTest.Podman([]string{"pod", "kill", podid2}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) diff --git a/test/e2e/pod_pod_namespaces.go b/test/e2e/pod_pod_namespaces.go index f72f98b5f..3139bf561 100644 --- a/test/e2e/pod_pod_namespaces.go +++ b/test/e2e/pod_pod_namespaces.go @@ -61,7 +61,7 @@ var _ = Describe("Podman pod create", func() { }) It("podman pod container dontshare PIDNS", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"pod", "create"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go index 602d9d577..17ed6a9c0 100644 --- a/test/e2e/pod_ps_test.go +++ b/test/e2e/pod_ps_test.go @@ -83,7 +83,7 @@ var _ = Describe("Podman ps", func() { }) It("podman pod ps latest", func() { - SkipIfRemote() + SkipIfRemote("--latest flag n/a") _, ec, podid1 := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) @@ -212,17 +212,17 @@ var _ = Describe("Podman ps", func() { Expect(ec).To(Equal(0)) _, ec, podid2 := podmanTest.CreatePodWithLabels("", map[string]string{ - "io.podman.test.label": "value1", - "io.podman.test.key": "irrelevant-value", + "app": "myapp", + "io.podman.test.key": "irrelevant-value", }) Expect(ec).To(Equal(0)) _, ec, podid3 := podmanTest.CreatePodWithLabels("", map[string]string{ - "io.podman.test.label": "value2", + "app": "test", }) Expect(ec).To(Equal(0)) - session := podmanTest.Podman([]string{"pod", "ps", "--no-trunc", "--filter", "label=io.podman.test.key", "--filter", "label=io.podman.test.label=value1"}) + session := podmanTest.Podman([]string{"pod", "ps", "--no-trunc", "--filter", "label=app", "--filter", "label=app=myapp"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(session.OutputToString()).To(Not(ContainSubstring(podid1))) diff --git a/test/e2e/pod_restart_test.go b/test/e2e/pod_restart_test.go index 9fe6c1a85..b358c2c7a 100644 --- a/test/e2e/pod_restart_test.go +++ b/test/e2e/pod_restart_test.go @@ -134,7 +134,6 @@ var _ = Describe("Podman pod restart", func() { }) It("podman pod restart latest pod", func() { - SkipIfRemote() _, ec, _ := podmanTest.CreatePod("foobar99") Expect(ec).To(Equal(0)) @@ -152,7 +151,11 @@ var _ = Describe("Podman pod restart", func() { startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) startTime.WaitWithDefaultTimeout() - session = podmanTest.Podman([]string{"pod", "restart", "-l"}) + podid := "-l" + if IsRemote() { + podid = "foobar100" + } + session = podmanTest.Podman([]string{"pod", "restart", podid}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go index 918d0eb32..cb9b93a15 100644 --- a/test/e2e/pod_rm_test.go +++ b/test/e2e/pod_rm_test.go @@ -61,14 +61,17 @@ var _ = Describe("Podman pod rm", func() { }) It("podman pod rm latest pod", func() { - SkipIfRemote() _, ec, podid := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) - _, ec2, podid2 := podmanTest.CreatePod("") + _, ec2, podid2 := podmanTest.CreatePod("pod2") Expect(ec2).To(Equal(0)) - result := podmanTest.Podman([]string{"pod", "rm", "--latest"}) + latest := "--latest" + if IsRemote() { + latest = "pod2" + } + result := podmanTest.Podman([]string{"pod", "rm", latest}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) diff --git a/test/e2e/pod_start_test.go b/test/e2e/pod_start_test.go index 2f0160e99..63a915548 100644 --- a/test/e2e/pod_start_test.go +++ b/test/e2e/pod_start_test.go @@ -107,7 +107,6 @@ var _ = Describe("Podman pod start", func() { }) It("podman pod start latest pod", func() { - SkipIfRemote() _, ec, _ := podmanTest.CreatePod("foobar99") Expect(ec).To(Equal(0)) @@ -122,7 +121,11 @@ var _ = Describe("Podman pod start", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.Podman([]string{"pod", "start", "--latest"}) + podid := "--latest" + if IsRemote() { + podid = "foobar100" + } + session = podmanTest.Podman([]string{"pod", "start", podid}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) diff --git a/test/e2e/pod_stop_test.go b/test/e2e/pod_stop_test.go index 2363974cc..4eb897786 100644 --- a/test/e2e/pod_stop_test.go +++ b/test/e2e/pod_stop_test.go @@ -143,7 +143,6 @@ var _ = Describe("Podman pod stop", func() { }) It("podman pod stop latest pod", func() { - SkipIfRemote() _, ec, _ := podmanTest.CreatePod("foobar99") Expect(ec).To(Equal(0)) @@ -158,7 +157,11 @@ var _ = Describe("Podman pod stop", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.Podman([]string{"pod", "stop", "--latest"}) + podid := "--latest" + if IsRemote() { + podid = "foobar100" + } + session = podmanTest.Podman([]string{"pod", "stop", podid}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go index 2cb7a623e..9e3570360 100644 --- a/test/e2e/pod_top_test.go +++ b/test/e2e/pod_top_test.go @@ -56,7 +56,6 @@ var _ = Describe("Podman top", func() { }) It("podman pod top on pod", func() { - SkipIfRemote() _, ec, podid := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) @@ -64,7 +63,10 @@ var _ = Describe("Podman top", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - result := podmanTest.Podman([]string{"pod", "top", "-l"}) + if !IsRemote() { + podid = "-l" + } + result := podmanTest.Podman([]string{"pod", "top", podid}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) Expect(len(result.OutputToStringArray())).To(BeNumerically(">", 1)) diff --git a/test/e2e/port_test.go b/test/e2e/port_test.go index fce092e2d..a3ce8bd69 100644 --- a/test/e2e/port_test.go +++ b/test/e2e/port_test.go @@ -47,15 +47,17 @@ var _ = Describe("Podman port", func() { }) It("podman port -l nginx", func() { - SkipIfRemote() - session, cid := podmanTest.RunNginxWithHealthCheck("") + session, cid := podmanTest.RunNginxWithHealthCheck("test1") Expect(session.ExitCode()).To(Equal(0)) if err := podmanTest.RunHealthCheck(cid); err != nil { Fail(err.Error()) } - result := podmanTest.Podman([]string{"port", "-l"}) + if !IsRemote() { + cid = "-l" + } + result := podmanTest.Podman([]string{"port", cid}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) port := strings.Split(result.OutputToStringArray()[0], ":")[1] @@ -63,7 +65,6 @@ var _ = Describe("Podman port", func() { }) It("podman container port -l nginx", func() { - SkipIfRemote() session, cid := podmanTest.RunNginxWithHealthCheck("") Expect(session.ExitCode()).To(Equal(0)) @@ -71,7 +72,10 @@ var _ = Describe("Podman port", func() { Fail(err.Error()) } - result := podmanTest.Podman([]string{"container", "port", "-l"}) + if !IsRemote() { + cid = "-l" + } + result := podmanTest.Podman([]string{"container", "port", cid}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) port := strings.Split(result.OutputToStringArray()[0], ":")[1] @@ -79,7 +83,6 @@ var _ = Describe("Podman port", func() { }) It("podman port -l port nginx", func() { - SkipIfRemote() session, cid := podmanTest.RunNginxWithHealthCheck("") Expect(session.ExitCode()).To(Equal(0)) @@ -87,7 +90,10 @@ var _ = Describe("Podman port", func() { Fail(err.Error()) } - result := podmanTest.Podman([]string{"port", "-l", "80"}) + if !IsRemote() { + cid = "-l" + } + result := podmanTest.Podman([]string{"port", cid, "80"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) port := strings.Split(result.OutputToStringArray()[0], ":")[1] diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go index 9c9d85194..24b88bfdd 100644 --- a/test/e2e/prune_test.go +++ b/test/e2e/prune_test.go @@ -88,7 +88,7 @@ var _ = Describe("Podman prune", func() { }) It("podman image prune skip cache images", func() { - SkipIfRemote() + SkipIfRemote("FIXME should work on podman --remote") podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") none := podmanTest.Podman([]string{"images", "-a"}) @@ -110,7 +110,7 @@ var _ = Describe("Podman prune", func() { }) It("podman image prune dangling images", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") @@ -147,7 +147,7 @@ var _ = Describe("Podman prune", func() { }) It("podman system image prune unused images", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.RestoreAllArtifacts() podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true") prune := podmanTest.PodmanNoCache([]string{"system", "prune", "-a", "--force"}) diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index 66233412c..f6640906a 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -101,7 +101,7 @@ var _ = Describe("Podman ps", func() { }) It("podman ps latest flag", func() { - SkipIfRemote() + SkipIfRemote("--latest is not supported on podman-remote") _, ec, _ := podmanTest.RunLsContainer("") Expect(ec).To(Equal(0)) _, ec, _ = podmanTest.RunLsContainer("") diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index 98b81876a..2280d16cc 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -235,7 +235,7 @@ var _ = Describe("Podman pull", func() { }) It("podman pull from docker-archive", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.RestoreArtifact(ALPINE) tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") session := podmanTest.PodmanNoCache([]string{"save", "-o", tarfn, "alpine"}) @@ -297,7 +297,7 @@ var _ = Describe("Podman pull", func() { }) It("podman pull from oci-archive", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.RestoreArtifact(ALPINE) tarfn := filepath.Join(podmanTest.TempDir, "oci-alp.tar") session := podmanTest.PodmanNoCache([]string{"save", "--format", "oci-archive", "-o", tarfn, "alpine"}) @@ -316,7 +316,7 @@ var _ = Describe("Podman pull", func() { }) It("podman pull from local directory", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.RestoreArtifact(ALPINE) dirpath := filepath.Join(podmanTest.TempDir, "alpine") os.MkdirAll(dirpath, os.ModePerm) @@ -341,7 +341,7 @@ var _ = Describe("Podman pull", func() { }) It("podman pull from local OCI directory", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") podmanTest.RestoreArtifact(ALPINE) dirpath := filepath.Join(podmanTest.TempDir, "alpine") os.MkdirAll(dirpath, os.ModePerm) diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go index 4348eae3b..789b4dee5 100644 --- a/test/e2e/restart_test.go +++ b/test/e2e/restart_test.go @@ -122,7 +122,6 @@ var _ = Describe("Podman restart", func() { }) It("Podman restart the latest container", func() { - SkipIfRemote() _, exitCode, _ := podmanTest.RunLsContainer("test1") Expect(exitCode).To(Equal(0)) @@ -132,7 +131,11 @@ var _ = Describe("Podman restart", func() { startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) startTime.WaitWithDefaultTimeout() - session := podmanTest.Podman([]string{"restart", "-l"}) + cid := "-l" + if IsRemote() { + cid = "test2" + } + session := podmanTest.Podman([]string{"restart", cid}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go index 764d25ba5..cc2f7daf1 100644 --- a/test/e2e/rm_test.go +++ b/test/e2e/rm_test.go @@ -123,15 +123,18 @@ var _ = Describe("Podman rm", func() { }) It("podman rm the latest container", func() { - SkipIfRemote() session := podmanTest.Podman([]string{"create", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - _, ec, cid := podmanTest.RunLsContainer("") + _, ec, cid := podmanTest.RunLsContainer("test1") Expect(ec).To(Equal(0)) - result := podmanTest.Podman([]string{"rm", "-l"}) + latest := "-l" + if IsRemote() { + latest = "test1" + } + result := podmanTest.Podman([]string{"rm", latest}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) output := result.OutputToString() @@ -193,7 +196,7 @@ var _ = Describe("Podman rm", func() { }) It("podman rm invalid --latest and --cidfile and --all", func() { - SkipIfRemote() + SkipIfRemote("Verifying --latest flag") result := podmanTest.Podman([]string{"rm", "--cidfile", "foobar", "--latest"}) result.WaitWithDefaultTimeout() diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go index 4db6a1962..8a5014899 100644 --- a/test/e2e/rmi_test.go +++ b/test/e2e/rmi_test.go @@ -185,7 +185,7 @@ var _ = Describe("Podman rmi", func() { }) It("podman rmi with cached images", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) @@ -255,7 +255,7 @@ var _ = Describe("Podman rmi", func() { }) It("podman rmi -a with parent|child images", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") dockerfile := `FROM docker.io/library/alpine:latest AS base RUN touch /1 ENV LOCAL=/1 diff --git a/test/e2e/run_cleanup_test.go b/test/e2e/run_cleanup_test.go index f293e709a..153bc53ad 100644 --- a/test/e2e/run_cleanup_test.go +++ b/test/e2e/run_cleanup_test.go @@ -33,7 +33,7 @@ var _ = Describe("Podman run exit", func() { }) It("podman run -d mount cleanup test", func() { - SkipIfRemote() + SkipIfRemote("podman-remote does not support mount") SkipIfRootless() result := podmanTest.Podman([]string{"run", "-dt", ALPINE, "top"}) diff --git a/test/e2e/run_entrypoint_test.go b/test/e2e/run_entrypoint_test.go index c1061be85..13a9abf9b 100644 --- a/test/e2e/run_entrypoint_test.go +++ b/test/e2e/run_entrypoint_test.go @@ -44,7 +44,6 @@ CMD [] }) It("podman run entrypoint", func() { - SkipIfRemote() dockerfile := `FROM docker.io/library/alpine:latest ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` @@ -56,7 +55,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] }) It("podman run entrypoint with cmd", func() { - SkipIfRemote() dockerfile := `FROM docker.io/library/alpine:latest CMD [ "-v"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] @@ -69,7 +67,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] }) It("podman run entrypoint with user cmd overrides image cmd", func() { - SkipIfRemote() dockerfile := `FROM docker.io/library/alpine:latest CMD [ "-v"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] @@ -82,7 +79,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] }) It("podman run entrypoint with user cmd no image cmd", func() { - SkipIfRemote() dockerfile := `FROM docker.io/library/alpine:latest ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` @@ -94,7 +90,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] }) It("podman run user entrypoint overrides image entrypoint and image cmd", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") dockerfile := `FROM docker.io/library/alpine:latest CMD ["-i"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] @@ -112,7 +108,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] }) It("podman run user entrypoint with command overrides image entrypoint and image cmd", func() { - SkipIfRemote() dockerfile := `FROM docker.io/library/alpine:latest CMD ["-i"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] diff --git a/test/e2e/run_env_test.go b/test/e2e/run_env_test.go index 801a3d014..3f488ada5 100644 --- a/test/e2e/run_env_test.go +++ b/test/e2e/run_env_test.go @@ -90,7 +90,7 @@ var _ = Describe("Podman run", func() { }) It("podman run --env-host environment test", func() { - SkipIfRemote() + SkipIfRemote("FIXME, We should check that --env-host reports correct error on podman-remote") env := append(os.Environ(), "FOO=BAR") session := podmanTest.PodmanAsUser([]string{"run", "--rm", "--env-host", ALPINE, "/bin/printenv", "FOO"}, 0, 0, "", env) @@ -108,7 +108,7 @@ var _ = Describe("Podman run", func() { }) It("podman run --http-proxy test", func() { - SkipIfRemote() + SkipIfRemote("FIXME: Should report proper error when http-proxy is not supported") os.Setenv("http_proxy", "1.2.3.4") session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "http_proxy"}) session.WaitWithDefaultTimeout() diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index c20bfe631..12f5018b8 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -528,7 +528,6 @@ var _ = Describe("Podman run networking", func() { }) It("podman run in custom CNI network with --static-ip", func() { - SkipIfRemote() SkipIfRootless() netName := "podmantestnetwork" ipAddr := "10.25.30.128" @@ -544,7 +543,6 @@ var _ = Describe("Podman run networking", func() { }) It("podman run with new:pod and static-ip", func() { - SkipIfRemote() SkipIfRootless() netName := "podmantestnetwork2" ipAddr := "10.25.40.128" diff --git a/test/e2e/run_passwd_test.go b/test/e2e/run_passwd_test.go index dfb8c72a1..e7b86c68b 100644 --- a/test/e2e/run_passwd_test.go +++ b/test/e2e/run_passwd_test.go @@ -60,7 +60,6 @@ var _ = Describe("Podman run passwd", func() { }) It("podman can run container without /etc/passwd", func() { - SkipIfRemote() dockerfile := `FROM alpine RUN rm -f /etc/passwd /etc/shadow /etc/group USER 1000` @@ -114,7 +113,6 @@ USER 1000` }) It("podman run numeric group from image and no group file", func() { - SkipIfRemote() dockerfile := `FROM alpine RUN rm -f /etc/passwd /etc/shadow /etc/group USER 1000` diff --git a/test/e2e/run_restart_test.go b/test/e2e/run_restart_test.go index 6150d63e5..1bef3f954 100644 --- a/test/e2e/run_restart_test.go +++ b/test/e2e/run_restart_test.go @@ -33,7 +33,7 @@ var _ = Describe("Podman run restart containers", func() { }) It("Podman start after successful run", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"run", "--name", "test", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/run_security_labels.go b/test/e2e/run_security_labels.go index e907607b5..7c8597866 100644 --- a/test/e2e/run_security_labels.go +++ b/test/e2e/run_security_labels.go @@ -127,7 +127,7 @@ var _ = Describe("Podman generate kube", func() { }) It("podman container runlabel (podman --version)", func() { - SkipIfRemote() + SkipIfRemote("runlabel not supported on podman-remote") PodmanDockerfile := ` FROM alpine:latest LABEL io.containers.capabilities=chown,mknod` diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 4376bf309..c8655dcad 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -59,7 +59,7 @@ var _ = Describe("Podman run", func() { }) It("podman run --signature-policy", func() { - SkipIfRemote() // SigPolicy not handled by remote + SkipIfRemote("SigPolicy not handled by remote") session := podmanTest.Podman([]string{"run", "--pull=always", "--signature-policy", "/no/such/file", ALPINE}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Not(Equal(0))) @@ -295,7 +295,7 @@ var _ = Describe("Podman run", func() { }) It("podman run user capabilities test with image", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") dockerfile := `FROM busybox USER bin` podmanTest.BuildImage(dockerfile, "test", "false") @@ -343,7 +343,7 @@ USER bin` }) It("podman run limits host test", func() { - SkipIfRemote() + SkipIfRemote("This can only be used for local tests") var l syscall.Rlimit @@ -486,7 +486,7 @@ USER bin` }) It("podman run notify_socket", func() { - SkipIfRemote() + SkipIfRemote("This can only be used for local tests") host := GetHostDistributionInfo() if host.Distribution != "rhel" && host.Distribution != "centos" && host.Distribution != "fedora" { @@ -546,7 +546,7 @@ USER bin` }) It("podman run with secrets", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") containersDir := filepath.Join(podmanTest.TempDir, "containers") err := os.MkdirAll(containersDir, 0755) Expect(err).To(BeNil()) @@ -711,7 +711,7 @@ USER bin` }) It("podman run with built-in volume image", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"run", "--rm", redis, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -1028,7 +1028,7 @@ USER mail` }) It("podman run with restart-policy always restarts containers", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") testDir := filepath.Join(podmanTest.RunRoot, "restart-test") err := os.MkdirAll(testDir, 0755) Expect(err).To(BeNil()) @@ -1071,7 +1071,6 @@ USER mail` }) It("podman run with cgroups=disabled runs without cgroups", func() { - SkipIfRemote() SkipIfRootless() // Only works on crun if !strings.Contains(podmanTest.OCIRuntime, "crun") { @@ -1104,7 +1103,6 @@ USER mail` }) It("podman run with cgroups=enabled makes cgroups", func() { - SkipIfRemote() SkipIfRootless() // Only works on crun if !strings.Contains(podmanTest.OCIRuntime, "crun") { @@ -1267,7 +1265,6 @@ USER mail` It("podman run makes workdir from image", func() { // BuildImage does not seem to work remote - SkipIfRemote() dockerfile := `FROM busybox WORKDIR /madethis` podmanTest.BuildImage(dockerfile, "test", "false") diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index c4ee05af9..0e0195c9f 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -197,7 +197,7 @@ var _ = Describe("Podman run with volumes", func() { }) It("podman run with volumes and suid/dev/exec options", func() { - SkipIfRemote() + SkipIfRemote("podman-remote does not support --volumes") mountPath := filepath.Join(podmanTest.TempDir, "secrets") os.Mkdir(mountPath, 0755) @@ -227,7 +227,7 @@ var _ = Describe("Podman run with volumes", func() { }) It("podman run with tmpfs named volume mounts and unmounts", func() { - SkipIfRemote() + SkipIfRemote("podman-remote does not support --volumes this test could be simplified to be tested on Remote.") SkipIfRootless() volName := "testvol" mkVolume := podmanTest.Podman([]string{"volume", "create", "--opt", "type=tmpfs", "--opt", "device=tmpfs", "--opt", "o=nodev", "testvol"}) @@ -315,7 +315,6 @@ var _ = Describe("Podman run with volumes", func() { }) It("podman run with anonymous volume", func() { - SkipIfRemote() list1 := podmanTest.Podman([]string{"volume", "list", "--quiet"}) list1.WaitWithDefaultTimeout() Expect(list1.ExitCode()).To(Equal(0)) @@ -334,7 +333,6 @@ var _ = Describe("Podman run with volumes", func() { }) It("podman rm -v removes anonymous volume", func() { - SkipIfRemote() list1 := podmanTest.Podman([]string{"volume", "list", "--quiet"}) list1.WaitWithDefaultTimeout() Expect(list1.ExitCode()).To(Equal(0)) @@ -436,7 +434,6 @@ var _ = Describe("Podman run with volumes", func() { }) It("Podman mount over image volume with trailing /", func() { - SkipIfRemote() image := "podman-volume-test:trailing" dockerfile := ` FROM alpine:latest @@ -456,7 +453,7 @@ VOLUME /test/` }) It("podman run with overlay volume flag", func() { - SkipIfRemote() + SkipIfRemote("Overlay volumes only work locally") if os.Getenv("container") != "" { Skip("Overlay mounts not supported when running in a container") } diff --git a/test/e2e/run_working_dir.go b/test/e2e/run_working_dir.go index 93330deba..85aa0cffe 100644 --- a/test/e2e/run_working_dir.go +++ b/test/e2e/run_working_dir.go @@ -50,7 +50,7 @@ var _ = Describe("Podman run", func() { }) It("podman run a container on an image with a workdir", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") dockerfile := `FROM alpine RUN mkdir -p /home/foobar WORKDIR /etc/foobar` diff --git a/test/e2e/runlabel_test.go b/test/e2e/runlabel_test.go index 0eb679fbf..81a746b86 100644 --- a/test/e2e/runlabel_test.go +++ b/test/e2e/runlabel_test.go @@ -29,8 +29,7 @@ var _ = Describe("podman container runlabel", func() { ) BeforeEach(func() { - // runlabel is not supported for remote connections - SkipIfRemote() + SkipIfRemote("runlabel is not supported for remote connections") tempdir, err = CreateTempDirInTempDir() if err != nil { os.Exit(1) diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go index c6766fe2a..a3d56ad89 100644 --- a/test/e2e/search_test.go +++ b/test/e2e/search_test.go @@ -237,7 +237,7 @@ registries = ['{{.Host}}:{{.Port}}']` }) It("podman search attempts HTTP if registry is in registries.insecure and force secure is false", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") if podmanTest.Host.Arch == "ppc64le" { Skip("No registry image for ppc64le") } @@ -278,7 +278,7 @@ registries = ['{{.Host}}:{{.Port}}']` }) It("podman search doesn't attempt HTTP if force secure is true", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") if podmanTest.Host.Arch == "ppc64le" { Skip("No registry image for ppc64le") } @@ -317,7 +317,7 @@ registries = ['{{.Host}}:{{.Port}}']` }) It("podman search doesn't attempt HTTP if registry is not listed as insecure", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") if podmanTest.Host.Arch == "ppc64le" { Skip("No registry image for ppc64le") } @@ -356,7 +356,7 @@ registries = ['{{.Host}}:{{.Port}}']` }) It("podman search doesn't attempt HTTP if one registry is not listed as insecure", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") if podmanTest.Host.Arch == "ppc64le" { Skip("No registry image for ppc64le") } @@ -407,7 +407,6 @@ registries = ['{{.Host}}:{{.Port}}']` // search should fail with nonexist authfile It("podman search fail with nonexist --authfile", func() { - SkipIfRemote() search := podmanTest.Podman([]string{"search", "--authfile", "/tmp/nonexist", ALPINE}) search.WaitWithDefaultTimeout() Expect(search.ExitCode()).To(Not(Equal(0))) diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go index aef5ca001..35b5cab6e 100644 --- a/test/e2e/start_test.go +++ b/test/e2e/start_test.go @@ -87,7 +87,6 @@ var _ = Describe("Podman start", func() { }) It("podman start single container with attach and test the signal", func() { - SkipIfRemote() session := podmanTest.Podman([]string{"create", "--entrypoint", "sh", ALPINE, "-c", "exit 1"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -132,14 +131,16 @@ var _ = Describe("Podman start", func() { }) It("podman failed to start with --rm should delete the container", func() { - Skip(v2remotefail) session := podmanTest.Podman([]string{"create", "--name", "test1", "-it", "--rm", ALPINE, "foo"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) start := podmanTest.Podman([]string{"start", "test1"}) start.WaitWithDefaultTimeout() - Expect(start).To(ExitWithError()) + + wait := podmanTest.Podman([]string{"wait", "test1"}) + wait.WaitWithDefaultTimeout() + Expect(wait).To(ExitWithError()) Eventually(podmanTest.NumberOfContainers(), defaultWaitTimeout, 3.0).Should(BeZero()) }) diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go index 84274b3ff..1437fd066 100644 --- a/test/e2e/stop_test.go +++ b/test/e2e/stop_test.go @@ -182,7 +182,7 @@ var _ = Describe("Podman stop", func() { }) It("podman stop latest containers", func() { - SkipIfRemote() + SkipIfRemote("--latest flag n/a") session := podmanTest.RunTopContainer("test1") session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -196,14 +196,17 @@ 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)) session2 := podmanTest.RunTopContainer("test2") session2.WaitWithDefaultTimeout() Expect(session2.ExitCode()).To(Equal(0)) - session3 := podmanTest.Podman([]string{"stop", "-l", "-t", "1"}) + cid := "-l" + if IsRemote() { + cid = "test2" + } + session3 := podmanTest.Podman([]string{"stop", cid, "-t", "1"}) session3.WaitWithDefaultTimeout() Expect(session3.ExitCode()).To(Equal(0)) session4 := podmanTest.Podman([]string{"stop", "-a", "-t", "1"}) @@ -286,7 +289,7 @@ var _ = Describe("Podman stop", func() { }) It("podman stop invalid --latest and --cidfile and --all", func() { - SkipIfRemote() + SkipIfRemote("--latest flag n/a") result := podmanTest.Podman([]string{"stop", "--cidfile", "foobar", "--latest"}) result.WaitWithDefaultTimeout() diff --git a/test/e2e/system_df_test.go b/test/e2e/system_df_test.go index c184e1d01..aee5dafb8 100644 --- a/test/e2e/system_df_test.go +++ b/test/e2e/system_df_test.go @@ -35,7 +35,7 @@ var _ = Describe("podman system df", func() { }) It("podman system df", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") session := podmanTest.Podman([]string{"create", ALPINE}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/system_reset_test.go b/test/e2e/system_reset_test.go index 1c174e690..1a030216f 100644 --- a/test/e2e/system_reset_test.go +++ b/test/e2e/system_reset_test.go @@ -34,7 +34,7 @@ var _ = Describe("podman system reset", func() { }) It("podman system reset", func() { - SkipIfRemote() + SkipIfRemote("system reset not supported on podman --remote") // system reset will not remove additional store images, so need to grab length session := podmanTest.Podman([]string{"rmi", "--force", "--all"}) diff --git a/test/e2e/unshare_test.go b/test/e2e/unshare_test.go index a0c41b6f3..182a65775 100644 --- a/test/e2e/unshare_test.go +++ b/test/e2e/unshare_test.go @@ -15,7 +15,7 @@ var _ = Describe("Podman unshare", func() { podmanTest *PodmanTestIntegration ) BeforeEach(func() { - SkipIfRemote() + SkipIfRemote("podman-remote unshare is not supported") if _, err := os.Stat("/proc/self/uid_map"); err != nil { Skip("User namespaces not supported.") } diff --git a/test/e2e/untag_test.go b/test/e2e/untag_test.go index 4e6dd6462..7766ce634 100644 --- a/test/e2e/untag_test.go +++ b/test/e2e/untag_test.go @@ -33,7 +33,7 @@ var _ = Describe("Podman untag", func() { }) It("podman untag all", func() { - SkipIfRemote() + SkipIfRemote("FIXME This should work on podman-remote") setup := podmanTest.PodmanNoCache([]string{"pull", ALPINE}) setup.WaitWithDefaultTimeout() Expect(setup.ExitCode()).To(Equal(0)) diff --git a/test/system/005-info.bats b/test/system/005-info.bats index 3f1efd364..ef3e97af0 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -19,6 +19,8 @@ graphRoot: graphStatus: imageStore:\\\s\\\+number: 1 runRoot: +cgroupManager: +cgroupVersion: v " while read expect; do is "$output" ".*$expect" "output includes '$expect'" diff --git a/test/system/120-load.bats b/test/system/120-load.bats index d7aa16d95..8ea9b1c69 100644 --- a/test/system/120-load.bats +++ b/test/system/120-load.bats @@ -147,4 +147,45 @@ verify_iid_and_name() { "Diagnostic from 'podman load' without redirection or -i" } +@test "podman load - multi-image archive" { + img1="quay.io/libpod/testimage:00000000" + img2="quay.io/libpod/testimage:20200902" + archive=$PODMAN_TMPDIR/myimage-$(random_string 8).tar + + run_podman pull $img1 + run_podman pull $img2 + + run_podman save -m -o $archive $img1 $img2 + run_podman rmi -f $img1 $img2 + run_podman load -i $archive + + run_podman image exists $img1 + run_podman image exists $img2 + run_podman rmi -f $img1 $img2 +} + +@test "podman load - multi-image archive with redirect" { + img1="quay.io/libpod/testimage:00000000" + img2="quay.io/libpod/testimage:20200902" + archive=$PODMAN_TMPDIR/myimage-$(random_string 8).tar + + run_podman pull $img1 + run_podman pull $img2 + + # We can't use run_podman because that uses the BATS 'run' function + # which redirects stdout and stderr. Here we need to guarantee + # that podman's stdout is a pipe, not any other form of redirection + $PODMAN save -m $img1 $img2 | cat >$archive + if [ "$status" -ne 0 ]; then + die "Command failed: podman save ... | cat" + fi + + run_podman rmi -f $img1 $img2 + run_podman load -i $archive + + run_podman image exists $img1 + run_podman image exists $img2 + run_podman rmi -f $img1 $img2 +} + # vim: filetype=sh |