MCPcopy Index your code
hub / github.com/docker/cli / TestListPluginCandidatesInaccessibleDir

Function TestListPluginCandidatesInaccessibleDir

cli-plugins/manager/manager_test.go:92–110  ·  view source on GitHub ↗

Regression test for https://github.com/docker/cli/issues/5643. Check that inaccessible directories that come before accessible ones are ignored and do not prevent the latter from being processed.

(t *testing.T)

Source from the content-addressed store, hash-verified

90// Check that inaccessible directories that come before accessible ones are ignored
91// and do not prevent the latter from being processed.
92func TestListPluginCandidatesInaccessibleDir(t *testing.T) {
93 dir := fs.NewDir(t, t.Name(),
94 fs.WithDir("no-perm", fs.WithMode(0)),
95 fs.WithDir("plugins",
96 fs.WithFile("docker-buildx", ""),
97 ),
98 )
99 defer dir.Remove()
100
101 candidates := listPluginCandidates([]string{
102 dir.Join("no-perm"),
103 dir.Join("plugins"),
104 })
105 assert.DeepEqual(t, candidates, map[string][]string{
106 "buildx": {
107 dir.Join("plugins", "docker-buildx"),
108 },
109 })
110}
111
112func TestGetPlugin(t *testing.T) {
113 dir := fs.NewDir(t, t.Name(),

Callers

nothing calls this directly

Calls 3

listPluginCandidatesFunction · 0.85
RemoveMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…