Skip to content

Commit

Permalink
maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarYuran committed Jan 13, 2025
1 parent b33d289 commit 3bfb306
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions esti/lakectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func TestLakectlFsUpload_protectedBranch(t *testing.T) {
runCmd(t, Lakectl()+" branch-protect add lakefs://"+repoName+"/ '*'", false, false, vars)
RunCmdAndVerifyContainsText(t, Lakectl()+" branch-protect list lakefs://"+repoName+"/ ", false, "*", vars)

vars["FILE_PATH"] = "data/ro/ro_1k.0"
vars["FILE_PATH"] = "ro_1k.0"
RunCmdAndVerifyFailure(t, Lakectl()+" fs upload lakefs://"+repoName+"/"+mainBranch+"/"+vars["FILE_PATH"]+" -s files/ro_1k", false, "cannot write to protected branch\n403 Forbidden\n", vars)
}
func TestLakectlFsRm_protectedBranch(t *testing.T) {
Expand All @@ -749,13 +749,13 @@ func TestLakectlFsRm_protectedBranch(t *testing.T) {
"STORAGE": storage,
"BRANCH": mainBranch,
}
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" repo create lakefs://"+repoName+" "+storage, false, "lakectl_repo_create", vars)
vars["FILE_PATH"] = "data/ro/ro_1k.0"
runCmd(t, Lakectl()+" fs upload lakefs://"+repoName+"/"+mainBranch+"/"+vars["FILE_PATH"]+" -s files/ro_1k", false, false, vars)
runCmd(t, Lakectl()+" branch-protect add lakefs://"+repoName+"/ '*'", false, false, vars)
RunCmdAndVerifyContainsText(t, Lakectl()+" branch-protect list lakefs://"+repoName+"/ ", false, "*", vars)

RunCmdAndVerifyFailure(t, Lakectl()+" fs rm lakefs://"+repoName+"/"+mainBranch+"/"+vars["FILE_PATH"], false, "cannot write to protected branch\n403 Forbidden\n", vars)
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" repo create lakefs://"+vars["REPO"]+" "+vars["STORAGE"], false, "lakectl_repo_create", vars)
vars["FILE_PATH"] = "ro_1k.0"
runCmd(t, Lakectl()+" fs upload lakefs://"+vars["REPO"]+"/"+vars["BRANCH"]+"/"+vars["FILE_PATH"]+" -s files/ro_1k", false, false, vars)
runCmd(t, Lakectl()+" commit lakefs://"+vars["REPO"]+"/"+vars["BRANCH"]+" --allow-empty-message -m \" \"", false, false, vars)
runCmd(t, Lakectl()+" branch-protect add lakefs://"+vars["REPO"]+"/ '*'", false, false, vars)
RunCmdAndVerifyContainsText(t, Lakectl()+" branch-protect list lakefs://"+vars["REPO"]+"/ ", false, "*", vars)
RunCmdAndVerifyFailure(t, Lakectl()+" fs rm lakefs://"+vars["REPO"]+"/"+vars["BRANCH"]+"/"+vars["FILE_PATH"], false, "cannot write to protected branch\n403 Forbidden\n", vars)
}

func TestLakectlFsPresign(t *testing.T) {
Expand Down

0 comments on commit 3bfb306

Please sign in to comment.