MCPcopy
hub / github.com/moby/moby / TestExecConsoleSize

Function TestExecConsoleSize

integration/container/exec_linux_test.go:14–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestExecConsoleSize(t *testing.T) {
15 skip.If(t, testEnv.DaemonInfo.OSType != "linux")
16 skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.42"), "requires API v1.42")
17
18 ctx := setupTest(t)
19 apiClient := testEnv.APIClient()
20
21 cID := container.Run(ctx, t, apiClient, container.WithImage("busybox"))
22
23 result, err := container.Exec(ctx, apiClient, cID, []string{"stty", "size"},
24 func(ec *client.ExecCreateOptions) {
25 ec.TTY = true
26 ec.ConsoleSize = client.ConsoleSize{
27 Height: 57,
28 Width: 123,
29 }
30 },
31 )
32
33 assert.NilError(t, err)
34 assert.Equal(t, strings.TrimSpace(result.Stdout()), "57 123")
35}
36
37func TestFailedExecExitCode(t *testing.T) {
38 testCases := []struct {

Callers

nothing calls this directly

Calls 8

RunFunction · 0.92
WithImageFunction · 0.92
ExecFunction · 0.92
DaemonAPIVersionMethod · 0.80
APIClientMethod · 0.80
EqualMethod · 0.80
setupTestFunction · 0.70
StdoutMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…