MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / RequestCommandExecution

Method RequestCommandExecution

e2e_framework_test.go:282–304  ·  view source on GitHub ↗
(cmd string)

Source from the content-addressed store, hash-verified

280}
281
282func (c *testContext) RequestCommandExecution(cmd string) {
283 t := c.T
284 t.Helper()
285 c.lock.Lock()
286 defer c.lock.Unlock()
287 if c.channel == nil {
288 t.Fatalf("No channel opened.")
289 }
290 t.Logf("Starting program %s ...", cmd)
291
292 success, err := c.channel.SendRequest(
293 string(internalssh.RequestTypeExec),
294 true,
295 ssh.Marshal(internalssh.ExecRequestPayload{Exec: cmd}),
296 )
297 if err != nil {
298 t.Fatalf("Failed to send exec request. (%v)", err)
299 }
300 if !success {
301 t.Fatalf("Server rejected exec request. (%v)", err)
302 }
303 t.Logf("Started program.")
304}
305
306func (c *testContext) RequestShell() {
307 t := c.T

Callers

nothing calls this directly

Calls 3

FatalfMethod · 0.80
LogfMethod · 0.65
MarshalMethod · 0.65

Tested by

no test coverage detected