Example #1
0
//FIXME: duplicate
func tempGraph(t *testing.T) *docker.Graph {
	tmp, err := ioutil.TempDir("", "docker-graph-")
	if err != nil {
		t.Fatal(err)
	}
	graph, err := docker.NewGraph(tmp)
	if err != nil {
		t.Fatal(err)
	}
	return graph
}
Example #2
0
func tempGraph(t *testing.T) (*docker.Graph, graphdriver.Driver) {
	tmp, err := ioutil.TempDir("", "docker-graph-")
	if err != nil {
		t.Fatal(err)
	}
	driver, err := graphdriver.New(tmp)
	if err != nil {
		t.Fatal(err)
	}
	graph, err := docker.NewGraph(tmp, driver)
	if err != nil {
		t.Fatal(err)
	}
	return graph, driver
}