diff --git a/esti/lakectl_test.go b/esti/lakectl_test.go index bf53f663706..b89cb3da8d8 100644 --- a/esti/lakectl_test.go +++ b/esti/lakectl_test.go @@ -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) { @@ -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) {