(t *testing.T)
| 418 | } |
| 419 | |
| 420 | func Test_mergeSSHOptions_AllowsSafeServerConfig(t *testing.T) { |
| 421 | t.Parallel() |
| 422 | |
| 423 | got, err := mergeSSHOptions(sshConfigOptions{}, codersdk.SSHConfigResponse{ |
| 424 | HostnamePrefix: "coder.", |
| 425 | HostnameSuffix: "coder", |
| 426 | SSHConfigOptions: map[string]string{ |
| 427 | "HostName": "example.com", |
| 428 | "User": "coder", |
| 429 | "Port": "22", |
| 430 | "SetEnv": "FOO=bar BAZ=qux", |
| 431 | "UserKnownHostsFile": "/tmp/coder_known_hosts", |
| 432 | }, |
| 433 | }, t.TempDir(), "/tmp/coder") |
| 434 | require.NoError(t, err) |
| 435 | require.Equal(t, "coder.", got.userHostPrefix) |
| 436 | require.Equal(t, "coder", got.hostnameSuffix) |
| 437 | require.Contains(t, got.sshOptions, "HostName example.com") |
| 438 | require.Contains(t, got.sshOptions, "SetEnv FOO=bar BAZ=qux") |
| 439 | } |
| 440 | |
| 441 | func Test_sshConfigOptions_addOption(t *testing.T) { |
| 442 | t.Parallel() |
nothing calls this directly
no test coverage detected