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

Function Test_mergeSSHOptions_AllowsSafeServerConfig

cli/configssh_internal_test.go:420–439  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

418}
419
420func 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
441func Test_sshConfigOptions_addOption(t *testing.T) {
442 t.Parallel()

Callers

nothing calls this directly

Calls 4

mergeSSHOptionsFunction · 0.85
TempDirMethod · 0.65
EqualMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected