@@ -588,43 +588,46 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
588
588
{
589
589
name : "Header command" ,
590
590
args : []string {
591
- "--header-command" , "/foo/bar/coder" ,
591
+ "--yes" ,
592
+ "--header-command" , "printf h1=v1" ,
592
593
},
593
- wantErr : false ,
594
594
echoResponse : & echo.Responses {
595
595
Parse : echo .ParseComplete ,
596
596
ProvisionApply : echo .ProvisionApplyWithAgent ("" ),
597
597
},
598
+ wantErr : false ,
598
599
wantConfig : wantConfig {
599
- regexMatch : "--header-command \" /foo/bar/coder \" ssh" ,
600
+ regexMatch : "--header-command \" printf h1=v1 \" ssh" ,
600
601
},
601
602
},
602
603
{
603
604
name : "Header command with double quotes" ,
604
605
args : []string {
605
- "--header-command" , "/foo/bar/coder arg1 arg2=\" quoted value\" " ,
606
+ "--yes" ,
607
+ "--header-command" , "printf h1=v1 h2=\" v2\" " ,
606
608
},
607
- wantErr : false ,
608
609
echoResponse : & echo.Responses {
609
610
Parse : echo .ParseComplete ,
610
611
ProvisionApply : echo .ProvisionApplyWithAgent ("" ),
611
612
},
613
+ wantErr : false ,
612
614
wantConfig : wantConfig {
613
- regexMatch : "--header-command \" /foo/bar/coder arg1 arg2 =\\ \" quoted value \\ \" \" ssh" ,
615
+ regexMatch : "--header-command \" printf h1=v1 h2 =\\ \\ \" v2 \\ \\ \" \" ssh" ,
614
616
},
615
617
},
616
618
{
617
619
name : "Header command with single quotes" ,
618
620
args : []string {
619
- "--header-command" , "/foo/bar/coder arg1 arg2='quoted value'" ,
621
+ "--yes" ,
622
+ "--header-command" , "printf h1=v1 h2='v2'" ,
620
623
},
621
- wantErr : false ,
622
624
echoResponse : & echo.Responses {
623
625
Parse : echo .ParseComplete ,
624
626
ProvisionApply : echo .ProvisionApplyWithAgent ("" ),
625
627
},
628
+ wantErr : false ,
626
629
wantConfig : wantConfig {
627
- regexMatch : "--header-command \" /foo/bar/coder arg1 arg2='quoted value '\" ssh" ,
630
+ regexMatch : "--header-command \" printf h1=v1 h2='v2 '\" ssh" ,
628
631
},
629
632
},
630
633
}
0 commit comments