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)
| 90 | // Check that inaccessible directories that come before accessible ones are ignored |
| 91 | // and do not prevent the latter from being processed. |
| 92 | func 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 | |
| 112 | func TestGetPlugin(t *testing.T) { |
| 113 | dir := fs.NewDir(t, t.Name(), |
nothing calls this directly
no test coverage detected
searching dependent graphs…