Skip to content

Commit

Permalink
e2e tests: SkipIfRemote(): add a reason
Browse files Browse the repository at this point in the history
Now that Dan has added helpful comments to each SkipIfRemote,
let's take the next step and include those messages in the
Skip() output so someone viewing test results can easily
see if a remote test is skipped for a real reason or for
a FIXME.

This commit is the result of a simple:

   perl -pi -e 's;(SkipIfRemote)\(\)(\s+//\s+(.*))?;$1("$3");' *.go

in the test/e2e directory, with a few minor (manual) changes
in wording.

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago authored and mheon committed Sep 25, 2020
1 parent de11de7 commit 65f2f1a
Show file tree
Hide file tree
Showing 40 changed files with 69 additions and 69 deletions.
4 changes: 2 additions & 2 deletions test/e2e/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,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() // FIXME: This is broken should be fixed
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))
Expand Down Expand Up @@ -221,7 +221,7 @@ var _ = Describe("Podman build", func() {
})

It("podman build --http_proxy flag", func() {
SkipIfRemote() // FIXME: This is broken should be fixed
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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() // --testing Remote Volumes
SkipIfRemote("--testing Remote Volumes")
s := podmanTest.Podman([]string{"run", "--name", "test1", "-v", "/tmp:/foo", "alpine", "date"})
s.WaitWithDefaultTimeout()
Expect(s.ExitCode()).To(Equal(0))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/cp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var _ = Describe("Podman cp", func() {
})

It("podman cp stdin/stdout", func() {
SkipIfRemote() // podman-remote cp not implemented yet
SkipIfRemote("FIXME: podman-remote cp not implemented yet")
session := podmanTest.Podman([]string{"create", ALPINE, "ls", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,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)))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ var _ = Describe("Podman exec", func() {
})

It("podman exec preserves container groups with --user and --group-add", func() {
SkipIfRemote() // FIXME: This is broken SECCOMP Failues?
SkipIfRemote("FIXME: This is broken SECCOMP Failues?")

dockerfile := `FROM fedora-minimal
RUN groupadd -g 4000 first
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var _ = Describe("Podman Info", func() {
if !rootless.IsRootless() {
Skip("test of rootless_storage_path is only meaningful as rootless")
}
SkipIfRemote() // Only tests storage on local client
SkipIfRemote("Only tests storage on local client")
oldHOME, hasHOME := os.LookupEnv("HOME")
defer func() {
if hasHOME {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var _ = Describe("Podman init", func() {
})

It("podman init latest container", func() {
SkipIfRemote() // Testing --latest flag
SkipIfRemote("--latest flag n/a")
session := podmanTest.Podman([]string{"create", "-d", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var _ = Describe("Podman inspect", func() {
})

It("podman inspect -l with additional input should fail", func() {
SkipIfRemote() // testing --latest flag
SkipIfRemote("--latest flag n/a")
result := podmanTest.Podman([]string{"inspect", "-l", "1234foobar"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(125))
Expand Down Expand Up @@ -173,7 +173,7 @@ var _ = Describe("Podman inspect", func() {
})

It("podman inspect --latest with no container fails", func() {
SkipIfRemote() // testing --latest flag
SkipIfRemote("testing --latest flag")

session := podmanTest.Podman([]string{"inspect", "--latest"})
session.WaitWithDefaultTimeout()
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/libpod_suite_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/libpod_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func IsRemote() bool {
return false
}

func SkipIfRemote() {
func SkipIfRemote(string) {
}

func SkipIfRootless() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/libpod_suite_varlink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var _ = Describe("Podman load", func() {
})

It("podman load directory", func() {
SkipIfRemote() // FIXME: Remote Load is broken.
SkipIfRemote("FIXME: Remote Load is broken.")
outdir := filepath.Join(podmanTest.TempDir, "alpine")

save := podmanTest.PodmanNoCache([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE})
Expand Down Expand Up @@ -243,7 +243,7 @@ var _ = Describe("Podman load", func() {
})

It("podman load localhost registry from dir", func() {
SkipIfRemote() // FIXME: podman-remote load is currently broken.
SkipIfRemote("FIXME: podman-remote load is currently broken.")
outfile := filepath.Join(podmanTest.TempDir, "load")

setup := podmanTest.PodmanNoCache([]string{"tag", BB, "hello:world"})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var _ = Describe("Podman logs", func() {
})

It("two containers showing short container IDs", func() {
SkipIfRemote() // FIXME: 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))
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var _ = Describe("Podman manifest", func() {
})

It("podman manifest annotate", func() {
SkipIfRemote() // Not supporting annotate on remote connections
SkipIfRemote("Not supporting annotate on remote connections")
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down Expand Up @@ -184,7 +184,7 @@ var _ = Describe("Podman manifest", func() {
})

It("podman manifest push purge", func() {
SkipIfRemote() // remote does not support --purge
SkipIfRemote("remote does not support --purge")
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ = Describe("Podman namespaces", func() {
})

It("podman namespace test", func() {
SkipIfRemote() // FIXME This should work on Remote
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))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/network_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ var _ = Describe("Podman network create", func() {
})

It("podman network create with name and subnet", func() {
SkipIfRemote() // FIXME, this should work on --remote
SkipIfRemote("FIXME, this should work on --remote")
var (
results []network.NcList
)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/play_kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ var _ = Describe("Podman generate kube", func() {
})

It("podman play kube seccomp container level", func() {
SkipIfRemote() // FIXME This is broken
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 {
Expand All @@ -820,7 +820,7 @@ var _ = Describe("Podman generate kube", func() {
})

It("podman play kube seccomp pod level", func() {
SkipIfRemote() // FIXME: This should work with --remote
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 {
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/pod_infra_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ var _ = Describe("Podman pod create", func() {
})

It("podman pod container can override pod pid NS", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
session := podmanTest.Podman([]string{"pod", "create", "--share", "pid"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down Expand Up @@ -257,7 +257,7 @@ var _ = Describe("Podman pod create", func() {
})

It("podman pod container can override pod not sharing pid", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
session := podmanTest.Podman([]string{"pod", "create", "--share", "net"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand All @@ -283,7 +283,7 @@ var _ = Describe("Podman pod create", func() {
})

It("podman pod container can override pod ipc NS", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
session := podmanTest.Podman([]string{"pod", "create", "--share", "ipc"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down Expand Up @@ -380,7 +380,7 @@ var _ = Describe("Podman pod create", func() {
})

It("podman run --add-host in pod", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pod_pod_namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var _ = Describe("Podman pod create", func() {
})

It("podman pod container dontshare PIDNS", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pod_ps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var _ = Describe("Podman ps", func() {
})

It("podman pod ps latest", func() {
SkipIfRemote() // Testing --latest flag
SkipIfRemote("--latest flag n/a")
_, ec, podid1 := podmanTest.CreatePod("")
Expect(ec).To(Equal(0))

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ var _ = Describe("Podman prune", func() {
})

It("podman image prune skip cache images", func() {
SkipIfRemote() // FIXME should work on podman --remote
SkipIfRemote("FIXME should work on podman --remote")
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")

none := podmanTest.Podman([]string{"images", "-a"})
Expand All @@ -110,7 +110,7 @@ var _ = Describe("Podman prune", func() {
})

It("podman image prune dangling images", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")

Expand Down Expand Up @@ -147,7 +147,7 @@ var _ = Describe("Podman prune", func() {
})

It("podman system image prune unused images", func() {
SkipIfRemote() // FIXME This should work on podman-remote
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"})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/ps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var _ = Describe("Podman ps", func() {
})

It("podman ps latest flag", func() {
SkipIfRemote() // --latest is not supported on podman-remote
SkipIfRemote("--latest is not supported on podman-remote")
_, ec, _ := podmanTest.RunLsContainer("")
Expect(ec).To(Equal(0))
_, ec, _ = podmanTest.RunLsContainer("")
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ var _ = Describe("Podman pull", func() {
})

It("podman pull from docker-archive", func() {
SkipIfRemote() // FIXME This should work on podman-remote
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"})
Expand Down Expand Up @@ -297,7 +297,7 @@ var _ = Describe("Podman pull", func() {
})

It("podman pull from oci-archive", func() {
SkipIfRemote() // FIXME This should work on podman-remote
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"})
Expand All @@ -316,7 +316,7 @@ var _ = Describe("Podman pull", func() {
})

It("podman pull from local directory", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
podmanTest.RestoreArtifact(ALPINE)
dirpath := filepath.Join(podmanTest.TempDir, "alpine")
os.MkdirAll(dirpath, os.ModePerm)
Expand All @@ -341,7 +341,7 @@ var _ = Describe("Podman pull", func() {
})

It("podman pull from local OCI directory", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
podmanTest.RestoreArtifact(ALPINE)
dirpath := filepath.Join(podmanTest.TempDir, "alpine")
os.MkdirAll(dirpath, os.ModePerm)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var _ = Describe("Podman rm", func() {
})

It("podman rm invalid --latest and --cidfile and --all", func() {
SkipIfRemote() // Verifying --latest flag
SkipIfRemote("Verifying --latest flag")

result := podmanTest.Podman([]string{"rm", "--cidfile", "foobar", "--latest"})
result.WaitWithDefaultTimeout()
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/rmi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ var _ = Describe("Podman rmi", func() {
})

It("podman rmi with cached images", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expand Down Expand Up @@ -255,7 +255,7 @@ var _ = Describe("Podman rmi", func() {
})

It("podman rmi -a with parent|child images", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
dockerfile := `FROM docker.io/library/alpine:latest AS base
RUN touch /1
ENV LOCAL=/1
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ = Describe("Podman run exit", func() {
})

It("podman run -d mount cleanup test", func() {
SkipIfRemote() // podman-remote does not support mount
SkipIfRemote("podman-remote does not support mount")
SkipIfRootless()

result := podmanTest.Podman([]string{"run", "-dt", ALPINE, "top"})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_entrypoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
})

It("podman run user entrypoint overrides image entrypoint and image cmd", func() {
SkipIfRemote() // FIXME This should work on podman-remote
SkipIfRemote("FIXME This should work on podman-remote")
dockerfile := `FROM docker.io/library/alpine:latest
CMD ["-i"]
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/run_env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var _ = Describe("Podman run", func() {
})

It("podman run --env-host environment test", func() {
SkipIfRemote() // FIXME, We should check that --env-host reports correct error on podman-remote
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)

Expand All @@ -108,7 +108,7 @@ var _ = Describe("Podman run", func() {
})

It("podman run --http-proxy test", func() {
SkipIfRemote() // FIXME: Should report proper error when http-proxy is not supported
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()
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ = Describe("Podman run restart containers", func() {
})

It("Podman start after successful run", func() {
SkipIfRemote() // FIXME This should work on podman-remote
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))
Expand Down
Loading

0 comments on commit 65f2f1a

Please sign in to comment.