summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-10 23:55:45 +0100
committerGitHub <noreply@github.com>2020-01-10 23:55:45 +0100
commit0e9c208d3f9fc6f160f7e7746119ddf99ae6f220 (patch)
tree858cfc2d1b6867ee9c81b6897f5ce802811a8fc4 /test
parent40a16ee4c36aa143d3b27da9189d16afce35740d (diff)
parent4726eb2861e72a079ed337371182226a666c541a (diff)
downloadpodman-0e9c208d3f9fc6f160f7e7746119ddf99ae6f220.tar.gz
podman-0e9c208d3f9fc6f160f7e7746119ddf99ae6f220.tar.bz2
podman-0e9c208d3f9fc6f160f7e7746119ddf99ae6f220.zip
Merge pull request #4805 from giuseppe/log-tag
log: support --log-opt tag=
Diffstat (limited to 'test')
-rw-r--r--test/e2e/libpod_suite_remoteclient_test.go2
-rw-r--r--test/e2e/logs_test.go19
2 files changed, 20 insertions, 1 deletions
diff --git a/test/e2e/libpod_suite_remoteclient_test.go b/test/e2e/libpod_suite_remoteclient_test.go
index 2cd485114..c87ff016a 100644
--- a/test/e2e/libpod_suite_remoteclient_test.go
+++ b/test/e2e/libpod_suite_remoteclient_test.go
@@ -24,7 +24,7 @@ func SkipIfRemote() {
func SkipIfRootless() {
if os.Geteuid() != 0 {
- ginkgo.Skip("This function is not enabled for remote podman")
+ ginkgo.Skip("This function is not enabled for rootless podman")
}
}
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index e25364695..0438a31cb 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -1,7 +1,9 @@
package integration
import (
+ "fmt"
"os"
+ "os/exec"
"strings"
. "github.com/containers/libpod/test/utils"
@@ -153,6 +155,23 @@ var _ = Describe("Podman logs", func() {
Expect(results.ExitCode()).To(BeZero())
})
+ It("podman journald logs for container with container tag", func() {
+ Skip("need to verify images have correct packages for journald")
+ logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "--log-opt=tag={{.ImageName}}", "-d", ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
+ logc.WaitWithDefaultTimeout()
+ Expect(logc.ExitCode()).To(Equal(0))
+ cid := logc.OutputToString()
+
+ wait := podmanTest.Podman([]string{"wait", "-l"})
+ wait.WaitWithDefaultTimeout()
+ Expect(wait.ExitCode()).To(BeZero())
+
+ cmd := exec.Command("journalctl", "--no-pager", "-o", "json", "--output-fields=CONTAINER_TAG", "-u", fmt.Sprintf("libpod-conmon-%s.scope", cid))
+ out, err := cmd.CombinedOutput()
+ Expect(err).To(BeNil())
+ Expect(string(out)).To(ContainSubstring("alpine"))
+ })
+
It("podman journald logs for container", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})