MCPcopy Create free account
hub / github.com/coder/envbuilder / fakeMounts

Function fakeMounts

internal/ebutil/remount_internal_test.go:642–654  ·  view source on GitHub ↗

convenience function for generating a slice of *procfs.MountInfo

(mounts ...string)

Source from the content-addressed store, hash-verified

640
641// convenience function for generating a slice of *procfs.MountInfo
642func fakeMounts(mounts ...string) []*procfs.MountInfo {
643 m := make([]*procfs.MountInfo, 0)
644 for _, s := range mounts {
645 mp := s
646 o := make(map[string]string)
647 if strings.HasSuffix(mp, ":ro") {
648 mp = strings.TrimSuffix(mp, ":ro")
649 o["ro"] = "true"
650 }
651 m = append(m, &procfs.MountInfo{MountPoint: mp, Options: o})
652 }
653 return m
654}
655
656func fakeLog(t *testing.T) func(log.Level, string, ...any) {
657 t.Helper()

Callers 1

Test_tempRemountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected