MCPcopy Index your code
hub / github.com/moby/moby / newTestPlugin

Function newTestPlugin

daemon/pkg/plugin/manager_linux_test.go:73–88  ·  view source on GitHub ↗
(t *testing.T, name, capability, root string)

Source from the content-addressed store, hash-verified

71}
72
73func newTestPlugin(t *testing.T, name, capability, root string) *v2.Plugin {
74 id := stringid.GenerateRandomID()
75 rootfs := filepath.Join(root, id)
76 if err := os.MkdirAll(rootfs, 0o755); err != nil {
77 t.Fatal(err)
78 }
79
80 p := v2.Plugin{PluginObj: plugin.Plugin{ID: id, Name: name}}
81 p.Rootfs = rootfs
82 iType := plugin.CapabilityID{Capability: capability, Prefix: "docker", Version: "1.0"}
83 i := plugin.Interface{Socket: "plugin.sock", Types: []plugin.CapabilityID{iType}}
84 p.PluginObj.Config.Interface = i
85 p.PluginObj.ID = id
86
87 return &p
88}
89
90type simpleExecutor struct {
91 Executor

Callers 3

TestCreateFailedFunction · 0.85

Calls 2

GenerateRandomIDFunction · 0.92
JoinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…