Example #1
0
// Create a temporary runtime suitable for unit testing.
// Call t.Fatal() at the first error.
func mkRuntime(f utils.Fataler) *docker.Runtime {
	root, err := newTestDirectory(unitTestStoreBase)
	if err != nil {
		f.Fatal(err)
	}
	config := &docker.DaemonConfig{
		Root:        root,
		AutoRestart: false,
		Mtu:         docker.DefaultNetworkMtu,
	}
	r, err := docker.NewRuntimeFromDirectory(config)
	if err != nil {
		f.Fatal(err)
	}
	return r
}
Example #2
0
// Create a temporary runtime suitable for unit testing.
// Call t.Fatal() at the first error.
func mkRuntime(f utils.Fataler) *docker.Runtime {
	root, err := newTestDirectory(unitTestStoreBase)
	if err != nil {
		f.Fatal(err)
	}
	config := &docker.DaemonConfig{
		Root:        root,
		AutoRestart: false,
	}
	r, err := docker.NewRuntimeFromDirectory(config)
	if err != nil {
		f.Fatal(err)
	}
	r.UpdateCapabilities(true)
	return r
}