summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/testutil
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2020-03-31 15:00:25 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-31 15:02:57 -0700
commit9de982ea790ffe56eca07b6535e9420b669b7c0c (patch)
tree2dd1e525b0faf2812242a7367ff793db015675c4 /pkg/sentry/fsimpl/testutil
parent32a133537e61bbceb6a0a16c95815495d8f17a35 (diff)
Allow passing root file type to tmpfs.
PiperOrigin-RevId: 304053357
Diffstat (limited to 'pkg/sentry/fsimpl/testutil')
-rw-r--r--pkg/sentry/fsimpl/testutil/testutil.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/testutil/testutil.go b/pkg/sentry/fsimpl/testutil/testutil.go
index e16808c63..0556af877 100644
--- a/pkg/sentry/fsimpl/testutil/testutil.go
+++ b/pkg/sentry/fsimpl/testutil/testutil.go
@@ -162,6 +162,9 @@ func (s *System) ListDirents(pop *vfs.PathOperation) *DirentCollector {
// exactly the specified set of expected entries. AssertAllDirentTypes respects
// collector.skipDots, and implicitly checks for "." and ".." accordingly.
func (s *System) AssertAllDirentTypes(collector *DirentCollector, expected map[string]DirentType) {
+ if expected == nil {
+ expected = make(map[string]DirentType)
+ }
// Also implicitly check for "." and "..", if enabled.
if !collector.skipDots {
expected["."] = linux.DT_DIR