示例#1
0
func setup() {
	// zero-sized directory just for mounts
	if err := os.MkdirAll(mountDir, 0777); err != nil {
		panic(err)
	}
	if err := mount.MountTmpfs(mountDir, 0); err != nil {
		panic(err)
	}

	if err := mount.MountTmpfs("/dev/shm", 14<<30); err != nil {
		panic(err)
	}
	if err := mount.MountHugetlbfs("/dev/hugepages", 2<<20, 4<<30); err != nil {
		panic(err)
	}
	setupDone = true
}
示例#2
0
文件: shm_test.go 项目: jsgilmore/shm
func setup() {
	if setupDone {
		return
	}
	mount.MountNamespace()
	if err := mount.MountTmpfs("/dev/shm", *tmpfsSize); err != nil {
		panic(err)
	}
	if err := mount.MountHugetlbfs("/dev/hugepages", 2<<20, *hugeSize); err != nil {
		panic(err)
	}
	setupDone = true
}