diff options
Diffstat (limited to 'subversion/tests/cmdline/svnauthz_tests.py')
-rwxr-xr-x | subversion/tests/cmdline/svnauthz_tests.py | 272 |
1 files changed, 110 insertions, 162 deletions
diff --git a/subversion/tests/cmdline/svnauthz_tests.py b/subversion/tests/cmdline/svnauthz_tests.py index fc93b23..7c1396c 100755 --- a/subversion/tests/cmdline/svnauthz_tests.py +++ b/subversion/tests/cmdline/svnauthz_tests.py @@ -92,20 +92,20 @@ def svnauthz_validate_file_test(sbox): svntest.main.file_write(authz_path, authz_content) # Valid authz file - svntest.actions.run_and_verify_svnauthz("Valid authz file", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "validate", authz_path) # Invalid authz file, expect exit code 1, we found the file loaded it # but found an error svntest.main.file_write(authz_path, 'x\n') - svntest.actions.run_and_verify_svnauthz("Invalid authz file", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 1, False, "validate", authz_path) - # Non-existant authz file + # Non-existent authz file # exit code 2, operational error since we can't test the file. os.close(authz_fd) os.remove(authz_path) - svntest.actions.run_and_verify_svnauthz("Non-existant authz file", None, + svntest.actions.run_and_verify_svnauthz(None, None, 2, False, "validate", authz_path) @@ -128,24 +128,23 @@ def svnauthz_validate_repo_test(sbox): expected_status.add({ 'A/authz' : Item(status=' ', wc_rev=2), }) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) # Valid authz url (file stored in repo) authz_url = repo_url + '/A/authz' - svntest.actions.run_and_verify_svnauthz("Valid authz url", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "validate", authz_url) # Invalid authz url (again use the iota file in the repo) # expect exit code 1, we found the file loaded it but found an error iota_url = repo_url + '/iota' - svntest.actions.run_and_verify_svnauthz("Invalid authz url", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 1, False, "validate", iota_url) - # Non-existant authz url + # Non-existent authz url # exit code 2, operational error since we can't test the file. - svntest.actions.run_and_verify_svnauthz("Non-existant authz file", None, + svntest.actions.run_and_verify_svnauthz(None, None, 2, False, "validate", repo_url + "/zilch") @@ -174,9 +173,8 @@ def svnauthz_validate_txn_test(sbox): expected_status.add({ 'A/authz' : Item(status=' ', wc_rev=2), }) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) expected_data = ['Exit 0\n'] verify_logfile(logfilepath, expected_data) @@ -184,9 +182,8 @@ def svnauthz_validate_txn_test(sbox): svntest.main.file_append(authz_path, 'x') expected_output = wc.State(wc_dir, {'A/authz' : Item(verb='Sending')}) expected_status.tweak('A/authz', status=' ', wc_rev=3) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) expected_data = svntest.verify.RegexOutput(".*?Error parsing authz file: '.*?'", match_all=False) verify_logfile(logfilepath, expected_data, delete_log=False) @@ -201,7 +198,7 @@ def svnauthz_validate_txn_test(sbox): svntest.main.file_append(authz_path, 'x') expected_status.tweak('A/authz', status=' ', wc_rev=4) if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): + expected_status): raise svntest.Failure expected_data = svntest.verify.ExpectedOutput("Exit 2\n", match_all=False) verify_logfile(logfilepath, expected_data) @@ -220,38 +217,35 @@ def svnauthz_accessof_file_test(sbox): # Anonymous access with no path, and no repository should be rw # since it returns the highest level of access granted anywhere. # So /bios being rw for everyone means this will be rw. - svntest.actions.run_and_verify_svnauthz("Anonymous access", ["rw\n"], None, + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_path) # Anonymous access on /jokes should be r, no repo so won't match # the slapstick:/jokes section. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path", - ["r\n"], None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(["r\n"], None, 0, False, "accessof", authz_path, "--path", "/jokes") # Anonymous access on /jokes on slapstick repo should be no - svntest.actions.run_and_verify_svnauthz("Anonymous access on path with repo", - ["no\n"], None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_path, "--path", "/jokes", "--repository", "slapstick") # User access with no path, and no repository should be rw # since it returns the h ighest level of access anywhere. # So /bios being rw for everyone means this will be rw. - svntest.actions.run_and_verify_svnauthz("User access", ["rw\n"], None, + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_path, "--username", "groucho") # User groucho specified on /jokes with no repo, will not match any of the # repo specific sections, so is r since everyone has read access. - svntest.actions.run_and_verify_svnauthz("User access on path", ["r\n"], None, + svntest.actions.run_and_verify_svnauthz(["r\n"], None, 0, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho") # User groucho specified on /jokes with the repo comedy will be rw - svntest.actions.run_and_verify_svnauthz("User access on path with repo", - ["rw\n"], None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--repository", "comedy") @@ -282,45 +276,42 @@ def svnauthz_accessof_repo_test(sbox): 'A/authz' : Item(status=' ', wc_rev=2), }) if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): + expected_status): raise svntest.Failure # Anonymous access with no path, and no repository should be rw # since it returns the highest level of access granted anywhere. # So /bios being rw for everyone means this will be rw. authz_url = repo_url + "/A/authz" - svntest.actions.run_and_verify_svnauthz("Anonymous access", ["rw\n"], None, + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_url) # Anonymous access on /jokes should be r, no repo so won't match # the slapstick:/jokes section. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path", - ["r\n"], None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(["r\n"], None, 0, False, "accessof", authz_url, "--path", "/jokes") # Anonymous access on /jokes on slapstick repo should be no - svntest.actions.run_and_verify_svnauthz("Anonymous access on path with repo", - ["no\n"], None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_url, "--path", "/jokes", "--repository", "slapstick") # User access with no path, and no repository should be rw # since it returns the h ighest level of access anywhere. # So /bios being rw for everyone means this will be rw. - svntest.actions.run_and_verify_svnauthz("User access", ["rw\n"], None, + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_url, "--username", "groucho") # User groucho specified on /jokes with no repo, will not match any of the # repo specific sections, so is r since everyone has read access. - svntest.actions.run_and_verify_svnauthz("User access on path", ["r\n"], None, + svntest.actions.run_and_verify_svnauthz(["r\n"], None, 0, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho") # User groucho specified on /jokes with the repo comedy will be rw - svntest.actions.run_and_verify_svnauthz("User access on path with repo", - ["rw\n"], None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--repository", "comedy") @@ -341,29 +332,26 @@ def svnauthz_accessof_groups_file_test(sbox): # Anonymous access with no path, and no repository should be no # since it returns the highest level of access granted anywhere. - svntest.actions.run_and_verify_svnauthz("Anonymous access", ["no\n"], None, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_path, "--groups-file", groups_path) # User stafford (@musicians) access with no path, and no repository should # be no since it returns the highest level of access granted anywhere. - svntest.actions.run_and_verify_svnauthz("Group 1 access", - ["rw\n"], None, + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_path, "--groups-file", groups_path, "--username", "stafford") # User groucho (@comedians) access with no path, and no repository should # be no since it returns the highest level of access granted anywhere. - svntest.actions.run_and_verify_svnauthz("Group 2 access", - ["no\n"], None, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_path, "--groups-file", groups_path, "--username", "groucho") # Anonymous access specified on /jokes with the repo comedy will be no. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path with repo", - ["no\n"], None, 0, False, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_path, "--groups-file", groups_path, "--path", "jokes", @@ -371,8 +359,7 @@ def svnauthz_accessof_groups_file_test(sbox): # User stafford (@musicians) specified on /jokes with the repo comedy # will be no. - svntest.actions.run_and_verify_svnauthz("Group 1 access on path with repo", - ["no\n"], None, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_path, "--groups-file", groups_path, "--path", "jokes", @@ -381,8 +368,7 @@ def svnauthz_accessof_groups_file_test(sbox): # User groucho (@comedians) specified on /jokes with the repo # comedy will be r. - svntest.actions.run_and_verify_svnauthz("Group 2 access on path with repo", - ["r\n"], None, + svntest.actions.run_and_verify_svnauthz(["r\n"], None, 0, False, "accessof", authz_path, "--groups-file", groups_path, "--path", "jokes", @@ -423,37 +409,33 @@ def svnauthz_accessof_groups_repo_test(sbox): 'A/groups' : Item(status=' ', wc_rev=2), }) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) # Anonymous access with no path, and no repository should be no # since it returns the highest level of access granted anywhere. authz_url = repo_url + "/A/authz" groups_url = repo_url + "/A/groups" - svntest.actions.run_and_verify_svnauthz("Anonymous access", ["no\n"], None, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_url, "--groups-file", groups_url) # User stafford (@musicians) access with no path, and no repository should # be no since it returns the highest level of access granted anywhere. - svntest.actions.run_and_verify_svnauthz("Group 1 access", - ["rw\n"], None, + svntest.actions.run_and_verify_svnauthz(["rw\n"], None, 0, False, "accessof", authz_url, "--groups-file", groups_url, "--username", "stafford") # User groucho (@comedians) access with no path, and no repository should # be no since it returns the highest level of access granted anywhere. - svntest.actions.run_and_verify_svnauthz("Group 2 access", - ["no\n"], None, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_url, "--groups-file", groups_url, "--username", "groucho") # Anonymous access specified on /jokes with the repo comedy will be no. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path with repo", - ["no\n"], None, 0, False, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_url, "--groups-file", groups_url, "--path", "jokes", @@ -461,8 +443,7 @@ def svnauthz_accessof_groups_repo_test(sbox): # User stafford (@musicians) specified on /jokes with the repo comedy # will be no. - svntest.actions.run_and_verify_svnauthz("Group 1 access on path with repo", - ["no\n"], None, + svntest.actions.run_and_verify_svnauthz(["no\n"], None, 0, False, "accessof", authz_url, "--groups-file", groups_url, "--path", "jokes", @@ -471,8 +452,7 @@ def svnauthz_accessof_groups_repo_test(sbox): # User groucho (@comedians) specified on /jokes with the repo # comedy will be r. - svntest.actions.run_and_verify_svnauthz("Group 2 access on path with repo", - ["r\n"], None, + svntest.actions.run_and_verify_svnauthz(["r\n"], None, 0, False, "accessof", authz_url, "--groups-file", groups_url, "--path", "jokes", @@ -495,7 +475,7 @@ def svnauthz_accessof_is_file_test(sbox): expected_output = svntest.verify.RegexOutput( ".*'x' is not a valid argument for --is", match_all=False ) - svntest.actions.run_and_verify_svnauthz("--is x fails", None, + svntest.actions.run_and_verify_svnauthz(None, expected_output, 2, False, "accessof", authz_path, "--is", "x") @@ -503,52 +483,46 @@ def svnauthz_accessof_is_file_test(sbox): # since it returns the highest level of access granted anywhere. # So /bios being rw for everyone means this will be rw. # Test --is rw returns 0. - svntest.actions.run_and_verify_svnauthz("Anonymous access --is rw", None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_path, "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access --is r", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--is", "r") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access --is no", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--is", "no") # Anonymous access on /jokes should be r, no repo so won't match # the slapstick:/jokes section. # Test --is r returns 0. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path --is r", - None, None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_path, "--path", "/jokes", "--is", "r") # Test --is rw returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path --is r", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--is", "rw") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path --is r", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--is", "no") # Anonymous access on /jokes on slapstick repo should be no # Test --is no returns 0. - svntest.actions.run_and_verify_svnauthz("Anon access on path w/ repo --is no", - None, None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_path, "--path", "/jokes", "--repository", "slapstick", "--is", "no") # Test --is rw returns 3. - svntest.actions.run_and_verify_svnauthz("Anon access on path w/ repo --is no", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--repository", "slapstick", "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("Anon access on path w/ repo --is no", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--repository", "slapstick", "--is", "r") @@ -557,17 +531,17 @@ def svnauthz_accessof_is_file_test(sbox): # since it returns the h ighest level of access anywhere. # So /bios being rw for everyone means this will be rw. # Test --is rw returns 0. - svntest.actions.run_and_verify_svnauthz("User access --is rw", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_path, "--username", "groucho", "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("User access --is r", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--username", "groucho", "--is", "r") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("User access --is no", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--username", "groucho", "--is", "no") @@ -575,18 +549,18 @@ def svnauthz_accessof_is_file_test(sbox): # User groucho specified on /jokes with no repo, will not match any of the # repo specific sections, so is r since everyone has read access. # Test --is r returns 0. - svntest.actions.run_and_verify_svnauthz("User access on path --is r", None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--is", "r") # Test --is rw returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path --is rw", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--is", "rw") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path --is no", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", @@ -594,22 +568,19 @@ def svnauthz_accessof_is_file_test(sbox): # User groucho specified on /jokes with the repo comedy will be rw # Test --is rw returns 0. - svntest.actions.run_and_verify_svnauthz("User access on path w/ repo --is rw", - None, None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path w/ repo --is r", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", "r") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path w/ repo --is no", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", @@ -622,8 +593,7 @@ def svnauthz_accessof_is_file_test(sbox): ".*Error while parsing config file:", match_all=False ) - svntest.actions.run_and_verify_svnauthz("--is with invalid authz file", - None, expected_out, 1, False, + svntest.actions.run_and_verify_svnauthz(None, expected_out, 1, False, "accessof", authz_path, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", @@ -654,9 +624,8 @@ def svnauthz_accessof_is_repo_test(sbox): expected_status.add({ 'A/authz' : Item(status=' ', wc_rev=2), }) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) # Test an invalid --is option, should get an error message and exit code # of 2. @@ -664,7 +633,7 @@ def svnauthz_accessof_is_repo_test(sbox): expected_output = svntest.verify.RegexOutput( ".*'x' is not a valid argument for --is", match_all=False ) - svntest.actions.run_and_verify_svnauthz("--is x fails", None, + svntest.actions.run_and_verify_svnauthz(None, expected_output, 2, False, "accessof", authz_url, "--is", "x") @@ -672,52 +641,46 @@ def svnauthz_accessof_is_repo_test(sbox): # since it returns the highest level of access granted anywhere. # So /bios being rw for everyone means this will be rw. # Test --is rw returns 0. - svntest.actions.run_and_verify_svnauthz("Anonymous access --is rw", None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_url, "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access --is r", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--is", "r") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access --is no", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--is", "no") # Anonymous access on /jokes should be r, no repo so won't match # the slapstick:/jokes section. # Test --is r returns 0. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path --is r", - None, None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_url, "--path", "/jokes", "--is", "r") # Test --is rw returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path --is r", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--is", "rw") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("Anonymous access on path --is r", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--is", "no") # Anonymous access on /jokes on slapstick repo should be no # Test --is no returns 0. - svntest.actions.run_and_verify_svnauthz("Anon access on path w/ repo --is no", - None, None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_url, "--path", "/jokes", "--repository", "slapstick", "--is", "no") # Test --is rw returns 3. - svntest.actions.run_and_verify_svnauthz("Anon access on path w/ repo --is no", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--repository", "slapstick", "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("Anon access on path w/ repo --is no", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--repository", "slapstick", "--is", "r") @@ -726,17 +689,17 @@ def svnauthz_accessof_is_repo_test(sbox): # since it returns the h ighest level of access anywhere. # So /bios being rw for everyone means this will be rw. # Test --is rw returns 0. - svntest.actions.run_and_verify_svnauthz("User access --is rw", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_url, "--username", "groucho", "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("User access --is r", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--username", "groucho", "--is", "r") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("User access --is no", None, None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--username", "groucho", "--is", "no") @@ -744,18 +707,18 @@ def svnauthz_accessof_is_repo_test(sbox): # User groucho specified on /jokes with no repo, will not match any of the # repo specific sections, so is r since everyone has read access. # Test --is r returns 0. - svntest.actions.run_and_verify_svnauthz("User access on path --is r", None, + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--is", "r") # Test --is rw returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path --is rw", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--is", "rw") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path --is no", None, + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", @@ -763,22 +726,19 @@ def svnauthz_accessof_is_repo_test(sbox): # User groucho specified on /jokes with the repo comedy will be rw # Test --is rw returns 0. - svntest.actions.run_and_verify_svnauthz("User access on path w/ repo --is rw", - None, None, 0, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 0, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", "rw") # Test --is r returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path w/ repo --is r", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", "r") # Test --is no returns 3. - svntest.actions.run_and_verify_svnauthz("User access on path w/ repo --is no", - None, None, 3, False, "accessof", + svntest.actions.run_and_verify_svnauthz(None, None, 3, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", @@ -788,17 +748,15 @@ def svnauthz_accessof_is_repo_test(sbox): svntest.main.file_append(authz_path, "x\n") expected_output = wc.State(wc_dir, {'A/authz' : Item(verb='Sending')}) expected_status.tweak('A/authz', wc_rev=3) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) # Check that --is returns 1 when the syntax is invalid with a url. expected_out = svntest.verify.RegexOutput( ".*Error while parsing config file:", match_all=False ) - svntest.actions.run_and_verify_svnauthz("--is with invalid authz url", - None, expected_out, 1, False, + svntest.actions.run_and_verify_svnauthz(None, expected_out, 1, False, "accessof", authz_url, "--path", "/jokes", "--username", "groucho", "--repository", "comedy", "--is", @@ -833,9 +791,8 @@ def svnauthz_accessof_txn_test(sbox): expected_status.add({ 'A/authz' : Item(status=' ', wc_rev=2), }) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) expected_data = ['Exit 0\n'] verify_logfile(logfilepath, expected_data) @@ -848,33 +805,30 @@ def svnauthz_accessof_txn_test(sbox): expected_output = wc.State(wc_dir, {'A/authz' : Item(verb='Sending')}) expected_status.tweak('A/authz', status=' ', wc_rev=3) svntest.main.file_append(authz_path, "groucho = r\n") - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) expected_data = svntest.verify.ExpectedOutput('Exit 3\n', match_all=False) verify_logfile(logfilepath, expected_data) - # break the authz file with a non-existant group and check for an exit 1. + # break the authz file with a non-existent group and check for an exit 1. expected_status.tweak('A/authz', status=' ', wc_rev=4) svntest.main.file_append(authz_path, "@friends = rw\n") - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) expected_data = svntest.verify.ExpectedOutput('Exit 1\n', match_all=False) verify_logfile(logfilepath, expected_data) - # break the authz file with a non-existant gropu and check for an exit 2. + # break the authz file with a non-existent gropu and check for an exit 2. expected_output = wc.State(wc_dir, {'A/authz' : Item(verb='Deleting')}) expected_status.remove('A/authz') svntest.main.run_svn(None, 'rm', authz_path) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) expected_data = svntest.verify.ExpectedOutput('Exit 2\n', match_all=False) verify_logfile(logfilepath, expected_data) def svnauthz_compat_mode_file_test(sbox): - "test 'svnauthz-validate' compatability mode file" + "test 'svnauthz-validate' compatibility mode file" # Create an authz file @@ -883,30 +837,28 @@ def svnauthz_compat_mode_file_test(sbox): svntest.main.file_write(authz_path, authz_content) # Check a valid file. - svntest.actions.run_and_verify_svnauthz("svnauthz-validate on file", - None, None, 0, True, + svntest.actions.run_and_verify_svnauthz(None, None, 0, True, authz_path) # Check an invalid file. svntest.main.file_append(authz_path, "x\n") - svntest.actions.run_and_verify_svnauthz("svnauthz-validate on invalid file", - None, None, 1, True, + svntest.actions.run_and_verify_svnauthz(None, None, 1, True, authz_path) # Remove the file. os.close(authz_fd) os.remove(authz_path) - # Check a non-existant file. + # Check a non-existent file. svntest.actions.run_and_verify_svnauthz( - "svnauthz-validate on non-existant file", None, None, 2, True, + None, None, 2, True, authz_path ) @SkipUnless(svntest.main.is_ra_type_file) def svnauthz_compat_mode_repo_test(sbox): - "test 'svnauthz-validate' compatability mode url" + "test 'svnauthz-validate' compatibility mode url" sbox.build() wc_dir = sbox.wc_dir @@ -925,28 +877,24 @@ def svnauthz_compat_mode_repo_test(sbox): expected_status.add({ 'A/authz' : Item(status=' ', wc_rev=2), }) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure - svntest.actions.run_and_verify_svnauthz("svnauthz-validate on url", - None, None, 0, True, + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) + svntest.actions.run_and_verify_svnauthz(None, None, 0, True, authz_url) # Check an invalid url. svntest.main.file_append(authz_path, "x\n") expected_output = wc.State(wc_dir, {'A/authz' : Item(verb='Sending')}) expected_status.tweak('A/authz', status=' ', wc_rev=3) - if svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir): - raise svntest.Failure - svntest.actions.run_and_verify_svnauthz("svnauthz-validate on invalid file", - None, None, 1, True, + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status) + svntest.actions.run_and_verify_svnauthz(None, None, 1, True, authz_path) - # Check a non-existant url. + # Check a non-existent url. # Exit code really should be 2 since this is an operational error. svntest.actions.run_and_verify_svnauthz( - "svnauthz-validate on non-existant file", None, None, 2, True, + None, None, 2, True, repo_url + "/zilch" ) |