mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
logs: enable e2e tests
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -32,6 +32,8 @@ var (
|
|||||||
Long: logsDescription,
|
Long: logsDescription,
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
switch {
|
switch {
|
||||||
|
case registry.IsRemote() && logsOptions.Latest:
|
||||||
|
return errors.New(cmd.Name() + " does not support 'latest' when run remotely")
|
||||||
case registry.IsRemote() && len(args) > 1:
|
case registry.IsRemote() && len(args) > 1:
|
||||||
return errors.New(cmd.Name() + " does not support multiple containers when run remotely")
|
return errors.New(cmd.Name() + " does not support multiple containers when run remotely")
|
||||||
case logsOptions.Latest && len(args) > 0:
|
case logsOptions.Latest && len(args) > 0:
|
||||||
|
@ -121,7 +121,6 @@ var _ = Describe("Podman logs", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("latest and container name should fail", func() {
|
It("latest and container name should fail", func() {
|
||||||
SkipIfRemote() // -l not supported
|
|
||||||
results := podmanTest.Podman([]string{"logs", "-l", "foobar"})
|
results := podmanTest.Podman([]string{"logs", "-l", "foobar"})
|
||||||
results.WaitWithDefaultTimeout()
|
results.WaitWithDefaultTimeout()
|
||||||
Expect(results).To(ExitWithError())
|
Expect(results).To(ExitWithError())
|
||||||
@ -159,7 +158,6 @@ var _ = Describe("Podman logs", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("using journald for container with container tag", func() {
|
It("using journald for container with container tag", func() {
|
||||||
SkipIfRemote()
|
|
||||||
Skip("need to verify images have correct packages for journald")
|
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 := 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()
|
logc.WaitWithDefaultTimeout()
|
||||||
@ -178,7 +176,6 @@ var _ = Describe("Podman logs", func() {
|
|||||||
|
|
||||||
It("using journald for container name", func() {
|
It("using journald for container name", func() {
|
||||||
Skip("need to verify images have correct packages for journald")
|
Skip("need to verify images have correct packages for journald")
|
||||||
SkipIfRemote()
|
|
||||||
containerName := "inside-journal"
|
containerName := "inside-journal"
|
||||||
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-d", "--name", containerName, ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
|
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-d", "--name", containerName, ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
|
||||||
logc.WaitWithDefaultTimeout()
|
logc.WaitWithDefaultTimeout()
|
||||||
@ -273,7 +270,6 @@ var _ = Describe("Podman logs", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("streaming output", func() {
|
It("streaming output", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
containerName := "logs-f-rm"
|
containerName := "logs-f-rm"
|
||||||
|
|
||||||
logc := podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "sh", "-c", "echo podman; sleep 1; echo podman"})
|
logc := podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "sh", "-c", "echo podman; sleep 1; echo podman"})
|
||||||
@ -314,7 +310,6 @@ var _ = Describe("Podman logs", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("follow output stopped container", func() {
|
It("follow output stopped container", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
containerName := "logs-f"
|
containerName := "logs-f"
|
||||||
|
|
||||||
logc := podmanTest.Podman([]string{"run", "--name", containerName, "-d", ALPINE, "true"})
|
logc := podmanTest.Podman([]string{"run", "--name", containerName, "-d", ALPINE, "true"})
|
||||||
|
Reference in New Issue
Block a user