podman: support --mount type=devpts

Allow to create a devpts mount.

This is useful for containers that bind mount /dev/ from the host but
at the same time want to create a terminal.

It can be used as:

podman run -v /dev:/dev --mount type=devpts,target=/dev/pts ...

Closes: https://github.com/containers/podman/issues/6804

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2020-08-03 23:05:10 +02:00
parent 1709335cf0
commit 976e364a97
4 changed files with 58 additions and 2 deletions

View File

@ -811,6 +811,14 @@ USER mail`
Expect(len(session.OutputToStringArray())).To(Equal(1))
})
It("podman run --mount type=devpts,target=/foo/bar", func() {
SkipIfRootless()
session := podmanTest.Podman([]string{"run", "--mount", "type=devpts,target=/foo/bar", fedoraMinimal, "stat", "-f", "-c%T", "/foo/bar"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring("devpts"))
})
It("podman run --pod automatically", func() {
session := podmanTest.Podman([]string{"run", "-d", "--pod", "new:foobar", ALPINE, "nc", "-l", "-p", "8080"})
session.WaitWithDefaultTimeout()