summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/logs_test.go33
-rw-r--r--test/system/160-volumes.bats25
2 files changed, 57 insertions, 1 deletions
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index 7c0fcc8ee..cb795438d 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -37,7 +37,9 @@ var _ = Describe("Podman logs", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
+ if err := podmanTest.SeedImages(); err != nil {
+ os.Exit(1)
+ }
})
AfterEach(func() {
@@ -412,4 +414,33 @@ var _ = Describe("Podman logs", func() {
logs.WaitWithDefaultTimeout()
Expect(logs).To(Not(Exit(0)))
})
+
+ It("podman pod logs with container names", func() {
+ SkipIfRemote("Remote can only process one container at a time")
+ SkipIfInContainer("journalctl inside a container doesn't work correctly")
+ podName := "testPod"
+ containerName1 := "container1"
+ containerName2 := "container2"
+
+ testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
+ testPod.WaitWithDefaultTimeout()
+ Expect(testPod).To(Exit(0))
+
+ log1 := podmanTest.Podman([]string{"run", "--name", containerName1, "-d", "--pod", podName, BB, "/bin/sh", "-c", "echo log1"})
+ log1.WaitWithDefaultTimeout()
+ Expect(log1).To(Exit(0))
+
+ log2 := podmanTest.Podman([]string{"run", "--name", containerName2, "-d", "--pod", podName, BB, "/bin/sh", "-c", "echo log2"})
+ log2.WaitWithDefaultTimeout()
+ Expect(log2).To(Exit(0))
+
+ results := podmanTest.Podman([]string{"pod", "logs", "--names", podName})
+ results.WaitWithDefaultTimeout()
+ Expect(results).To(Exit(0))
+
+ output := results.OutputToStringArray()
+ Expect(output).To(HaveLen(2))
+ Expect(output).To(ContainElement(ContainSubstring(containerName1)))
+ Expect(output).To(ContainElement(ContainSubstring(containerName2)))
+ })
})
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index a3c972b3e..d0088b994 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -387,4 +387,29 @@ NeedsChown | true
run_podman volume rm $myvolume
}
+@test "podman volume mount" {
+ skip_if_remote "podman --remote volume mount not supported"
+ myvolume=myvol$(random_string)
+ myfile=myfile$(random_string)
+ mytext=$(random_string)
+
+ # Create a named volume
+ run_podman volume create $myvolume
+ is "$output" "$myvolume" "output from volume create"
+
+ if ! is_rootless ; then
+ # image mount is hard to test as a rootless user
+ # and does not work remotely
+ run_podman volume mount ${myvolume}
+ mnt=${output}
+ echo $mytext >$mnt/$myfile
+ run_podman run -v ${myvolume}:/vol:z $IMAGE cat /vol/$myfile
+ is "$output" "$mytext" "$myfile should exist within the containers volume and contain $mytext"
+ run_podman volume unmount ${myvolume}
+ else
+ run_podman 125 volume mount ${myvolume}
+ is "$output" "Error: cannot run command \"podman volume mount\" in rootless mode, must execute.*podman unshare.*first" "Should fail and complain about unshare"
+ fi
+}
+
# vim: filetype=sh