summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/10-images.at6
-rw-r--r--test/e2e/info_test.go10
-rw-r--r--test/e2e/logs_test.go1
-rw-r--r--test/e2e/run_test.go24
-rw-r--r--test/e2e/version_test.go11
-rw-r--r--test/system/001-basic.bats2
-rw-r--r--test/system/035-logs.bats11
-rw-r--r--test/system/500-networking.bats2
8 files changed, 57 insertions, 10 deletions
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at
index a204df65c..bdc298ae3 100644
--- a/test/apiv2/10-images.at
+++ b/test/apiv2/10-images.at
@@ -39,7 +39,11 @@ t GET images/$iid/json 200 \
.Id=sha256:$iid \
.RepoTags[0]=$IMAGE
-#t POST images/create fromImage=alpine 201 foo
+t POST "images/create?fromImage=alpine" '' 200
+
+t POST "images/create?fromImage=alpine&tag=latest" '' 200
+
+t POST "images/create?fromImage=docker.io/library/alpine&tag=sha256:acd3ca9941a85e8ed16515bfc5328e4e2f8c128caa72959a58a127b7801ee01f" '' 200
# Display the image history
t GET libpod/images/nonesuch/history 404
diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go
index bcbfdd80a..49f5f0ce6 100644
--- a/test/e2e/info_test.go
+++ b/test/e2e/info_test.go
@@ -50,15 +50,17 @@ var _ = Describe("Podman Info", func() {
{"{{ json .}}", true, 0},
{"{{json . }}", true, 0},
{" {{ json . }} ", true, 0},
- {"{{json }}", false, 125},
+ {"{{json }}", true, 0},
{"{{json .", false, 125},
- {"json . }}", false, 0}, // Note: this does NOT fail but produces garbage
+ {"json . }}", false, 0}, // without opening {{ template seen as string literal
}
for _, tt := range tests {
session := podmanTest.Podman([]string{"info", "--format", tt.input})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(tt.exitCode))
- Expect(session.IsJSONOutputValid()).To(Equal(tt.success))
+
+ desc := fmt.Sprintf("JSON test(%q)", tt.input)
+ Expect(session).Should(Exit(tt.exitCode), desc)
+ Expect(session.IsJSONOutputValid()).To(Equal(tt.success), desc)
}
})
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index 3aa3cf409..67ab71d20 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -203,6 +203,7 @@ var _ = Describe("Podman logs", func() {
results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
+ Expect(results.OutputToString()).To(Equal("podman podman podman"))
})
It("using journald tail two lines", func() {
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 292df529c..05aede122 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -67,6 +67,30 @@ var _ = Describe("Podman run", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman run --rm with --restart", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--restart", "", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "no", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // the --rm option conflicts with --restart, when the restartPolicy is not "" and "no"
+ // so the exitCode should not equal 0
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "on-failure", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "always", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "unless-stopped", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ })
+
It("podman run a container based on on a short name with localhost", func() {
tag := podmanTest.Podman([]string{"tag", nginx, "localhost/libpod/alpine_nginx:latest"})
tag.WaitWithDefaultTimeout()
diff --git a/test/e2e/version_test.go b/test/e2e/version_test.go
index 695cccc11..903748b58 100644
--- a/test/e2e/version_test.go
+++ b/test/e2e/version_test.go
@@ -1,6 +1,7 @@
package integration
import (
+ "fmt"
"os"
. "github.com/containers/podman/v2/test/utils"
@@ -68,15 +69,17 @@ var _ = Describe("Podman version", func() {
{"{{ json .}}", true, 0},
{"{{json . }}", true, 0},
{" {{ json . }} ", true, 0},
- {"{{json }}", false, 125},
+ {"{{json }}", true, 0},
{"{{json .", false, 125},
- {"json . }}", false, 0}, // Note: this does NOT fail but produces garbage
+ {"json . }}", false, 0}, // without opening {{ template seen as string literal
}
for _, tt := range tests {
session := podmanTest.Podman([]string{"version", "--format", tt.input})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(tt.exitCode))
- Expect(session.IsJSONOutputValid()).To(Equal(tt.success))
+
+ desc := fmt.Sprintf("JSON test(%q)", tt.input)
+ Expect(session).Should(Exit(tt.exitCode), desc)
+ Expect(session.IsJSONOutputValid()).To(Equal(tt.success), desc)
}
})
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 1d5eb066b..d276cfda1 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -61,7 +61,7 @@ function setup() {
is "$output" ".*Server:" "podman --remote: contacts server"
# This was failing: "podman --foo --bar --remote".
- PODMAN="${podman_non_remote} --tmpdir /var/tmp --log-level=error ${podman_args[@]} --remote" run_podman version
+ PODMAN="${podman_non_remote} --log-level=error ${podman_args[@]} --remote" run_podman version
is "$output" ".*Server:" "podman [flags] --remote: contacts server"
# ...but no matter what, --remote is never allowed after subcommand
diff --git a/test/system/035-logs.bats b/test/system/035-logs.bats
index cbb2091e5..130bc5243 100644
--- a/test/system/035-logs.bats
+++ b/test/system/035-logs.bats
@@ -50,4 +50,15 @@ ${cid[1]} c
${cid[0]} d" "Sequential output from logs"
}
+@test "podman logs over journald" {
+ msg=$(random_string 20)
+
+ run_podman run --name myctr --log-driver journald $IMAGE echo $msg
+
+ run_podman logs myctr
+ is "$output" "$msg" "check that log output equals the container output"
+
+ run_podman rm myctr
+}
+
# vim: filetype=sh
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 150626ded..a923402ac 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -82,6 +82,8 @@ load helpers
# "network create" now works rootless, with the help of a special container
@test "podman network create" {
+ skip_if_remote "FIXME: pending #7808"
+
local mynetname=testnet-$(random_string 10)
local mysubnet=$(random_rfc1918_subnet)