summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/cp_test.go33
-rw-r--r--test/e2e/healthcheck_run_test.go3
-rw-r--r--test/e2e/libpod_suite_remoteclient_test.go12
-rw-r--r--test/e2e/run_ns_test.go2
-rw-r--r--test/e2e/run_userns_test.go42
5 files changed, 50 insertions, 42 deletions
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index f89865264..591f533d6 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -112,4 +112,37 @@ var _ = Describe("Podman cp", func() {
}
Expect(string(output)).To(Equal("copy from host to container directory"))
})
+
+ It("podman cp dir to dir", func() {
+ path, err := os.Getwd()
+ if err != nil {
+ os.Exit(1)
+ }
+ testDirPath := filepath.Join(path, "TestDir")
+ err = os.Mkdir(testDirPath, 0777)
+ if err != nil {
+ os.Exit(1)
+ }
+
+ session := podmanTest.Podman([]string{"create", ALPINE, "ls", "/foodir"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ name := session.OutputToString()
+
+ session = podmanTest.Podman([]string{"cp", testDirPath, name + ":/foodir"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"start", "-a", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", testDirPath, name + ":/foodir"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"start", "-a", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal("TestDir"))
+ })
})
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index cd2365ce7..60be86ebc 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -42,7 +42,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck on valid container", func() {
- SkipIfRootless()
podmanTest.RestoreArtifact(healthcheck)
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", healthcheck})
session.WaitWithDefaultTimeout()
@@ -135,7 +134,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck good check results in healthy even in start-period", func() {
- SkipIfRootless()
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--healthcheck-start-period", "2m", "--healthcheck-retries", "2", "--healthcheck-command", "\"CMD-SHELL\" \"ls\" \"||\" \"exit\" \"1\"", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -149,7 +147,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck single healthy result changes failed to healthy", func() {
- SkipIfRootless()
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--healthcheck-retries", "2", "--healthcheck-command", "\"CMD-SHELL\" \"ls\" \"/foo\" \"||\" \"exit\" \"1\"", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/libpod_suite_remoteclient_test.go b/test/e2e/libpod_suite_remoteclient_test.go
index 44c5edf07..a85d21a48 100644
--- a/test/e2e/libpod_suite_remoteclient_test.go
+++ b/test/e2e/libpod_suite_remoteclient_test.go
@@ -139,19 +139,21 @@ func (p *PodmanTestIntegration) CleanupVolume() {
}
func PodmanTestCreate(tempDir string) *PodmanTestIntegration {
- if os.Geteuid() != 0 {
- ginkgo.Skip("This function is not enabled for rootless podman")
- }
pti := PodmanTestCreateUtil(tempDir, true)
pti.StartVarlink()
return pti
}
func (p *PodmanTestIntegration) StartVarlink() {
- if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
+ if os.Geteuid() == 0 {
os.MkdirAll("/run/podman", 0755)
}
- args := []string{"varlink", "--timeout", "0", "unix:/run/podman/io.podman"}
+ varlinkEndpoint := "unix:/run/podman/io.podman"
+ if addr := os.Getenv("PODMAN_VARLINK_ADDRESS"); addr != "" {
+ varlinkEndpoint = addr
+ }
+
+ args := []string{"varlink", "--timeout", "0", varlinkEndpoint}
podmanOptions := getVarlinkOptions(p, args)
command := exec.Command(p.PodmanBinary, podmanOptions...)
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go
index 5236e6584..51f921bce 100644
--- a/test/e2e/run_ns_test.go
+++ b/test/e2e/run_ns_test.go
@@ -63,7 +63,6 @@ var _ = Describe("Podman run ns", func() {
})
It("podman run ipcns ipcmk host test", func() {
- SkipIfRootless()
setup := SystemExec("ipcmk", []string{"-M", "1024"})
Expect(setup.ExitCode()).To(Equal(0))
output := strings.Split(setup.OutputToString(), " ")
@@ -77,7 +76,6 @@ var _ = Describe("Podman run ns", func() {
})
It("podman run ipcns ipcmk container test", func() {
- SkipIfRootless()
setup := podmanTest.Podman([]string{"run", "-d", "--name", "test1", fedoraMinimal, "sleep", "999"})
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index 5c38a8950..f7f0e1c9a 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -18,7 +18,12 @@ var _ = Describe("Podman UserNS support", func() {
)
BeforeEach(func() {
- SkipIfRootless()
+ if os.Getenv("SKIP_USERNS") != "" {
+ Skip("Skip userns tests.")
+ }
+ if _, err := os.Stat("/proc/self/uid_map"); err != nil {
+ Skip("User namespaces not supported.")
+ }
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -36,14 +41,7 @@ var _ = Describe("Podman UserNS support", func() {
})
It("podman uidmapping and gidmapping", func() {
- if os.Getenv("SKIP_USERNS") != "" {
- Skip("Skip userns tests.")
- }
- if _, err := os.Stat("/proc/self/uid_map"); err != nil {
- Skip("User namespaces not supported.")
- }
-
- session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "busybox", "echo", "hello"})
+ session := podmanTest.Podman([]string{"run", "--uidmap=0:100:5000", "--gidmap=0:200:5000", "alpine", "echo", "hello"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
ok, _ := session.GrepString("hello")
@@ -55,14 +53,7 @@ var _ = Describe("Podman UserNS support", func() {
// https://github.com/containers/libpod/pull/1066#issuecomment-403562116
// To avoid a potential future regression, use this as a test.
It("podman uidmapping and gidmapping with short-opts", func() {
- if os.Getenv("SKIP_USERNS") != "" {
- Skip("Skip userns tests.")
- }
- if _, err := os.Stat("/proc/self/uid_map"); err != nil {
- Skip("User namespaces not supported.")
- }
-
- session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "-it", "busybox", "echo", "hello"})
+ session := podmanTest.Podman([]string{"run", "--uidmap=0:1:5000", "--gidmap=0:200:5000", "-it", "alpine", "echo", "hello"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
ok, _ := session.GrepString("hello")
@@ -70,14 +61,7 @@ var _ = Describe("Podman UserNS support", func() {
})
It("podman uidmapping and gidmapping with a volume", func() {
- if os.Getenv("SKIP_USERNS") != "" {
- Skip("Skip userns tests.")
- }
- if _, err := os.Stat("/proc/self/uid_map"); err != nil {
- Skip("User namespaces not supported.")
- }
-
- session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "-v", "my-foo-volume:/foo:Z", "busybox", "echo", "hello"})
+ session := podmanTest.Podman([]string{"run", "--uidmap=0:1:500", "--gidmap=0:200:5000", "-v", "my-foo-volume:/foo:Z", "alpine", "echo", "hello"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
ok, _ := session.GrepString("hello")
@@ -85,13 +69,7 @@ var _ = Describe("Podman UserNS support", func() {
})
It("podman uidmapping and gidmapping --net=host", func() {
- if os.Getenv("SKIP_USERNS") != "" {
- Skip("Skip userns tests.")
- }
- if _, err := os.Stat("/proc/self/uid_map"); err != nil {
- Skip("User namespaces not supported.")
- }
- session := podmanTest.Podman([]string{"run", "--net=host", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "busybox", "echo", "hello"})
+ session := podmanTest.Podman([]string{"run", "--net=host", "--uidmap=0:1:5000", "--gidmap=0:200:5000", "alpine", "echo", "hello"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
ok, _ := session.GrepString("hello")