diff --git a/esti/lakectl_local_test.go b/esti/lakectl_local_test.go index a85b0b4fd2c..75ef862f36a 100644 --- a/esti/lakectl_local_test.go +++ b/esti/lakectl_local_test.go @@ -503,32 +503,20 @@ func TestLakectlLocal_commitProtetedBranch(t *testing.T) { "REF": mainBranch, "LOCAL_DIR": dataDir, } - runCmd(t, Lakectl()+" repo create lakefs://"+vars["REPO"]+" "+storage, false, false, vars) + runCmd(t, Lakectl()+" repo create lakefs://"+vars["REPO"]+" "+vars["STORAGE"], false, false, vars) runCmd(t, Lakectl()+" branch-protect add lakefs://"+vars["REPO"]+"/ '*'", false, false, vars) - + // Cloning local dir RunCmdAndVerifyContainsText(t, Lakectl()+" local clone lakefs://"+vars["REPO"]+"/"+vars["BRANCH"]+"/ "+vars["LOCAL_DIR"], false, "Successfully cloned lakefs://${REPO}/${REF}/ to ${LOCAL_DIR}.", vars) RunCmdAndVerifyContainsText(t, Lakectl()+" local status "+vars["LOCAL_DIR"], false, "No diff found", vars) - + // Adding file to local dir fd, err = os.Create(filepath.Join(dataDir, "test.txt")) require.NoError(t, err) require.NoError(t, fd.Close()) RunCmdAndVerifyContainsText(t, Lakectl()+" local status "+vars["LOCAL_DIR"], false, "local ║ added ║ test.txt", vars) - runCmdAndVerifyContainsText(t, Lakectl()+" branch-protect list lakefs://"+vars["REPO"]+"/ ", false, false, "*", vars) - str := runCmd(t, Lakectl()+" branch-protect list lakefs://"+vars["REPO"]+"/ ", false, false, vars) - fmt.Println("itamar testing", str) - // Commit changes to branch - //runCmd(t, Lakectl()+" commit lakefs://"+vars["REPO"]+"/"+vars["BRANCH"]+" --allow-empty-message -m \" \"", false, false, vars) - - //RunCmdAndVerifyFailureContainsText(t, Lakectl()+" fs upload -s files/ro_1k lakefs://"+vars["REPO"]+"/"+vars["BRANCH"]+"/"+"fail_file.txt", false, "cannot write to protected branch", vars) - //RunCmdAndVerifyContainsText(t, Lakectl()+" local list", false, repoName+"/"+vars["BRANCH"], vars) - + // Try to commit local dir, expect failure RunCmdAndVerifyFailureContainsText(t, Lakectl()+" local commit -m test "+vars["LOCAL_DIR"], false, "cannot write to protected branch", vars) - //RunCmdAndVerifyFailureContainsText(t, Lakectl()+" fs rm "+dataDir, false, "cannot write to protected branch", vars) - - //runCmd(t, Lakectl()+" branch-protect delete lakefs://"+repoName+"/ \"*\"", false, false, vars) - } func TestLakectlLocal_commit(t *testing.T) {