summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-05-07 15:17:33 -0400
committerMatthew Heon <mheon@redhat.com>2021-06-24 13:30:50 -0400
commit6d394f0e474417892645a4d0b4a786cd733f0e8c (patch)
tree9aad2f6f6a90c911c33605dad416d9d3c71385fb /test
parentf8a793a72d0b3ed52ced0e0e765935280c48c786 (diff)
downloadpodman-6d394f0e474417892645a4d0b4a786cd733f0e8c.tar.gz
podman-6d394f0e474417892645a4d0b4a786cd733f0e8c.tar.bz2
podman-6d394f0e474417892645a4d0b4a786cd733f0e8c.zip
Create the /etc/mtab file if does not exists
We should create the /etc/mtab->/proc/mountinfo link so that mount command will work within the container. Docker does this by default. Fixes: https://github.com/containers/podman/issues/10263 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/030-run.bats14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 55392ea47..f0d541354 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -690,4 +690,18 @@ json-file | f
run_podman rm $cid
}
+@test "podman run no /etc/mtab " {
+ tmpdir=$PODMAN_TMPDIR/build-test
+ mkdir -p $tmpdir
+
+ cat >$tmpdir/Dockerfile <<EOF
+FROM $IMAGE
+RUN rm /etc/mtab
+EOF
+ expected="'/etc/mtab' -> '/proc/mounts'"
+ run_podman build -t nomtab $tmpdir
+ run_podman run --rm nomtab stat -c %N /etc/mtab
+ is "$output" "$expected" "/etc/mtab should be created"
+}
+
# vim: filetype=sh