summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/images_test.go15
-rw-r--r--test/system/075-exec.bats15
-rw-r--r--test/system/200-pod.bats32
-rw-r--r--test/system/500-networking.bats23
4 files changed, 61 insertions, 24 deletions
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index 9a073cde6..b16cff411 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -151,7 +151,6 @@ var _ = Describe("Podman images", func() {
})
It("podman images filter reference", func() {
- SkipIfRemote()
podmanTest.RestoreAllArtifacts()
result := podmanTest.PodmanNoCache([]string{"images", "-q", "-f", "reference=docker.io*"})
result.WaitWithDefaultTimeout()
@@ -177,7 +176,6 @@ var _ = Describe("Podman images", func() {
})
It("podman images filter before image", func() {
- SkipIfRemote()
dockerfile := `FROM docker.io/library/alpine:latest
RUN apk update && apk add strace
`
@@ -189,7 +187,6 @@ RUN apk update && apk add strace
})
It("podman images filter after image", func() {
- SkipIfRemote()
podmanTest.RestoreAllArtifacts()
rmi := podmanTest.PodmanNoCache([]string{"rmi", "busybox"})
rmi.WaitWithDefaultTimeout()
@@ -205,7 +202,6 @@ RUN apk update && apk add strace
})
It("podman image list filter after image", func() {
- SkipIfRemote()
podmanTest.RestoreAllArtifacts()
rmi := podmanTest.PodmanNoCache([]string{"image", "rm", "busybox"})
rmi.WaitWithDefaultTimeout()
@@ -221,7 +217,6 @@ RUN apk update && apk add strace
})
It("podman images filter dangling", func() {
- SkipIfRemote()
dockerfile := `FROM docker.io/library/alpine:latest
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
@@ -233,9 +228,6 @@ RUN apk update && apk add strace
})
It("podman check for image with sha256: prefix", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
session := podmanTest.Podman([]string{"inspect", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -248,9 +240,6 @@ RUN apk update && apk add strace
})
It("podman check for image with sha256: prefix", func() {
- if podmanTest.RemoteTest {
- Skip("Does not work on remote client")
- }
session := podmanTest.Podman([]string{"image", "inspect", "--format=json", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -297,7 +286,6 @@ RUN apk update && apk add strace
})
It("podman images --all flag", func() {
- SkipIfRemote()
podmanTest.RestoreAllArtifacts()
dockerfile := `FROM docker.io/library/alpine:latest
RUN mkdir hello
@@ -317,7 +305,6 @@ ENV foo=bar
})
It("podman images filter by label", func() {
- SkipIfRemote()
dockerfile := `FROM docker.io/library/alpine:latest
LABEL version="1.0"
LABEL "com.example.vendor"="Example Vendor"
@@ -330,7 +317,6 @@ LABEL "com.example.vendor"="Example Vendor"
})
It("podman with images with no layers", func() {
- SkipIfRemote()
dockerfile := strings.Join([]string{
`FROM scratch`,
`LABEL org.opencontainers.image.authors="<somefolks@example.org>"`,
@@ -395,7 +381,6 @@ LABEL "com.example.vendor"="Example Vendor"
})
It("podman images --filter readonly", func() {
- SkipIfRemote()
dockerfile := `FROM docker.io/library/alpine:latest
`
podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false")
diff --git a/test/system/075-exec.bats b/test/system/075-exec.bats
index 36e9d57ec..f8c7f2766 100644
--- a/test/system/075-exec.bats
+++ b/test/system/075-exec.bats
@@ -50,6 +50,7 @@ load helpers
}
# Issue #4785 - piping to exec statement - fixed in #4818
+# Issue #5046 - piping to exec truncates results (actually a conmon issue)
@test "podman exec - cat from stdin" {
skip_if_remote
@@ -60,6 +61,20 @@ load helpers
run_podman exec -i $cid cat < <(echo $echo_string)
is "$output" "$echo_string" "output read back from 'exec cat'"
+ # #5046 - large file content gets lost via exec
+ # Generate a large file with random content; get a hash of its content
+ local bigfile=${PODMAN_TMPDIR}/bigfile
+ dd if=/dev/urandom of=$bigfile bs=1024 count=1500
+ expect=$(sha512sum $bigfile | awk '{print $1}')
+ # Transfer it to container, via exec, make sure correct #bytes are sent
+ run_podman exec -i $cid dd of=/tmp/bigfile bs=512 <$bigfile
+ is "${lines[0]}" "3000+0 records in" "dd: number of records in"
+ is "${lines[1]}" "3000+0 records out" "dd: number of records out"
+ # Verify sha. '% *' strips off the path, keeping only the SHA
+ run_podman exec $cid sha512sum /tmp/bigfile
+ is "${output% *}" "$expect" "SHA of file in container"
+
+ # Clean up
run_podman exec $cid touch /stop
run_podman wait $cid
run_podman rm $cid
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index f34cd0707..0d14ca990 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -56,7 +56,11 @@ function teardown() {
skip_if_remote "podman-pod does not work with podman-remote"
podname=pod$(random_string)
+ run_podman 1 pod exists $podname
run_podman pod create --infra=true --name=$podname
+ podid="$output"
+ run_podman pod exists $podname
+ run_podman pod exists $podid
# Randomly-assigned port in the 5xxx range
for port in $(shuf -i 5000-5999);do
@@ -91,6 +95,10 @@ function teardown() {
# ...then rm the pod, then rmi the pause image so we don't leave strays.
run_podman pod rm $podname
run_podman rmi $pause_iid
+
+ # Pod no longer exists
+ run_podman 1 pod exists $podid
+ run_podman 1 pod exists $podname
}
# Random byte
@@ -131,6 +139,9 @@ function random_ip() {
hostname=$(random_string | tr A-Z a-z).$(random_string | tr A-Z a-z).net
+ labelname=$(random_string 11)
+ labelvalue=$(random_string 22)
+
pod_id_file=${PODMAN_TMPDIR}/pod-id-file
# Create a pod with all the desired options
@@ -143,7 +154,8 @@ function random_ip() {
--add-host "$add_host_n:$add_host_ip" \
--dns "$dns_server" \
--dns-search "$dns_search" \
- --dns-opt "$dns_opt"
+ --dns-opt "$dns_opt" \
+ --label "${labelname}=${labelvalue}"
pod_id="$output"
# Check --pod-id-file
@@ -168,18 +180,20 @@ function random_ip() {
is "$output" ".*nameserver $dns_server" "--dns [server] was added"
is "$output" ".*search $dns_search" "--dns-search was added"
is "$output" ".*options $dns_opt" "--dns-opt was added"
-}
-@test "podman pod inspect - format" {
- skip_if_remote "podman-pod does not work with podman-remote"
+ # pod inspect
+ run_podman pod inspect --format '{{.Name}}: {{.ID}} : {{.NumContainers}} : {{.Labels}}' mypod
+ is "$output" "mypod: $pod_id : 1 : map\[${labelname}:${labelvalue}]" \
+ "pod inspect --format ..."
- run_podman pod create --name podtest
- podid=$output
+ # pod ps
+ run_podman pod ps --format '{{.ID}} {{.Name}} {{.Status}} {{.Labels}}'
+ is "$output" "${pod_id:0:12} mypod Running map\[${labelname}:${labelvalue}]" "pod ps"
- run_podman pod inspect --format '-> {{.Name}}: {{.NumContainers}}' podtest
- is "$output" "-> podtest: 1"
+ run_podman pod ps --no-trunc --filter "label=${labelname}=${labelvalue}" --format '{{.ID}}'
+ is "$output" "$pod_id" "pod ps --filter label=..."
- run_podman pod rm -f podtest
+ run_podman pod rm -f mypod
}
# vim: filetype=sh
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index cd836610b..c9d1984d0 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -60,4 +60,27 @@ load helpers
run_podman rmi busybox
}
+# Issue #5466 - port-forwarding doesn't work with this option and -d
+@test "podman networking: port with --userns=keep-id" {
+ skip_if_remote
+
+ # FIXME: randomize port, and create second random host port
+ myport=54321
+
+ # Container will exit as soon as 'nc' receives input
+ run_podman run -d --userns=keep-id -p 127.0.0.1:$myport:$myport \
+ $IMAGE nc -l -p $myport
+ cid="$output"
+
+ # emit random string, and check it
+ teststring=$(random_string 30)
+ echo "$teststring" | nc 127.0.0.1 $myport
+
+ run_podman logs $cid
+ is "$output" "$teststring" "test string received on container"
+
+ # Clean up
+ run_podman rm $cid
+}
+
# vim: filetype=sh