MCPcopy Index your code
hub / github.com/coder/coder / setCaps

Function setCaps

agent/agentexec/cli_linux_test.go:243–252  ·  view source on GitHub ↗
(t *testing.T, bin string, caps ...string)

Source from the content-addressed store, hash-verified

241}
242
243func setCaps(t *testing.T, bin string, caps ...string) error {
244 t.Helper()
245
246 setcap := fmt.Sprintf("sudo -n setcap %s=ep %s", strings.Join(caps, ", "), bin)
247 out, err := exec.CommandContext(context.Background(), "sh", "-c", setcap).CombinedOutput()
248 if err != nil {
249 return xerrors.Errorf("setcap %q (%s): %w", setcap, out, err)
250 }
251 return nil
252}

Callers 1

TestCLIFunction · 0.85

Calls 3

HelperMethod · 0.65
CommandContextMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected