Example #1
0
func assertNImages(graph *docker.Graph, t *testing.T, n int) {
	if images, err := graph.Map(); err != nil {
		t.Fatal(err)
	} else if actualN := len(images); actualN != n {
		t.Fatalf("Expected %d images, found %d", n, actualN)
	}
}
Example #2
0
func createTestImage(graph *docker.Graph, t *testing.T) *docker.Image {
	archive, err := fakeTar()
	if err != nil {
		t.Fatal(err)
	}
	img, err := graph.Create(archive, nil, "Test image", "", nil)
	if err != nil {
		t.Fatal(err)
	}
	return img
}
Example #3
0
func nukeGraph(graph *docker.Graph) {
	graph.Driver().Cleanup()
	os.RemoveAll(graph.Root)
}