Skip to content

Commit

Permalink
Add more Remote tests
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jun 3, 2020
1 parent 95ea39e commit 8153f29
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 27 deletions.
12 changes: 4 additions & 8 deletions cmd/podman/containers/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ var (
Long: waitDescription,
RunE: wait,
Args: validate.IdOrLatestArgs,
Example: `podman wait --latest
podman wait --interval 5000 ctrID
Example: `podman wait --interval 5000 ctrID
podman wait ctrID1 ctrID2`,
}

Expand All @@ -35,8 +34,7 @@ var (
Long: waitCommand.Long,
RunE: waitCommand.RunE,
Args: validate.IdOrLatestArgs,
Example: `podman container wait --latest
podman container wait --interval 5000 ctrID
Example: `podman container wait --interval 5000 ctrID
podman container wait ctrID1 ctrID2`,
}
)
Expand All @@ -48,11 +46,9 @@ var (

func waitFlags(flags *pflag.FlagSet) {
flags.DurationVarP(&waitOptions.Interval, "interval", "i", time.Duration(250), "Milliseconds to wait before polling for completion")
flags.BoolVarP(&waitOptions.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.StringVar(&waitCondition, "condition", "stopped", "Condition to wait on")
if registry.IsRemote() {
// TODO: This is the same as V1. We could skip creating the flag altogether in V2...
_ = flags.MarkHidden("latest")
if !registry.IsRemote() {
flags.BoolVarP(&waitOptions.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
}
}

Expand Down
1 change: 0 additions & 1 deletion test/e2e/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ var _ = Describe("Podman create", func() {
})

It("podman create --authfile with nonexist authfile", func() {
SkipIfRemote()
session := podmanTest.PodmanNoCache([]string{"create", "--authfile", "/tmp/nonexist", "--name=foo", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).To(Not(Equal(0)))
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ var _ = Describe("Podman diff", func() {
})

It("podman diff container and committed image", func() {
SkipIfRemote()
session := podmanTest.Podman([]string{"run", "--name=diff-test", ALPINE, "touch", "/tmp/diff-test"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand All @@ -82,11 +81,10 @@ var _ = Describe("Podman diff", func() {
})

It("podman diff latest container", func() {
SkipIfRemote()
session := podmanTest.Podman([]string{"run", "--name=diff-test", ALPINE, "touch", "/tmp/diff-test"})
session := podmanTest.Podman([]string{"run", "--name", "diff-test", ALPINE, "touch", "/tmp/diff-test"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
session = podmanTest.Podman([]string{"diff", "-l"})
session = podmanTest.Podman([]string{"diff", "diff-test"})
session.WaitWithDefaultTimeout()
containerDiff := session.OutputToStringArray()
sort.Strings(containerDiff)
Expand Down
1 change: 0 additions & 1 deletion test/e2e/exists_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ var _ = Describe("Podman image|container exists", func() {
})
It("podman pod does not exist in local storage", func() {
// The exit code for non-existing pod is incorrect (125 vs 1)
SkipIfRemote()
session := podmanTest.Podman([]string{"pod", "exists", "foobar"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(1))
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/healthcheck_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ var _ = Describe("Podman healthcheck run", func() {
})

It("podman disable healthcheck with --no-healthcheck on valid container", func() {
SkipIfRemote()
session := podmanTest.Podman([]string{"run", "-dt", "--no-healthcheck", "--name", "hc", healthcheck})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand All @@ -52,7 +51,6 @@ var _ = Describe("Podman healthcheck run", func() {
})

It("podman disable healthcheck with --health-cmd=none on valid container", func() {
SkipIfRemote()
session := podmanTest.Podman([]string{"run", "-dt", "--health-cmd", "none", "--name", "hc", healthcheck})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
11 changes: 5 additions & 6 deletions test/e2e/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,28 +132,27 @@ var _ = Describe("Podman inspect", func() {
})

It("podman inspect with mount filters", func() {
SkipIfRemote()

ctrSession := podmanTest.Podman([]string{"create", "-v", "/tmp:/test1", ALPINE, "top"})
ctrSession := podmanTest.Podman([]string{"create", "--name", "test", "-v", "/tmp:/test1", ALPINE, "top"})
ctrSession.WaitWithDefaultTimeout()
Expect(ctrSession.ExitCode()).To(Equal(0))

inspectSource := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{(index .Mounts 0).Source}}"})
inspectSource := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Source}}"})
inspectSource.WaitWithDefaultTimeout()
Expect(inspectSource.ExitCode()).To(Equal(0))
Expect(inspectSource.OutputToString()).To(Equal("/tmp"))

inspectSrc := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{(index .Mounts 0).Src}}"})
inspectSrc := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Src}}"})
inspectSrc.WaitWithDefaultTimeout()
Expect(inspectSrc.ExitCode()).To(Equal(0))
Expect(inspectSrc.OutputToString()).To(Equal("/tmp"))

inspectDestination := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{(index .Mounts 0).Destination}}"})
inspectDestination := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Destination}}"})
inspectDestination.WaitWithDefaultTimeout()
Expect(inspectDestination.ExitCode()).To(Equal(0))
Expect(inspectDestination.OutputToString()).To(Equal("/test1"))

inspectDst := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{(index .Mounts 0).Dst}}"})
inspectDst := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Dst}}"})
inspectDst.WaitWithDefaultTimeout()
Expect(inspectDst.ExitCode()).To(Equal(0))
Expect(inspectDst.OutputToString()).To(Equal("/test1"))
Expand Down
1 change: 0 additions & 1 deletion test/e2e/pod_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ var _ = Describe("Podman pod create", func() {
})

It("podman create pod with IP address", func() {
SkipIfRemote()
SkipIfRootless()
name := "test"
ip := GetRandomIPAddress()
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/ps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ var _ = Describe("Podman ps", func() {
})

It("podman --pod with a non-empty pod name", func() {
SkipIfRemote()

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

It("podman pull from docker with nonexist --authfile", func() {
SkipIfRemote()
session := podmanTest.PodmanNoCache([]string{"pull", "--authfile", "/tmp/nonexist", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Not(Equal(0)))
Expand Down
1 change: 0 additions & 1 deletion test/e2e/volume_rm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ var _ = Describe("Podman volume rm", func() {
})

It("podman volume rm with --force flag", func() {
SkipIfRemote()
session := podmanTest.Podman([]string{"create", "-v", "myvol:/myvol", ALPINE, "ls"})
cid := session.OutputToString()
session.WaitWithDefaultTimeout()
Expand Down

0 comments on commit 8153f29

Please sign in to comment.