Skip to content

Commit c7cb625

Browse files
jentingroboquat
authored andcommitted
test: check UID/GID is not gitpod
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 2b62b91 commit c7cb625

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/tests/components/ws-manager/prebuild_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func TestOpenWorkspaceFromPrebuild(t *testing.T) {
368368
// check prebuild log message exists
369369
checkPrebuildLogExist(t, cfg, rsa, ws, test.WorkspaceRoot)
370370

371-
// check the files/folders permission under .git/ is not root
371+
// check the files/folders permission under .git/ is not gitpod
372372
checkGitFolderPermission(t, rsa, test.WorkspaceRoot)
373373

374374
// write file foobar.txt and stop the workspace
@@ -807,7 +807,7 @@ func TestPrebuildAndRegularWorkspaceDifferentWorkspaceClass(t *testing.T) {
807807
// check prebuild log message exists
808808
checkPrebuildLogExist(t, cfg, rsa, ws, test.WorkspaceRoot)
809809

810-
// check the files/folders permission under .git/ is not root
810+
// check the files/folders permission under .git/ is not gitpod
811811
checkGitFolderPermission(t, rsa, test.WorkspaceRoot)
812812
})
813813
}
@@ -926,15 +926,15 @@ func checkPrebuildLogExist(t *testing.T, cfg *envconf.Config, rsa *rpc.Client, w
926926
t.Fatal("did not find someFile from previous workspace instance")
927927
}
928928

929-
// checkGitFolderPermission checks the files/folders permission under .git/ is not root
929+
// checkGitFolderPermission checks the files/folders permission under .git/ is not gitpod
930930
func checkGitFolderPermission(t *testing.T, rsa *rpc.Client, workspaceRoot string) {
931931
var findUserResp agent.ExecResponse
932932
var gitDir string = fmt.Sprintf("%s/%s", workspaceRoot, ".git")
933933

934934
err := rsa.Call("WorkspaceAgent.Exec", &agent.ExecRequest{
935935
Dir: gitDir,
936936
Command: "find",
937-
Args: []string{"-user", "root"},
937+
Args: []string{"!", "-user", "gitpod"},
938938
}, &findUserResp)
939939
if err != nil || findUserResp.ExitCode != 0 || strings.Trim(findUserResp.Stdout, " \t\n") != "" {
940940
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
944944
err = rsa.Call("WorkspaceAgent.Exec", &agent.ExecRequest{
945945
Dir: gitDir,
946946
Command: "find",
947-
Args: []string{"-group", "root"},
947+
Args: []string{"!", "-group", "gitpod"},
948948
}, &findGroupResp)
949949
if err != nil || findGroupResp.ExitCode != 0 || strings.Trim(findGroupResp.Stdout, " \t\n") != "" {
950950
t.Fatalf("incorrect group perimssion under %s folder, err:%v, exitCode:%d, stdout:%s", gitDir, err, findGroupResp.ExitCode, findGroupResp.Stdout)

0 commit comments

Comments
 (0)