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 {
ret := make([]*mount.Mount, 0, len(dirs))
func getMounts(dirs []string) []mount.SyscallParams {
builder := mount.NewBuilder()
for _, d := range dirs {
if _, err := os.Stat(d); !os.IsNotExist(err) {
ret = append(ret, getMount(d))
}
}
return ret
}
func getMount(dir string) *mount.Mount {
return &mount.Mount{
Source: dir,
Target: dir[1:],
builder.WithMount(mount.Mount{
Source: d,
Target: d[1:],
Flags: roBind,
})
}
m, _ := builder.Build(true)
return m
}
func openNull(b *testing.B) *os.File {