fix unit test

This commit is contained in:
criyle 2019-09-22 19:23:02 -07:00
parent c8d682f4b6
commit a6c330b612

View File

@ -148,22 +148,17 @@ func benchmarkRun(r *Runner, b *testing.B) {
} }
} }
func getMounts(dirs []string) []*mount.Mount { func getMounts(dirs []string) []mount.SyscallParams {
ret := make([]*mount.Mount, 0, len(dirs)) builder := mount.NewBuilder()
for _, d := range dirs { for _, d := range dirs {
if _, err := os.Stat(d); !os.IsNotExist(err) { builder.WithMount(mount.Mount{
ret = append(ret, getMount(d)) Source: d,
} Target: d[1:],
}
return ret
}
func getMount(dir string) *mount.Mount {
return &mount.Mount{
Source: dir,
Target: dir[1:],
Flags: roBind, Flags: roBind,
})
} }
m, _ := builder.Build(true)
return m
} }
func openNull(b *testing.B) *os.File { func openNull(b *testing.B) *os.File {