summaryrefslogtreecommitdiff
path: root/test/e2e/run_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-11 21:35:37 +0200
committerGitHub <noreply@github.com>2019-07-11 21:35:37 +0200
commit2b64f8844655b7188332a404ec85d32c33feb9e9 (patch)
treeafcbaa55ba396ac68ebdc87ad15f1554e6ee1e5d /test/e2e/run_test.go
parent24409daa36137406a403ae8e22cf71afa590c746 (diff)
parentfb88074e68db25474290535e8a778e39434cc2a2 (diff)
downloadpodman-2b64f8844655b7188332a404ec85d32c33feb9e9.tar.gz
podman-2b64f8844655b7188332a404ec85d32c33feb9e9.tar.bz2
podman-2b64f8844655b7188332a404ec85d32c33feb9e9.zip
Merge pull request #3491 from giuseppe/rlimit-host
podman: add --ulimit host
Diffstat (limited to 'test/e2e/run_test.go')
-rw-r--r--test/e2e/run_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 3fc628589..f95c5298d 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -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()