@@ -368,7 +368,7 @@ func TestOpenWorkspaceFromPrebuild(t *testing.T) {
368
368
// check prebuild log message exists
369
369
checkPrebuildLogExist (t , cfg , rsa , ws , test .WorkspaceRoot )
370
370
371
- // check the files/folders permission under .git/ is not root
371
+ // check the files/folders permission under .git/ is not gitpod
372
372
checkGitFolderPermission (t , rsa , test .WorkspaceRoot )
373
373
374
374
// write file foobar.txt and stop the workspace
@@ -807,7 +807,7 @@ func TestPrebuildAndRegularWorkspaceDifferentWorkspaceClass(t *testing.T) {
807
807
// check prebuild log message exists
808
808
checkPrebuildLogExist (t , cfg , rsa , ws , test .WorkspaceRoot )
809
809
810
- // check the files/folders permission under .git/ is not root
810
+ // check the files/folders permission under .git/ is not gitpod
811
811
checkGitFolderPermission (t , rsa , test .WorkspaceRoot )
812
812
})
813
813
}
@@ -926,15 +926,15 @@ func checkPrebuildLogExist(t *testing.T, cfg *envconf.Config, rsa *rpc.Client, w
926
926
t .Fatal ("did not find someFile from previous workspace instance" )
927
927
}
928
928
929
- // checkGitFolderPermission checks the files/folders permission under .git/ is not root
929
+ // checkGitFolderPermission checks the files/folders permission under .git/ is not gitpod
930
930
func checkGitFolderPermission (t * testing.T , rsa * rpc.Client , workspaceRoot string ) {
931
931
var findUserResp agent.ExecResponse
932
932
var gitDir string = fmt .Sprintf ("%s/%s" , workspaceRoot , ".git" )
933
933
934
934
err := rsa .Call ("WorkspaceAgent.Exec" , & agent.ExecRequest {
935
935
Dir : gitDir ,
936
936
Command : "find" ,
937
- Args : []string {"-user" , "root " },
937
+ Args : []string {"!" , " -user" , "gitpod " },
938
938
}, & findUserResp )
939
939
if err != nil || findUserResp .ExitCode != 0 || strings .Trim (findUserResp .Stdout , " \t \n " ) != "" {
940
940
t .Fatalf ("incorrect file perimssion under %s folder, err:%v, exitCode:%d, stdout:%s" , gitDir , err , findUserResp .ExitCode , findUserResp .Stdout )
@@ -944,7 +944,7 @@ func checkGitFolderPermission(t *testing.T, rsa *rpc.Client, workspaceRoot strin
944
944
err = rsa .Call ("WorkspaceAgent.Exec" , & agent.ExecRequest {
945
945
Dir : gitDir ,
946
946
Command : "find" ,
947
- Args : []string {"-group" , "root " },
947
+ Args : []string {"!" , " -group" , "gitpod " },
948
948
}, & findGroupResp )
949
949
if err != nil || findGroupResp .ExitCode != 0 || strings .Trim (findGroupResp .Stdout , " \t \n " ) != "" {
950
950
t .Fatalf ("incorrect group perimssion under %s folder, err:%v, exitCode:%d, stdout:%s" , gitDir , err , findGroupResp .ExitCode , findGroupResp .Stdout )
0 commit comments