MCPcopy Index your code
hub / github.com/coder/envbox / outerFiles

Function outerFiles

integration/gpu_test.go:166–174  ·  view source on GitHub ↗

outerFiles returns the list of files in the outer container matching the given pattern. It does this by running `ls -1` in the outer container.

(ctx context.Context, t *testing.T, containerID, pattern string)

Source from the content-addressed store, hash-verified

164// outerFiles returns the list of files in the outer container matching the
165// given pattern. It does this by running `ls -1` in the outer container.
166func outerFiles(ctx context.Context, t *testing.T, containerID, pattern string) []string {
167 t.Helper()
168 // We need to use /bin/sh -c to avoid the shell interpreting the glob.
169 out, err := execContainerCmd(ctx, t, containerID, "/bin/sh", "-c", "ls -1 "+pattern)
170 require.NoError(t, err, "failed to list outer container files")
171 files := strings.Split(strings.TrimSpace(out), "\n")
172 slices.Sort(files)
173 return files
174}
175
176// assertInnerFiles checks that all the files matching the given pattern exist in the
177// inner container.

Callers 1

TestDocker_NvidiaFunction · 0.85

Calls 1

execContainerCmdFunction · 0.85

Tested by

no test coverage detected