summaryrefslogtreecommitdiff
path: root/test/system/030-run.bats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-30 10:43:12 -0400
committerGitHub <noreply@github.com>2020-07-30 10:43:12 -0400
commit05b3e0e16bbbfede19bc5d817c62598e1ac6fa70 (patch)
tree906f6e8d4ae2c153caac0382cefb9f62bb583058 /test/system/030-run.bats
parent117043040e18e473f3b2142576303349238a36a7 (diff)
parent84f4b87c2e22afe0375c24936b1e6f15e731ea19 (diff)
downloadpodman-05b3e0e16bbbfede19bc5d817c62598e1ac6fa70.tar.gz
podman-05b3e0e16bbbfede19bc5d817c62598e1ac6fa70.tar.bz2
podman-05b3e0e16bbbfede19bc5d817c62598e1ac6fa70.zip
Merge pull request #7151 from edsantiago/bats
System tests: new system-df and passwd tests
Diffstat (limited to 'test/system/030-run.bats')
-rw-r--r--test/system/030-run.bats16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 04d1e4eac..b30c1103b 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -284,4 +284,20 @@ echo $rand | 0 | $rand
is "$output" "root" "--user=0 overrides keep-id"
}
+# #6991 : /etc/passwd is modifiable
+@test "podman run : --userns=keep-id: passwd file is modifiable" {
+ run_podman run -d --userns=keep-id $IMAGE sh -c 'while ! test -e /stop; do sleep 0.1; done'
+ cid="$output"
+
+ gecos="$(random_string 6) $(random_string 8)"
+ run_podman exec --user root $cid adduser -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" \
+ "newuser3 added to /etc/passwd in container"
+
+ run_podman exec $cid touch /stop
+ run_podman wait $cid
+}
+
# vim: filetype=sh