summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/20-containers.at25
-rw-r--r--test/e2e/config.go4
-rw-r--r--test/e2e/create_test.go5
-rw-r--r--test/e2e/exec_test.go5
-rw-r--r--test/e2e/healthcheck_run_test.go1
-rw-r--r--test/e2e/images_test.go8
-rw-r--r--test/e2e/load_test.go18
-rw-r--r--test/e2e/pod_ps_test.go8
-rw-r--r--test/e2e/start_test.go6
-rw-r--r--test/e2e/stats_test.go2
-rw-r--r--test/system/005-info.bats6
-rw-r--r--test/system/helpers.bash7
-rwxr-xr-xtest/system/helpers.t9
13 files changed, 75 insertions, 29 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 9ea3cb7ed..187073fb9 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -176,6 +176,31 @@ t GET containers/$cid/json 200 \
.Config.Cmd='[]' \
.Path="echo" \
.Args[0]="param1"
+
+# create a running container for after
+t POST containers/create '"Image":"'$IMAGE'","Entrypoint":["top"]' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid_top=$(jq -r '.Id' <<<"$output")
+t GET containers/${cid_top}/json 200 \
+ .Config.Entrypoint[0]="top" \
+ .Config.Cmd='[]' \
+ .Path="top"
+t POST containers/${cid_top}/start '' 204
+# make sure the container is running
+t GET containers/${cid_top}/json 200 \
+ .State.Status="running"
+
+# 0 means unlimited, need same with docker
+t GET containers/json?limit=0 200 \
+ .[0].Id~[0-9a-f]\\{64\\}
+
+t GET 'containers/json?limit=0&all=1' 200 \
+ .[0].Id~[0-9a-f]\\{64\\} \
+ .[1].Id~[0-9a-f]\\{64\\}
+
+t POST containers/${cid_top}/stop "" 204
+
t DELETE containers/$cid 204
+t DELETE containers/$cid_top 204
# vim: filetype=sh
diff --git a/test/e2e/config.go b/test/e2e/config.go
index 71c4dee31..0e1850614 100644
--- a/test/e2e/config.go
+++ b/test/e2e/config.go
@@ -27,8 +27,4 @@ var (
// v2fail is a temporary variable to help us track
// tests that fail in v2
v2fail = "does not pass integration tests with v2 podman"
-
- // v2remotefail is a temporary variable to help us track
- // tests that fail in v2 remote
- v2remotefail = "does not pass integration tests with v2 podman remote"
)
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 6845f1199..3fce536e2 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -108,13 +108,12 @@ var _ = Describe("Podman create", func() {
})
It("podman create --entrypoint \"\"", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"create", "--entrypoint", "", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
- result := podmanTest.Podman([]string{"inspect", "-l", "--format", "{{.Config.Entrypoint}}"})
+ result := podmanTest.Podman([]string{"inspect", session.OutputToString(), "--format", "{{.Config.Entrypoint}}"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
Expect(result.OutputToString()).To(Equal(""))
@@ -134,7 +133,6 @@ var _ = Describe("Podman create", func() {
})
It("podman create --mount flag with multiple mounts", func() {
- Skip(v2remotefail)
vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
err := os.MkdirAll(vol1, 0755)
Expect(err).To(BeNil())
@@ -160,7 +158,6 @@ var _ = Describe("Podman create", func() {
if podmanTest.Host.Arch == "ppc64le" {
Skip("skip failing test on ppc64le")
}
- Skip(v2remotefail)
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
os.Mkdir(mountPath, 0755)
session := podmanTest.Podman([]string{"create", "--name", "test", "--mount", fmt.Sprintf("type=bind,src=%s,target=/create/test", mountPath), ALPINE, "grep", "/create/test", "/proc/self/mountinfo"})
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index 745f7564e..7d50c02b2 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -123,13 +123,12 @@ var _ = Describe("Podman exec", func() {
})
It("podman exec terminal doesn't hang", func() {
- Skip(v2remotefail)
- setup := podmanTest.Podman([]string{"run", "-dti", fedoraMinimal, "sleep", "+Inf"})
+ setup := podmanTest.Podman([]string{"run", "-dti", "--name", "test1", fedoraMinimal, "sleep", "+Inf"})
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
for i := 0; i < 5; i++ {
- session := podmanTest.Podman([]string{"exec", "-lti", "true"})
+ session := podmanTest.Podman([]string{"exec", "-ti", "test1", "true"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
}
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index c020860ea..71e73af9c 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -174,7 +174,6 @@ var _ = Describe("Podman healthcheck run", func() {
})
It("podman healthcheck single healthy result changes failed to healthy", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--health-retries", "2", "--health-cmd", "ls /foo || exit 1", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index ddf2e20b8..d9ad10fe9 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -176,7 +176,7 @@ var _ = Describe("Podman images", func() {
})
It("podman images filter before image", func() {
- Skip(v2remotefail)
+ SkipIfRemote("FIXME This should work on podman-remote")
dockerfile := `FROM docker.io/library/alpine:latest
RUN apk update && apk add strace
`
@@ -189,7 +189,6 @@ RUN apk update && apk add strace
})
It("podman images workingdir from image", func() {
- Skip(v2remotefail)
dockerfile := `FROM docker.io/library/alpine:latest
WORKDIR /test
`
@@ -341,7 +340,7 @@ WORKDIR /test
})
It("podman images --all flag", func() {
- Skip(v2remotefail)
+ SkipIfRemote("FIXME This should work on podman-remote")
podmanTest.RestoreAllArtifacts()
dockerfile := `FROM docker.io/library/alpine:latest
RUN mkdir hello
@@ -361,7 +360,6 @@ ENV foo=bar
})
It("podman images filter by label", func() {
- Skip(v2remotefail)
dockerfile := `FROM docker.io/library/alpine:latest
LABEL version="1.0"
LABEL "com.example.vendor"="Example Vendor"
@@ -374,7 +372,7 @@ LABEL "com.example.vendor"="Example Vendor"
})
It("podman with images with no layers", func() {
- Skip(v2remotefail)
+ SkipIfRemote("FIXME This should work on podman-remote")
dockerfile := strings.Join([]string{
`FROM scratch`,
`LABEL org.opencontainers.image.authors="<somefolks@example.org>"`,
diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go
index c517c90d8..ddffadac0 100644
--- a/test/e2e/load_test.go
+++ b/test/e2e/load_test.go
@@ -123,7 +123,7 @@ var _ = Describe("Podman load", func() {
})
It("podman load directory", func() {
- SkipIfRemote("FIXME: Remote Load is broken.")
+ SkipIfRemote("Remote does not support loading directories")
outdir := filepath.Join(podmanTest.TempDir, "alpine")
save := podmanTest.PodmanNoCache([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE})
@@ -139,6 +139,22 @@ var _ = Describe("Podman load", func() {
Expect(result.ExitCode()).To(Equal(0))
})
+ It("podman-remote load directory", func() {
+ // Remote-only test looking for the specific remote error
+ // message when trying to load a directory.
+ if !IsRemote() {
+ Skip("Remote only test")
+ }
+
+ result := podmanTest.Podman([]string{"load", "-i", podmanTest.TempDir})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(125))
+
+ errMsg := fmt.Sprintf("remote client supports archives only but %q is a directory", podmanTest.TempDir)
+ found, _ := result.ErrorGrepString(errMsg)
+ Expect(found).Should(BeTrue())
+ })
+
It("podman load bogus file", func() {
save := podmanTest.PodmanNoCache([]string{"load", "-i", "foobar.tar"})
save.WaitWithDefaultTimeout()
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index d65bb33c7..17ed6a9c0 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -212,17 +212,17 @@ var _ = Describe("Podman ps", func() {
Expect(ec).To(Equal(0))
_, ec, podid2 := podmanTest.CreatePodWithLabels("", map[string]string{
- "io.podman.test.label": "value1",
- "io.podman.test.key": "irrelevant-value",
+ "app": "myapp",
+ "io.podman.test.key": "irrelevant-value",
})
Expect(ec).To(Equal(0))
_, ec, podid3 := podmanTest.CreatePodWithLabels("", map[string]string{
- "io.podman.test.label": "value2",
+ "app": "test",
})
Expect(ec).To(Equal(0))
- session := podmanTest.Podman([]string{"pod", "ps", "--no-trunc", "--filter", "label=io.podman.test.key", "--filter", "label=io.podman.test.label=value1"})
+ session := podmanTest.Podman([]string{"pod", "ps", "--no-trunc", "--filter", "label=app", "--filter", "label=app=myapp"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(Not(ContainSubstring(podid1)))
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index 45c26fe43..35b5cab6e 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -131,14 +131,16 @@ var _ = Describe("Podman start", func() {
})
It("podman failed to start with --rm should delete the container", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"create", "--name", "test1", "-it", "--rm", ALPINE, "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
start := podmanTest.Podman([]string{"start", "test1"})
start.WaitWithDefaultTimeout()
- Expect(start).To(ExitWithError())
+
+ wait := podmanTest.Podman([]string{"wait", "test1"})
+ wait.WaitWithDefaultTimeout()
+ Expect(wait).To(ExitWithError())
Eventually(podmanTest.NumberOfContainers(), defaultWaitTimeout, 3.0).Should(BeZero())
})
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index ff6ddce7e..7ab435007 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -1,4 +1,4 @@
-// +build !remote
+// +build
package integration
diff --git a/test/system/005-info.bats b/test/system/005-info.bats
index ef3e97af0..7452c1901 100644
--- a/test/system/005-info.bats
+++ b/test/system/005-info.bats
@@ -19,8 +19,8 @@ graphRoot:
graphStatus:
imageStore:\\\s\\\+number: 1
runRoot:
-cgroupManager:
-cgroupVersion: v
+cgroupManager: \\\(systemd\\\|cgroupfs\\\)
+cgroupVersion: v[12]
"
while read expect; do
is "$output" ".*$expect" "output includes '$expect'"
@@ -36,6 +36,8 @@ cgroupVersion: v
tests="
host.buildahVersion | [0-9.]
host.conmon.path | $expr_path
+host.cgroupManager | \\\(systemd\\\|cgroupfs\\\)
+host.cgroupVersion | v[12]
host.ociRuntime.path | $expr_path
store.configFile | $expr_path
store.graphDriverName | [a-z0-9]\\\+\\\$
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 514ba249e..112b73962 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -376,7 +376,12 @@ function parse_table() {
while read col; do
dprint "col=<<$col>>"
row+=("$col")
- done < <(echo "$line" | tr '|' '\012' | sed -e 's/^ *//' -e 's/\\/\\\\/g')
+ done < <(echo "$line" | sed -E -e 's/(^|\s)\|(\s|$)/\n /g' | sed -e 's/^ *//' -e 's/\\/\\\\/g')
+ # the above seds:
+ # 1) Convert '|' to newline, but only if bracketed by spaces or
+ # at beginning/end of line (this allows 'foo|bar' in tests);
+ # 2) then remove leading whitespace;
+ # 3) then double-escape all backslashes
printf "%q " "${row[@]}"
printf "\n"
diff --git a/test/system/helpers.t b/test/system/helpers.t
index 7a331174b..190e8ba35 100755
--- a/test/system/helpers.t
+++ b/test/system/helpers.t
@@ -85,7 +85,7 @@ while read x y z; do
check_result "$x" "''" "empty string - left-hand"
check_result "$y" "''" "empty string - middle"
check_result "$z" "''" "empty string - right"
-done < <(parse_table " | |")
+done < <(parse_table " | |")
# Quotes
while read x y z;do
@@ -108,6 +108,13 @@ while read x y z;do
check_result "$3" "g" "double quotes - token split - 3"
done < <(parse_table "a 'b c' | d \"e f\" g | h")
+# Split on '|' only when bracketed by spaces or at beginning/end of line
+while read x y z;do
+ check_result "$x" "|x" "pipe in strings - pipe at start"
+ check_result "$y" "y|y1" "pipe in strings - pipe in middle"
+ check_result "$z" "z|" "pipe in strings - pipe at end"
+done < <(parse_table "|x | y|y1 | z|")
+
# END test the parse_table helper
###############################################################################
# BEGIN dprint