mirror of
https://github.com/containers/podman.git
synced 2025-06-19 00:06:43 +08:00
Merge pull request #3491 from giuseppe/rlimit-host
podman: add --ulimit host
This commit is contained in:
@ -8,7 +8,9 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
. "github.com/containers/libpod/test/utils"
|
||||
@ -250,6 +252,25 @@ var _ = Describe("Podman run", func() {
|
||||
Expect(session.OutputToString()).To(ContainSubstring("100"))
|
||||
})
|
||||
|
||||
It("podman run limits host test", func() {
|
||||
SkipIfRemote()
|
||||
|
||||
var l syscall.Rlimit
|
||||
|
||||
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &l)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
session := podmanTest.Podman([]string{"run", "--rm", "--ulimit", "host", fedoraMinimal, "ulimit", "-Hn"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
ulimitCtrStr := strings.TrimSpace(session.OutputToString())
|
||||
ulimitCtr, err := strconv.ParseUint(ulimitCtrStr, 10, 0)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
Expect(ulimitCtr).Should(BeNumerically(">=", l.Max))
|
||||
})
|
||||
|
||||
It("podman run with cidfile", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--cidfile", tempdir + "cidfile", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
Reference in New Issue
Block a user