summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/fd_map_test.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2019-04-10 12:35:43 -0700
committerShentubot <shentubot@google.com>2019-04-10 12:36:45 -0700
commitf7aff0aaa4320505933df838cf5b551b69d5e513 (patch)
treef773a8942f4f025d370ee0d8c0e711944f168f4c /pkg/sentry/kernel/fd_map_test.go
parent0a0619216ec9ca96c181dd69d9bf31e7762090cb (diff)
Allow threads with CAP_SYS_RESOURCE to raise hard rlimits.
PiperOrigin-RevId: 242919489 Change-Id: Ie3267b3bcd8a54b54bc16a6556369a19e843376f
Diffstat (limited to 'pkg/sentry/kernel/fd_map_test.go')
-rw-r--r--pkg/sentry/kernel/fd_map_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/sentry/kernel/fd_map_test.go b/pkg/sentry/kernel/fd_map_test.go
index b49996137..9e76f0a2d 100644
--- a/pkg/sentry/kernel/fd_map_test.go
+++ b/pkg/sentry/kernel/fd_map_test.go
@@ -40,7 +40,7 @@ func newTestFDMap() *FDMap {
func TestFDMapMany(t *testing.T) {
file := filetest.NewTestFile(t)
limitSet := limits.NewLimitSet()
- limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD})
+ limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}, true /* privileged */)
f := newTestFDMap()
for i := 0; i < maxFD; i++ {
@@ -64,7 +64,7 @@ func TestFDMapMany(t *testing.T) {
func TestFDMap(t *testing.T) {
file := filetest.NewTestFile(t)
limitSet := limits.NewLimitSet()
- limitSet.Set(limits.NumberOfFiles, limits.Limit{1, maxFD})
+ limitSet.Set(limits.NumberOfFiles, limits.Limit{1, maxFD}, true /* privileged */)
f := newTestFDMap()
if _, err := f.NewFDFrom(0, file, FDFlags{}, limitSet); err != nil {
@@ -76,7 +76,7 @@ func TestFDMap(t *testing.T) {
}
largeLimit := limits.Limit{maxFD, maxFD}
- limitSet.Set(limits.NumberOfFiles, largeLimit)
+ limitSet.Set(limits.NumberOfFiles, largeLimit, true /* privileged */)
if fd, err := f.NewFDFrom(0, file, FDFlags{}, limitSet); err != nil {
t.Fatalf("Adding an FD to a resized map: got %v, want nil", err)
@@ -117,7 +117,7 @@ func TestDescriptorFlags(t *testing.T) {
file := filetest.NewTestFile(t)
f := newTestFDMap()
limitSet := limits.NewLimitSet()
- limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD})
+ limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}, true /* privileged */)
origFlags := FDFlags{CloseOnExec: true}