summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/create_test.go2
-rw-r--r--test/e2e/exec_test.go27
-rw-r--r--test/e2e/healthcheck_run_test.go3
-rw-r--r--test/e2e/images_test.go29
-rw-r--r--test/e2e/init_test.go6
-rw-r--r--test/e2e/pod_create_test.go24
-rw-r--r--test/e2e/prune_test.go31
-rw-r--r--test/e2e/run_exit_test.go1
-rw-r--r--test/e2e/run_volume_test.go2
-rw-r--r--test/e2e/untag_test.go1
-rw-r--r--test/system/160-volumes.bats11
11 files changed, 83 insertions, 54 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 7d4858551..0a6373bfa 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -207,7 +207,7 @@ var _ = Describe("Podman create", func() {
session = podmanTest.Podman([]string{"logs", "test_tmpfs"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring("/create/test rw,nosuid,nodev,noexec,relatime - tmpfs"))
+ Expect(session.OutputToString()).To(ContainSubstring("/create/test rw,nosuid,nodev,relatime - tmpfs"))
})
It("podman create --pod automatically", func() {
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index da80bba47..87dddb233 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -283,4 +283,31 @@ var _ = Describe("Podman exec", func() {
Expect(exec.ExitCode()).To(Equal(0))
Expect(strings.Contains(exec.OutputToString(), fmt.Sprintf("%s(%s)", gid, groupName))).To(BeTrue())
})
+
+ It("podman exec --detach", func() {
+ ctrName := "testctr"
+ ctr := podmanTest.Podman([]string{"run", "-t", "-i", "-d", "--name", ctrName, ALPINE, "top"})
+ ctr.WaitWithDefaultTimeout()
+ Expect(ctr.ExitCode()).To(Equal(0))
+
+ exec1 := podmanTest.Podman([]string{"exec", "-t", "-i", "-d", ctrName, "top"})
+ exec1.WaitWithDefaultTimeout()
+ Expect(ctr.ExitCode()).To(Equal(0))
+
+ data := podmanTest.InspectContainer(ctrName)
+ Expect(len(data)).To(Equal(1))
+ Expect(len(data[0].ExecIDs)).To(Equal(1))
+ Expect(strings.Contains(exec1.OutputToString(), data[0].ExecIDs[0])).To(BeTrue())
+
+ exec2 := podmanTest.Podman([]string{"exec", "-t", "-i", ctrName, "ps", "-a"})
+ exec2.WaitWithDefaultTimeout()
+ Expect(ctr.ExitCode()).To(Equal(0))
+ Expect(strings.Count(exec2.OutputToString(), "top")).To(Equal(2))
+
+ // Ensure that stop with a running detached exec session is
+ // clean.
+ stop := podmanTest.Podman([]string{"stop", ctrName})
+ stop.WaitWithDefaultTimeout()
+ Expect(stop.ExitCode()).To(Equal(0))
+ })
})
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index f434836d3..8e63d9f4c 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -83,7 +83,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck that should fail", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "docker.io/libpod/badhealthcheck:latest"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -122,7 +121,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck failed checks in start-period should not change status", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--health-start-period", "2m", "--health-retries", "2", "--health-cmd", "ls /foo || exit 1", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -144,7 +142,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck failed checks must reach retries before unhealthy ", 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 cd281e3c7..1715cf8c1 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -152,9 +152,7 @@ var _ = Describe("Podman images", func() {
})
It("podman images filter reference", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote()
podmanTest.RestoreAllArtifacts()
result := podmanTest.PodmanNoCache([]string{"images", "-q", "-f", "reference=docker.io*"})
result.WaitWithDefaultTimeout()
@@ -180,9 +178,7 @@ var _ = Describe("Podman images", func() {
})
It("podman images filter before image", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote()
dockerfile := `FROM docker.io/library/alpine:latest
RUN apk update && apk add man
`
@@ -194,9 +190,7 @@ RUN apk update && apk add man
})
It("podman images filter after image", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote()
podmanTest.RestoreAllArtifacts()
rmi := podmanTest.PodmanNoCache([]string{"rmi", "busybox"})
rmi.WaitWithDefaultTimeout()
@@ -212,9 +206,7 @@ RUN apk update && apk add man
})
It("podman image list filter after image", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote()
podmanTest.RestoreAllArtifacts()
rmi := podmanTest.PodmanNoCache([]string{"image", "rm", "busybox"})
rmi.WaitWithDefaultTimeout()
@@ -230,9 +222,7 @@ RUN apk update && apk add man
})
It("podman images filter dangling", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote()
dockerfile := `FROM docker.io/library/alpine:latest
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
@@ -308,9 +298,7 @@ RUN apk update && apk add man
})
It("podman images --all flag", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
+ SkipIfRemote()
podmanTest.RestoreAllArtifacts()
dockerfile := `FROM docker.io/library/alpine:latest
RUN mkdir hello
@@ -343,10 +331,7 @@ LABEL "com.example.vendor"="Example Vendor"
})
It("podman with images with no layers", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
-
+ SkipIfRemote()
dockerfile := strings.Join([]string{
`FROM scratch`,
`LABEL org.opencontainers.image.authors="<somefolks@example.org>"`,
diff --git a/test/e2e/init_test.go b/test/e2e/init_test.go
index 349487b03..721017d0c 100644
--- a/test/e2e/init_test.go
+++ b/test/e2e/init_test.go
@@ -90,7 +90,6 @@ var _ = Describe("Podman init", func() {
})
It("podman init all three containers, one running", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"create", "--name", "test1", "-d", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -121,11 +120,10 @@ var _ = Describe("Podman init", func() {
})
It("podman init running container errors", func() {
- Skip(v2remotefail)
- session := podmanTest.Podman([]string{"run", "-d", ALPINE, "top"})
+ session := podmanTest.Podman([]string{"run", "--name", "init_test", "-d", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- init := podmanTest.Podman([]string{"init", "--latest"})
+ init := podmanTest.Podman([]string{"init", "init_test"})
init.WaitWithDefaultTimeout()
Expect(init.ExitCode()).To(Equal(125))
})
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index 24bfa69ce..e56db54a2 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -2,7 +2,9 @@ package integration
import (
"fmt"
+ "io/ioutil"
"os"
+ "path/filepath"
"strings"
. "github.com/containers/libpod/test/utils"
@@ -282,4 +284,26 @@ var _ = Describe("Podman pod create", func() {
podCreate.WaitWithDefaultTimeout()
Expect(podCreate.ExitCode()).To(Equal(125))
})
+
+ It("podman create pod and print id to external file", func() {
+ // Switch to temp dir and restore it afterwards
+ cwd, err := os.Getwd()
+ Expect(err).To(BeNil())
+ Expect(os.Chdir(os.TempDir())).To(BeNil())
+ targetPath := filepath.Join(os.TempDir(), "dir")
+ Expect(os.MkdirAll(targetPath, 0755)).To(BeNil())
+ targetFile := filepath.Join(targetPath, "idFile")
+ defer Expect(os.RemoveAll(targetFile)).To(BeNil())
+ defer Expect(os.Chdir(cwd)).To(BeNil())
+
+ session := podmanTest.Podman([]string{"pod", "create", "--name=abc", "--pod-id-file", targetFile})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ id, _ := ioutil.ReadFile(targetFile)
+ check := podmanTest.Podman([]string{"pod", "inspect", "abc"})
+ check.WaitWithDefaultTimeout()
+ data := check.InspectPodToJSON()
+ Expect(data.ID).To(Equal(string(id)))
+ })
})
diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go
index ccd322dd2..e77e6dd25 100644
--- a/test/e2e/prune_test.go
+++ b/test/e2e/prune_test.go
@@ -161,7 +161,6 @@ var _ = Describe("Podman prune", func() {
})
It("podman system prune pods", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -169,12 +168,13 @@ var _ = Describe("Podman prune", func() {
session = podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ podid1 := session.OutputToString()
- session = podmanTest.Podman([]string{"pod", "start", "-l"})
+ session = podmanTest.Podman([]string{"pod", "start", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "stop", "-l"})
+ session = podmanTest.Podman([]string{"pod", "stop", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -194,17 +194,17 @@ var _ = Describe("Podman prune", func() {
})
It("podman system prune - pod,container stopped", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ podid1 := session.OutputToString()
// Start and stop a pod to get it in exited state.
- session = podmanTest.Podman([]string{"pod", "start", "-l"})
+ session = podmanTest.Podman([]string{"pod", "start", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "stop", "-l"})
+ session = podmanTest.Podman([]string{"pod", "stop", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -226,17 +226,17 @@ var _ = Describe("Podman prune", func() {
})
It("podman system prune with running, exited pod and volume prune set true", func() {
- Skip(v2remotefail)
// Start and stop a pod to get it in exited state.
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ podid1 := session.OutputToString()
- session = podmanTest.Podman([]string{"pod", "start", "-l"})
+ session = podmanTest.Podman([]string{"pod", "start", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "stop", "-l"})
+ session = podmanTest.Podman([]string{"pod", "stop", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -244,7 +244,9 @@ var _ = Describe("Podman prune", func() {
session = podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "start", "-l"})
+ podid2 := session.OutputToString()
+
+ session = podmanTest.Podman([]string{"pod", "start", podid2})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -301,17 +303,17 @@ var _ = Describe("Podman prune", func() {
})
It("podman system prune - with dangling images true", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"pod", "create"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ podid1 := session.OutputToString()
// Start and stop a pod to get it in exited state.
- session = podmanTest.Podman([]string{"pod", "start", "-l"})
+ session = podmanTest.Podman([]string{"pod", "start", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "stop", "-l"})
+ session = podmanTest.Podman([]string{"pod", "stop", podid1})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -320,9 +322,6 @@ var _ = Describe("Podman prune", func() {
create.WaitWithDefaultTimeout()
Expect(create.ExitCode()).To(Equal(0))
- // Adding images should be pruned
- podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
-
// Adding unused volume should not be pruned as volumes not set
session = podmanTest.Podman([]string{"volume", "create"})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/run_exit_test.go b/test/e2e/run_exit_test.go
index d4b44ff23..40731142e 100644
--- a/test/e2e/run_exit_test.go
+++ b/test/e2e/run_exit_test.go
@@ -62,7 +62,6 @@ var _ = Describe("Podman run exit", func() {
})
It("podman run exit 50", func() {
- Skip(v2remotefail)
result := podmanTest.Podman([]string{"run", ALPINE, "sh", "-c", "exit 50"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(50))
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index 1f892d9f8..58091ff68 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -117,7 +117,7 @@ var _ = Describe("Podman run with volumes", func() {
session = podmanTest.Podman([]string{"run", "--rm", "--mount", "type=tmpfs,target=" + dest, ALPINE, "grep", dest, "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(session.OutputToString()).To(ContainSubstring(dest + " rw,nosuid,nodev,noexec,relatime - tmpfs"))
+ Expect(session.OutputToString()).To(ContainSubstring(dest + " rw,nosuid,nodev,relatime - tmpfs"))
session = podmanTest.Podman([]string{"run", "--rm", "--mount", "type=tmpfs,target=/etc/ssl,tmpcopyup", ALPINE, "ls", "/etc/ssl"})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/untag_test.go b/test/e2e/untag_test.go
index 43b874d47..dc1a6208e 100644
--- a/test/e2e/untag_test.go
+++ b/test/e2e/untag_test.go
@@ -40,7 +40,6 @@ var _ = Describe("Podman untag", func() {
})
It("podman untag all", func() {
- Skip(v2remotefail)
session := podmanTest.PodmanNoCache([]string{"untag", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index 5d65a950f..3233e6f04 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -115,7 +115,8 @@ echo "got here -$rand-"
EOF
chmod 755 $mountpoint/myscript
- # By default, volumes are mounted noexec. This should fail.
+ # By default, volumes are mounted exec, but we have manually added the
+ # noexec option. This should fail.
# ARGH. Unfortunately, runc (used for cgroups v1) produces a different error
local expect_rc=126
local expect_msg='.* OCI runtime permission denied.*'
@@ -125,12 +126,12 @@ EOF
expect_msg='.* exec user process caused.*permission denied'
fi
- run_podman ${expect_rc} run --rm --volume $myvolume:/vol:z $IMAGE /vol/myscript
+ run_podman ${expect_rc} run --rm --volume $myvolume:/vol:noexec,z $IMAGE /vol/myscript
is "$output" "$expect_msg" "run on volume, noexec"
- # With exec, it should pass
- run_podman run --rm -v $myvolume:/vol:z,exec $IMAGE /vol/myscript
- is "$output" "got here -$rand-" "script in volume is runnable with exec"
+ # With the default, it should pass
+ run_podman run --rm -v $myvolume:/vol:z $IMAGE /vol/myscript
+ is "$output" "got here -$rand-" "script in volume is runnable with default (exec)"
# Clean up
run_podman volume rm $myvolume