diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-30 10:43:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 10:43:12 -0400 |
commit | 05b3e0e16bbbfede19bc5d817c62598e1ac6fa70 (patch) | |
tree | 906f6e8d4ae2c153caac0382cefb9f62bb583058 /test/system/030-run.bats | |
parent | 117043040e18e473f3b2142576303349238a36a7 (diff) | |
parent | 84f4b87c2e22afe0375c24936b1e6f15e731ea19 (diff) | |
download | podman-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.bats | 16 |
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 |