func newServer(md *temp.Server) *torus.Server {
	cfg := torus.Config{
		StorageSize: 100 * 1024 * 1024,
	}
	mds := temp.NewClient(cfg, md)
	gmd, _ := mds.GlobalMetadata()
	blocks, _ := torus.CreateBlockStore("temp", "current", cfg, gmd)
	s, _ := torus.NewServerByImpl(cfg, mds, blocks)
	return s
}
Example #2
0
func newServer(t testing.TB, md *temp.Server) *torus.Server {
	dir, _ := ioutil.TempDir("", "torus-integration")
	torus.MkdirsFor(dir)
	cfg := torus.Config{
		StorageSize: StorageSize,
		DataDir:     dir,
	}
	mds := temp.NewClient(cfg, md)
	gmd := mds.GlobalMetadata()
	blocks, err := torus.CreateBlockStore("mfile", "current", cfg, gmd)
	if err != nil {
		t.Fatal(err)
	}
	s, _ := torus.NewServerByImpl(cfg, mds, blocks)
	return s
}