summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/pgalloc/pgalloc_test.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-06-16 16:14:26 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-16 16:16:14 -0700
commite61acfb5eaec4450587116573f708284a0fe7849 (patch)
tree5e8971684c073d7a126346dfa0700149ac0795c7 /pkg/sentry/pgalloc/pgalloc_test.go
parent622f7986896a63be2175476af39d022bb5c2794c (diff)
Correctly handle multiple resizings in pgalloc.findAvailableRange().
PiperOrigin-RevId: 316778032
Diffstat (limited to 'pkg/sentry/pgalloc/pgalloc_test.go')
-rw-r--r--pkg/sentry/pgalloc/pgalloc_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/sentry/pgalloc/pgalloc_test.go b/pkg/sentry/pgalloc/pgalloc_test.go
index b5b68eb52..405db141f 100644
--- a/pkg/sentry/pgalloc/pgalloc_test.go
+++ b/pkg/sentry/pgalloc/pgalloc_test.go
@@ -143,6 +143,14 @@ func TestFindUnallocatedRange(t *testing.T) {
start: hugepage,
},
{
+ desc: "Allocation doubles file size more than once if necessary",
+ usage: &usageSegmentDataSlices{},
+ fileSize: page,
+ length: 4 * page,
+ alignment: page,
+ start: 0,
+ },
+ {
desc: "Allocations are compact if possible",
usage: &usageSegmentDataSlices{
Start: []uint64{page, 3 * page},