summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/20-containers.at27
-rw-r--r--test/e2e/run_test.go12
-rw-r--r--test/system/030-run.bats15
-rw-r--r--test/system/070-build.bats2
-rw-r--r--test/system/075-exec.bats3
5 files changed, 53 insertions, 6 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index ed333d382..9ea3cb7ed 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -151,4 +151,31 @@ t DELETE images/localhost/newrepo:v2?force=true 200
t DELETE libpod/containers/$cid 204
t DELETE libpod/containers/myctr 204
+
+# test apiv2 create container with correct entrypoint and cmd
+# --data '{"Image":"quay.io/libpod/alpine_labels:latest","Entrypoint":["echo"],"Cmd":["param1","param2"]}'
+t POST containers/create '"Image":"'$IMAGE'","Entrypoint":["echo"],"Cmd":["param1","param2"]' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .Config.Entrypoint[0]="echo" \
+ .Config.Cmd[0]="param1" \
+ .Config.Cmd[1]="param2" \
+ .Path="echo" \
+ .Args[0]="param1" \
+ .Args[1]="param2"
+t DELETE containers/$cid 204
+
+# test only set the entrpoint, Cmd should be []
+t POST containers/create '"Image":"'$IMAGE'","Entrypoint":["echo","param1"]' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .Config.Entrypoint[0]="echo" \
+ .Config.Entrypoint[1]="param1" \
+ .Config.Cmd='[]' \
+ .Path="echo" \
+ .Args[0]="param1"
+t DELETE containers/$cid 204
+
# vim: filetype=sh
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 157b7d3d7..91b0d3e48 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -1204,4 +1204,16 @@ WORKDIR /madethis`
// nonprintables seem to work their way in.
Expect(session.OutputToString()).To(Not(ContainSubstring("/bin/sh")))
})
+
+ It("podman run a container with log-level (lower case)", func() {
+ session := podmanTest.Podman([]string{"--log-level=info", "run", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
+ It("podman run a container with log-level (upper case)", func() {
+ session := podmanTest.Podman([]string{"--log-level=INFO", "run", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
})
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 34afd5bae..198c8881d 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -294,11 +294,22 @@ echo $rand | 0 | $rand
run_podman run -d --userns=keep-id $IMAGE sh -c 'while ! test -e /stop; do sleep 0.1; done'
cid="$output"
+ # Assign a UID that is (a) not in our image /etc/passwd and (b) not
+ # the same as that of the user running the test script; this guarantees
+ # that the added passwd entry will be what we expect.
+ #
+ # For GID, we have to use one that already exists in the container. And
+ # unfortunately, 'adduser' requires a string name. We use 999:ping
+ local uid=4242
+ if [[ $uid == $(id -u) ]]; then
+ uid=4343
+ fi
+
gecos="$(random_string 6) $(random_string 8)"
- run_podman exec --user root $cid adduser -D -g "$gecos" -s /bin/sh newuser3
+ run_podman exec --user root $cid adduser -u $uid -G ping -D -g "$gecos" -s /bin/sh newuser3
is "$output" "" "output from adduser"
run_podman exec $cid tail -1 /etc/passwd
- is "$output" "newuser3:x:1000:1000:$gecos:/home/newuser3:/bin/sh" \
+ is "$output" "newuser3:x:$uid:999:$gecos:/home/newuser3:/bin/sh" \
"newuser3 added to /etc/passwd in container"
run_podman exec $cid touch /stop
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 0e6e97d40..997699ecb 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -12,7 +12,7 @@ load helpers
rand_content=$(random_string 50)
tmpdir=$PODMAN_TMPDIR/build-test
- run mkdir -p $tmpdir || die "Could not mkdir $tmpdir"
+ mkdir -p $tmpdir
dockerfile=$tmpdir/Dockerfile
cat >$dockerfile <<EOF
FROM $IMAGE
diff --git a/test/system/075-exec.bats b/test/system/075-exec.bats
index 5f71e2acb..e9db8c27e 100644
--- a/test/system/075-exec.bats
+++ b/test/system/075-exec.bats
@@ -90,7 +90,6 @@ load helpers
}
# #6829 : add username to /etc/passwd inside container if --userns=keep-id
-# #6593 : doesn't actually work with podman exec
@test "podman exec - with keep-id" {
run_podman run -d --userns=keep-id $IMAGE sh -c \
"echo READY;while [ ! -f /stop ]; do sleep 1; done"
@@ -100,8 +99,6 @@ load helpers
run_podman exec $cid id -un
is "$output" "$(id -un)" "container is running as current user"
- # Until #6593 gets fixed, this just hangs. The server process barfs with:
- # unable to find user <username>: no matching entries in passwd file
run_podman exec --user=$(id -un) $cid touch /stop
run_podman wait $cid
run_podman rm $cid