mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
test: fix TestConfigSSH_FileWriteAndOptionsFlow on Windows 11 24H2 (#17410)
Fixes tests on Windows 11 due to `printf` not being a recognized command name.
This commit is contained in:
@ -435,7 +435,7 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
|
|||||||
"# :hostname-suffix=coder-suffix",
|
"# :hostname-suffix=coder-suffix",
|
||||||
"# :header=X-Test-Header=foo",
|
"# :header=X-Test-Header=foo",
|
||||||
"# :header=X-Test-Header2=bar",
|
"# :header=X-Test-Header2=bar",
|
||||||
"# :header-command=printf h1=v1 h2=\"v2\" h3='v3'",
|
"# :header-command=echo h1=v1 h2=\"v2\" h3='v3'",
|
||||||
"#",
|
"#",
|
||||||
}, "\n"),
|
}, "\n"),
|
||||||
strings.Join([]string{
|
strings.Join([]string{
|
||||||
@ -451,7 +451,7 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
|
|||||||
"--hostname-suffix", "coder-suffix",
|
"--hostname-suffix", "coder-suffix",
|
||||||
"--header", "X-Test-Header=foo",
|
"--header", "X-Test-Header=foo",
|
||||||
"--header", "X-Test-Header2=bar",
|
"--header", "X-Test-Header2=bar",
|
||||||
"--header-command", "printf h1=v1 h2=\"v2\" h3='v3'",
|
"--header-command", "echo h1=v1 h2=\"v2\" h3='v3'",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -566,36 +566,36 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
|
|||||||
name: "Header command",
|
name: "Header command",
|
||||||
args: []string{
|
args: []string{
|
||||||
"--yes",
|
"--yes",
|
||||||
"--header-command", "printf h1=v1",
|
"--header-command", "echo h1=v1",
|
||||||
},
|
},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
hasAgent: true,
|
hasAgent: true,
|
||||||
wantConfig: wantConfig{
|
wantConfig: wantConfig{
|
||||||
regexMatch: `ProxyCommand .* --header-command "printf h1=v1" ssh .* --ssh-host-prefix coder. %h`,
|
regexMatch: `ProxyCommand .* --header-command "echo h1=v1" ssh .* --ssh-host-prefix coder. %h`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Header command with double quotes",
|
name: "Header command with double quotes",
|
||||||
args: []string{
|
args: []string{
|
||||||
"--yes",
|
"--yes",
|
||||||
"--header-command", "printf h1=v1 h2=\"v2\"",
|
"--header-command", "echo h1=v1 h2=\"v2\"",
|
||||||
},
|
},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
hasAgent: true,
|
hasAgent: true,
|
||||||
wantConfig: wantConfig{
|
wantConfig: wantConfig{
|
||||||
regexMatch: `ProxyCommand .* --header-command "printf h1=v1 h2=\\\"v2\\\"" ssh .* --ssh-host-prefix coder. %h`,
|
regexMatch: `ProxyCommand .* --header-command "echo h1=v1 h2=\\\"v2\\\"" ssh .* --ssh-host-prefix coder. %h`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Header command with single quotes",
|
name: "Header command with single quotes",
|
||||||
args: []string{
|
args: []string{
|
||||||
"--yes",
|
"--yes",
|
||||||
"--header-command", "printf h1=v1 h2='v2'",
|
"--header-command", "echo h1=v1 h2='v2'",
|
||||||
},
|
},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
hasAgent: true,
|
hasAgent: true,
|
||||||
wantConfig: wantConfig{
|
wantConfig: wantConfig{
|
||||||
regexMatch: `ProxyCommand .* --header-command "printf h1=v1 h2='v2'" ssh .* --ssh-host-prefix coder. %h`,
|
regexMatch: `ProxyCommand .* --header-command "echo h1=v1 h2='v2'" ssh .* --ssh-host-prefix coder. %h`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user