(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func 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 | |
| 37 | func TestFailedExecExitCode(t *testing.T) { |
| 38 | testCases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…