You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Prabhu Gnana Sundar <pr...@collab.net> on 2011/02/03 12:23:54 UTC

[PATCH] New XFail test for the issue 3781

Hi all,

Currently, as per the issue 3781, "checkout" reads the authz file in 
*case insensitive* way, whereas "commit" reads the authz file in *case 
sensitive* way.

Here is what is observed:
1. Checkout is *case insensitive* about the repository name section and 
also the path-inside-repo section.
2. Commit is *case sensitive* about the repository name section *but 
case insensitive* about the path-inside-repo section.

Attached an XFail testcase and the log message with this mail. Please 
share your views.




Thanks and regards
Prabhu

Re: [PATCH] New XFail test for the issue 3781

Posted by Prabhu Gnana Sundar <pr...@collab.net>.
On Thursday 03 February 2011 05:23 PM, Noorul Islam K M wrote:
> Prabhu Gnana Sundar<pr...@collab.net>  writes:
>
>> Hi all,
>>
>> Currently, as per the issue 3781, "checkout" reads the authz file in
>> *case insensitive* way, whereas "commit" reads the authz file in *case
>> sensitive* way.
>>
>> Here is what is observed:
>> 1. Checkout is *case insensitive* about the repository name section
>> and also the path-inside-repo section.
>> 2. Commit is *case sensitive* about the repository name section *but
>> case insensitive* about the path-inside-repo section.
>>
>> Attached an XFail testcase and the log message with this mail. Please
>> share your views.
>>
>>
>>
>>
>> Thanks and regards
>> Prabhu
>>
>> [[[
>> XFail testcase for the issue 3781
>>
>> * subversion/tests/cmdline/authz_tests.py
>>    (case_insensitive_authz, test_list): New XFail test for the issue 3781
>>
>> Patch by: Prabhu Gnana Sundar<prabhugs{_AT_}collab.net>
>> Suggested by: Kamesh Jayachandran<kamesh{_AT_}collab.net>
>>
>> Index: subversion/tests/cmdline/authz_tests.py
>> ===================================================================
>> --- subversion/tests/cmdline/authz_tests.py	(revision 1066732)
>> +++ subversion/tests/cmdline/authz_tests.py	(working copy)
>> @@ -1061,6 +1061,67 @@
>>                                        [], 'ls', '-R',
>>                                        sbox.repo_url)
>>
>> +
>> +def case_insensitive_authz(sbox):
>> +  "authz issue #3781, check case insensitiveness"
>> +
>> +  sbox.build()
>> +
>> +  # test the case-insensitivity of the path inside the repo
>> +  write_authz_file(sbox, {"/": "jrandom = r", "/A": "jrandom = r", "/a/Mu": "jrandom = rw"})
>> +
> I am not sure whether this is relevant. I think for consistency lines
> should be of 79 characters.

wrapped the text for the consistency :)
Attached the patch with this mail...
Thanks Noorul for your feedback over the "indentation".


Thanks and regards
Prabhu

Re: [PATCH] New XFail test for the issue 3781

Posted by Noorul Islam K M <no...@collab.net>.
Prabhu Gnana Sundar <pr...@collab.net> writes:

> Hi all,
>
> Currently, as per the issue 3781, "checkout" reads the authz file in
> *case insensitive* way, whereas "commit" reads the authz file in *case
> sensitive* way.
>
> Here is what is observed:
> 1. Checkout is *case insensitive* about the repository name section
> and also the path-inside-repo section.
> 2. Commit is *case sensitive* about the repository name section *but
> case insensitive* about the path-inside-repo section.
>
> Attached an XFail testcase and the log message with this mail. Please
> share your views.
>
>
>
>
> Thanks and regards
> Prabhu
>
> [[[
> XFail testcase for the issue 3781
>
> * subversion/tests/cmdline/authz_tests.py
>   (case_insensitive_authz, test_list): New XFail test for the issue 3781
>
> Patch by: Prabhu Gnana Sundar <prabhugs{_AT_}collab.net>
> Suggested by: Kamesh Jayachandran <kamesh{_AT_}collab.net>
>
> Index: subversion/tests/cmdline/authz_tests.py
> ===================================================================
> --- subversion/tests/cmdline/authz_tests.py	(revision 1066732)
> +++ subversion/tests/cmdline/authz_tests.py	(working copy)
> @@ -1061,6 +1061,67 @@
>                                       [], 'ls', '-R',
>                                       sbox.repo_url)
>  
> +
> +def case_insensitive_authz(sbox):
> +  "authz issue #3781, check case insensitiveness"
> +
> +  sbox.build()
> +
> +  # test the case-insensitivity of the path inside the repo
> +  write_authz_file(sbox, {"/": "jrandom = r", "/A": "jrandom = r", "/a/Mu": "jrandom = rw"})
> +

I am not sure whether this is relevant. I think for consistency lines
should be of 79 characters. 

> +  write_restrictive_svnserve_conf(sbox.repo_dir)
> +
> +  wc_dir = sbox.wc_dir
> +
> +  mu_path = os.path.join(wc_dir, 'A', 'mu')
> +  mu_url = sbox.repo_url + '/A/mu'
> +  svntest.main.file_append(mu_path, "hi")
> +
> +  # Create expected output tree.
> +  expected_output = svntest.wc.State(wc_dir, {
> +    'A/mu' : Item(verb='Sending'),
> +    })
> +
> +  # Commit the file.
> +  svntest.actions.run_and_verify_commit(wc_dir,
> +                                        expected_output,
> +                                        None,
> +                                        None,
> +                                        mu_path)
> +  svntest.actions.run_and_verify_svn2('No error',
> +                                      svntest.verify.AnyOutput, [],
> +                                      0, 'cat', mu_url)
> +
> +  def mixcases(repo_name):
> +    mixed_repo_name = ''
> +    for i in range(0, len(repo_name)):
> +      if i % 2 == 0:
> +        mixed_val = repo_name[i].upper()
> +        mixed_repo_name = mixed_repo_name + mixed_val
> +      else:
> +        mixed_val = repo_name[i].lower()
> +        mixed_repo_name = mixed_repo_name + mixed_val
> +    return mixed_repo_name 
> +
> +  mixed_case_repo_dir = mixcases(os.path.basename(sbox.repo_dir))
> +
> +  # test the case-insensitivity of the repo name
> +  write_authz_file(sbox, {}, sections = {mixed_case_repo_dir + ":/": "jrandom = r",
> +                                         mixed_case_repo_dir + ":/A": "jrandom = r",
> +                                         mixed_case_repo_dir + ":/A/mu": "jrandom = rw"})
> +

Line break ?

> +  svntest.main.file_append(mu_path, "hi")
> +  # Commit the file again.
> +  svntest.actions.run_and_verify_commit(wc_dir,
> +                                        expected_output,
> +                                        None,
> +                                        None,
> +                                        mu_path)
> +  svntest.actions.run_and_verify_svn2('No error',
> +                                      svntest.verify.AnyOutput, [],
> +                                      0, 'cat', mu_url) 
> +
>  ########################################################################
>  # Run the tests
>  
> @@ -1093,6 +1154,8 @@
>                Skip(wc_wc_copy_revert, svntest.main.is_ra_type_file),
>                Skip(authz_recursive_ls,
>                     svntest.main.is_ra_type_file),
> +              XFail(Skip(case_insensitive_authz,
> +                         svntest.main.is_ra_type_file)),
>               ]
>  serial_only = True
>  

Thanks and Regards
Noorul

RE: [PATCH] New XFail test for issue 3781

Posted by Kamesh Jayachandran <ka...@collab.net>.
Thanks Prabhu committed your patch in r1068802.


With regards
Kamesh Jayachandran
-----Original Message-----
From: Prabhu Gnana Sundar Ponnarasu
Sent: Wed 2/9/2011 2:30 PM
To: Bert Huijben
Cc: Kamesh Jayachandran; dev@subversion.apache.org
Subject: Re: [PATCH] New XFail test for issue 3781
 
Hi Bert,

The problem was that my patch handled the expected error more 
specifically and also failed to handle the svnserve case. That was wrong 
on my part. I have tweaked the test case and attached a patch and log 
message with this mail.
Please share your views on the same.


On Tuesday 08 February 2011 09:08 PM, Bert Huijben wrote:
> This test XFails for the wrong reason on svn://.
>
> EXPECTED STDERR (regexp):
> svn: E175013: Unable to connect to a repository at URL
> 'svn://localhost/svn-test-work/repositories/authz_tests-20/A/mu'
> svn: E175013: Access to '/svn-test-work\repositories\authz_tests-20/A/mu'
> forbidden
> svn: E175009: XML parsing failed: (403 Forbidden)
> ACTUAL STDERR:
> ..\..\..\subversion\svn\cat-cmd.c:81: (apr_err=170001)
> ..\..\..\subversion\svn\util.c:967: (apr_err=170001)
> ..\..\..\subversion\libsvn_client\cat.c:233: (apr_err=170001)
> ..\..\..\subversion\libsvn_ra_svn\client.c:1557: (apr_err=170001)
> ..\..\..\subversion\libsvn_ra_svn\client.c:242: (apr_err=170001)
> ..\..\..\subversion\svnserve\serve.c:174: (apr_err=170001)
> svn: E170001: Authorization failed
> EXCEPTION: SVNUnmatchedError
>
> See http://subversion.apache.org/buildbot/ or more specifically
> http://ci.apache.org/builders/svn-slik-w2k3-x64-ra/builds/1675/steps/Test%20
> fsfs%2Bsvn/logs/testlog
>
> 	Bert
>


Thanks and regards
Prabhu


Re: [PATCH] New XFail test for issue 3781

Posted by Prabhu Gnana Sundar <pr...@collab.net>.
Hi Bert,

The problem was that my patch handled the expected error more 
specifically and also failed to handle the svnserve case. That was wrong 
on my part. I have tweaked the test case and attached a patch and log 
message with this mail.
Please share your views on the same.


On Tuesday 08 February 2011 09:08 PM, Bert Huijben wrote:
> This test XFails for the wrong reason on svn://.
>
> EXPECTED STDERR (regexp):
> svn: E175013: Unable to connect to a repository at URL
> 'svn://localhost/svn-test-work/repositories/authz_tests-20/A/mu'
> svn: E175013: Access to '/svn-test-work\repositories\authz_tests-20/A/mu'
> forbidden
> svn: E175009: XML parsing failed: (403 Forbidden)
> ACTUAL STDERR:
> ..\..\..\subversion\svn\cat-cmd.c:81: (apr_err=170001)
> ..\..\..\subversion\svn\util.c:967: (apr_err=170001)
> ..\..\..\subversion\libsvn_client\cat.c:233: (apr_err=170001)
> ..\..\..\subversion\libsvn_ra_svn\client.c:1557: (apr_err=170001)
> ..\..\..\subversion\libsvn_ra_svn\client.c:242: (apr_err=170001)
> ..\..\..\subversion\svnserve\serve.c:174: (apr_err=170001)
> svn: E170001: Authorization failed
> EXCEPTION: SVNUnmatchedError
>
> See http://subversion.apache.org/buildbot/ or more specifically
> http://ci.apache.org/builders/svn-slik-w2k3-x64-ra/builds/1675/steps/Test%20
> fsfs%2Bsvn/logs/testlog
>
> 	Bert
>


Thanks and regards
Prabhu

RE: [PATCH] New XFail test for issue 3781

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Kamesh Jayachandran [mailto:kamesh@collab.net]
> Sent: dinsdag 8 februari 2011 15:30
> To: Prabhu Gnana Sundar Ponnarasu
> Cc: dev@subversion.apache.org
> Subject: RE: [PATCH] New XFail test for issue 3781
> 
> 
> Thanks Prabhu.
> 
> I committed with the following tweaks in r1068411.
> 
> 1. Added @XFail(), @Issue(3781) decorators
> 2.
> 
> +  # test the case-sensitivity of the repo name
> +  write_authz_file(sbox, {},
> +                   sections = {mixed_case_repo_dir + ":/": "jrandom =
> r",
> +                               mixed_case_repo_dir + ":/A": "jrandom =
> r",
> +                               sbox.repo_dir + ":/A/mu": "jrandom =",
> +                               mixed_case_repo_dir + ":/A/mu":
> "jrandom = rw"})
> 
> Replaced this snippet by the following snippet.
> +  # test the case-sensitivity of the repo name
> +  sec_mixed_case = {mixed_case_repo_dir + ":/": "jrandom = r",
> +                    mixed_case_repo_dir + ":/A": "jrandom = r",
> +                    os.path.basename(sbox.repo_dir) + ":/A/mu":
> "jrandom =",
> +                    mixed_case_repo_dir + ":/A/mu": "jrandom = rw"}
> +  write_authz_file(sbox, {}, sec_mixed_case)
> 
> 
> You can reduce this to simpler one as most of the time same 'cat' and
> 'commit' is tested with one 'for' loop
> which iterates over [(rule1, section1), (rule2, section2)...]

This test XFails for the wrong reason on svn://.

EXPECTED STDERR (regexp):
svn: E175013: Unable to connect to a repository at URL
'svn://localhost/svn-test-work/repositories/authz_tests-20/A/mu'
svn: E175013: Access to '/svn-test-work\repositories\authz_tests-20/A/mu'
forbidden
svn: E175009: XML parsing failed: (403 Forbidden)
ACTUAL STDERR:
..\..\..\subversion\svn\cat-cmd.c:81: (apr_err=170001)
..\..\..\subversion\svn\util.c:967: (apr_err=170001)
..\..\..\subversion\libsvn_client\cat.c:233: (apr_err=170001)
..\..\..\subversion\libsvn_ra_svn\client.c:1557: (apr_err=170001)
..\..\..\subversion\libsvn_ra_svn\client.c:242: (apr_err=170001)
..\..\..\subversion\svnserve\serve.c:174: (apr_err=170001)
svn: E170001: Authorization failed
EXCEPTION: SVNUnmatchedError

See http://subversion.apache.org/buildbot/ or more specifically
http://ci.apache.org/builders/svn-slik-w2k3-x64-ra/builds/1675/steps/Test%20
fsfs%2Bsvn/logs/testlog

	Bert


RE: [PATCH] New XFail test for issue 3781

Posted by Kamesh Jayachandran <ka...@collab.net>.
Thanks Prabhu.

I committed with the following tweaks in r1068411.

1. Added @XFail(), @Issue(3781) decorators
2.

+  # test the case-sensitivity of the repo name
+  write_authz_file(sbox, {},
+                   sections = {mixed_case_repo_dir + ":/": "jrandom = r",
+                               mixed_case_repo_dir + ":/A": "jrandom = r",
+                               sbox.repo_dir + ":/A/mu": "jrandom =",
+                               mixed_case_repo_dir + ":/A/mu": "jrandom = rw"})

Replaced this snippet by the following snippet. 
+  # test the case-sensitivity of the repo name
+  sec_mixed_case = {mixed_case_repo_dir + ":/": "jrandom = r",
+                    mixed_case_repo_dir + ":/A": "jrandom = r",
+                    os.path.basename(sbox.repo_dir) + ":/A/mu": "jrandom =",
+                    mixed_case_repo_dir + ":/A/mu": "jrandom = rw"}
+  write_authz_file(sbox, {}, sec_mixed_case)


You can reduce this to simpler one as most of the time same 'cat' and 'commit' is tested with one 'for' loop
which iterates over [(rule1, section1), (rule2, section2)...]



With regards
Kamesh Jayachandran
-----Original Message-----
From: Prabhu Gnana Sundar Ponnarasu
Sent: Tue 2/8/2011 6:23 PM
To: Kamesh Jayachandran
Cc: dev@subversion.apache.org
Subject: Re: [PATCH] New XFail test for issue 3781
 

Hi,

Sorry for posting an older patch. Now attached the correct patch.
Please share your views.


Thanks and regards
Prabhu

On Tuesday 08 February 2011 04:41 PM, Kamesh Jayachandran wrote:
>
> Prabhu,
>
>
> Please send the patch against the current HEAD.
>
> With regards
> Kamesh Jayachandran
>



Re: [PATCH] New XFail test for issue 3781

Posted by Prabhu Gnana Sundar <pr...@collab.net>.
Hi,

Sorry for posting an older patch. Now attached the correct patch.
Please share your views.


Thanks and regards
Prabhu

On Tuesday 08 February 2011 04:41 PM, Kamesh Jayachandran wrote:
>
> Prabhu,
>
>
> Please send the patch against the current HEAD.
>
> With regards
> Kamesh Jayachandran
>


RE: [PATCH] New XFail test for issue 3781

Posted by Kamesh Jayachandran <ka...@collab.net>.
Prabhu,


Please send the patch against the current HEAD.

With regards
Kamesh Jayachandran

-----Original Message-----
From: Prabhu Gnana Sundar Ponnarasu
Sent: Tue 2/8/2011 1:11 PM
To: Kamesh Jayachandran
Cc: dev@subversion.apache.org
Subject: [PATCH] New XFail test for issue 3781
 
Hi Kamesh,

I have created a new thread in order to prevent the confusion about the 
test case. I have tweaked the test case as you mentioned in the previous 
thread.

Here is the link for the same...
http://mail-archives.apache.org/mod_mbox/subversion-dev/201102.mbox/%3C0213965108DEAD48960CE83455E07DFF0192BE04@maa-exchmb.maa.corp.collab.net%3E
Thank you for your valuable suggestions.

I hope this test case would make things a bit more clear.
I have attached the patch and the log message with this mail. Please 
share your views.



Thanks and regards
Prabhu


[PATCH] New XFail test for issue 3781

Posted by Prabhu Gnana Sundar <pr...@collab.net>.
Hi Kamesh,

I have created a new thread in order to prevent the confusion about the 
test case. I have tweaked the test case as you mentioned in the previous 
thread.

Here is the link for the same...
http://mail-archives.apache.org/mod_mbox/subversion-dev/201102.mbox/%3C0213965108DEAD48960CE83455E07DFF0192BE04@maa-exchmb.maa.corp.collab.net%3E
Thank you for your valuable suggestions.

I hope this test case would make things a bit more clear.
I have attached the patch and the log message with this mail. Please 
share your views.



Thanks and regards
Prabhu

RE: [PATCH] New XFail test for the issue 3781

Posted by Kamesh Jayachandran <ka...@collab.net>.
Hi Prabhu,

My review comment about your patch.

I guess you test the following case sensitiveness,

* section name case sensitivity
* path only case sensitivity
* case sensitivity for read 
* case sensitivity for write.

If I represent it as Matrix,
      Section    Path
read  case1      case3
write case2      case4

You have the above covered in your patch partially.

Your test for read is not correct, I mean you are not testing the expectation by tweaking the permissions.
I mean 
You have {"/": "jrandom = r", "/A": "jrandom = r", "/a/Mu": "jrandom = rw"} which grants read access to /A/mu.

Already this case works in HEAD and continue to work after the real case sensitivity fix. So make it something like this.

rule = {"/": "jrandom = r", "/A/mu": "jrandom = ", "/a/Mu": "jrandom = rw"} and try 'read' on /A/mu which should fail with case sensitivity fix but succeed in HEAD.

Name your testcase with what it intends to test. i.e case_insensitive_authz makes me get confused.

May be you can name it case_sensitive_authz

Thanks
With regards
Kamesh Jayachandran

-----Original Message-----
From: Prabhu Gnana Sundar [mailto:prabhugs@collab.net]
Sent: Fri 2/4/2011 1:04 PM
To: Daniel Shahaf
Cc: dev@subversion.apache.org
Subject: Re: [PATCH] New XFail test for the issue 3781
 
Hi Daniel,

Thank you for the comments... :)

On Friday 04 February 2011 08:12 AM, Daniel Shahaf wrote:
> Prabhu Gnana Sundar wrote on Thu, Feb 03, 2011 at 16:53:54 +0530:
>> Hi all,
>>
>> Currently, as per the issue 3781, "checkout" reads the authz file in
>> *case insensitive* way, whereas "commit" reads the authz file in *case
>> sensitive* way.
>>
>> Here is what is observed:
>> 1. Checkout is *case insensitive* about the repository name section and
>> also the path-inside-repo section.
>> 2. Commit is *case sensitive* about the repository name section *but
>> case insensitive* about the path-inside-repo section.
>>
>> Attached an XFail testcase and the log message with this mail. Please
>> share your views.
>>
>>
> You didn't actually say what the intended behaviour is.
>

The intended behaviour is path based authorization should be case 
sensitive for all cases.
But it shows some inconsistencies currently...

It has been discussed in ,

http://mail-archives.apache.org/mod_mbox/subversion-dev/201101.mbox/%3C4D468561.3070807@collab.net%3E

>> Index: subversion/tests/cmdline/authz_tests.py
>> ===================================================================
>> --- subversion/tests/cmdline/authz_tests.py	(revision 1066732)
>> +++ subversion/tests/cmdline/authz_tests.py	(working copy)
>> @@ -1061,6 +1061,67 @@
>>                                        [], 'ls', '-R',
>>                                        sbox.repo_url)
>>
>> +
>> +def case_insensitive_authz(sbox):
>> +  "authz issue #3781, check case insensitiveness"
>> +
>> +  sbox.build()
>> +
>> +  # test the case-insensitivity of the path inside the repo
>> +  write_authz_file(sbox, {"/": "jrandom = r", "/A": "jrandom = r", "/a/Mu": "jrandom = rw"})
>> +
>> +  write_restrictive_svnserve_conf(sbox.repo_dir)
>> +
>> +  wc_dir = sbox.wc_dir
>> +
>> +  mu_path = os.path.join(wc_dir, 'A', 'mu')
>> +  mu_url = sbox.repo_url + '/A/mu'
>> +  svntest.main.file_append(mu_path, "hi")
>> +
>> +  # Create expected output tree.
>> +  expected_output = svntest.wc.State(wc_dir, {
>> +    'A/mu' : Item(verb='Sending'),
>> +    })
>> +
>> +  # Commit the file.
>> +  svntest.actions.run_and_verify_commit(wc_dir,
>> +                                        expected_output,
>> +                                        None,
>> +                                        None,
>> +                                        mu_path)
> Hold on.  Why does this work?  You commit /A/mu and the authz file gives
> you only 'r' access to /A!
>
It works because we have set 'rw' for the /a/Mu file.
And this must fail actually, because of the case-change in the path. 
Tweaked the test-case.
>> +  mixed_case_repo_dir = mixcases(os.path.basename(sbox.repo_dir))
>> +
>> +  # test the case-insensitivity of the repo name
>> +  write_authz_file(sbox, {}, sections = {mixed_case_repo_dir + ":/": "jrandom = r",
>> +                                         mixed_case_repo_dir + ":/A": "jrandom = r",
>> +                                         mixed_case_repo_dir + ":/A/mu": "jrandom = rw"})
>> +
> Just for clarity, could you add sections for the correct-case repository
> name to the authz file?
>
Sure :) added for clarity...
>> +  svntest.main.file_append(mu_path, "hi")
>> +  # Commit the file again.
>> +  svntest.actions.run_and_verify_commit(wc_dir,
>> +                                        expected_output,
>> +                                        None,
>> +                                        None,
>> +                                        mu_path)
>> +  svntest.actions.run_and_verify_svn2('No error',
>> +                                      svntest.verify.AnyOutput, [],
>> +                                      0, 'cat', mu_url)
> Could you have here both a commit that fails and a commit that succeeds?
Added :)


I have attached the tweaked correct patch and the log message with this 
mail. Please share your views.



Thanks and regards
Prabhu


Re: [PATCH] New XFail test for the issue 3781

Posted by Prabhu Gnana Sundar <pr...@collab.net>.
Hi Daniel,

Thank you for the comments... :)

On Friday 04 February 2011 08:12 AM, Daniel Shahaf wrote:
> Prabhu Gnana Sundar wrote on Thu, Feb 03, 2011 at 16:53:54 +0530:
>> Hi all,
>>
>> Currently, as per the issue 3781, "checkout" reads the authz file in
>> *case insensitive* way, whereas "commit" reads the authz file in *case
>> sensitive* way.
>>
>> Here is what is observed:
>> 1. Checkout is *case insensitive* about the repository name section and
>> also the path-inside-repo section.
>> 2. Commit is *case sensitive* about the repository name section *but
>> case insensitive* about the path-inside-repo section.
>>
>> Attached an XFail testcase and the log message with this mail. Please
>> share your views.
>>
>>
> You didn't actually say what the intended behaviour is.
>

The intended behaviour is path based authorization should be case 
sensitive for all cases.
But it shows some inconsistencies currently...

It has been discussed in ,

http://mail-archives.apache.org/mod_mbox/subversion-dev/201101.mbox/%3C4D468561.3070807@collab.net%3E

>> Index: subversion/tests/cmdline/authz_tests.py
>> ===================================================================
>> --- subversion/tests/cmdline/authz_tests.py	(revision 1066732)
>> +++ subversion/tests/cmdline/authz_tests.py	(working copy)
>> @@ -1061,6 +1061,67 @@
>>                                        [], 'ls', '-R',
>>                                        sbox.repo_url)
>>
>> +
>> +def case_insensitive_authz(sbox):
>> +  "authz issue #3781, check case insensitiveness"
>> +
>> +  sbox.build()
>> +
>> +  # test the case-insensitivity of the path inside the repo
>> +  write_authz_file(sbox, {"/": "jrandom = r", "/A": "jrandom = r", "/a/Mu": "jrandom = rw"})
>> +
>> +  write_restrictive_svnserve_conf(sbox.repo_dir)
>> +
>> +  wc_dir = sbox.wc_dir
>> +
>> +  mu_path = os.path.join(wc_dir, 'A', 'mu')
>> +  mu_url = sbox.repo_url + '/A/mu'
>> +  svntest.main.file_append(mu_path, "hi")
>> +
>> +  # Create expected output tree.
>> +  expected_output = svntest.wc.State(wc_dir, {
>> +    'A/mu' : Item(verb='Sending'),
>> +    })
>> +
>> +  # Commit the file.
>> +  svntest.actions.run_and_verify_commit(wc_dir,
>> +                                        expected_output,
>> +                                        None,
>> +                                        None,
>> +                                        mu_path)
> Hold on.  Why does this work?  You commit /A/mu and the authz file gives
> you only 'r' access to /A!
>
It works because we have set 'rw' for the /a/Mu file.
And this must fail actually, because of the case-change in the path. 
Tweaked the test-case.
>> +  mixed_case_repo_dir = mixcases(os.path.basename(sbox.repo_dir))
>> +
>> +  # test the case-insensitivity of the repo name
>> +  write_authz_file(sbox, {}, sections = {mixed_case_repo_dir + ":/": "jrandom = r",
>> +                                         mixed_case_repo_dir + ":/A": "jrandom = r",
>> +                                         mixed_case_repo_dir + ":/A/mu": "jrandom = rw"})
>> +
> Just for clarity, could you add sections for the correct-case repository
> name to the authz file?
>
Sure :) added for clarity...
>> +  svntest.main.file_append(mu_path, "hi")
>> +  # Commit the file again.
>> +  svntest.actions.run_and_verify_commit(wc_dir,
>> +                                        expected_output,
>> +                                        None,
>> +                                        None,
>> +                                        mu_path)
>> +  svntest.actions.run_and_verify_svn2('No error',
>> +                                      svntest.verify.AnyOutput, [],
>> +                                      0, 'cat', mu_url)
> Could you have here both a commit that fails and a commit that succeeds?
Added :)


I have attached the tweaked correct patch and the log message with this 
mail. Please share your views.



Thanks and regards
Prabhu

Re: [PATCH] New XFail test for the issue 3781

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Prabhu Gnana Sundar wrote on Thu, Feb 03, 2011 at 16:53:54 +0530:
> Hi all,
>
> Currently, as per the issue 3781, "checkout" reads the authz file in  
> *case insensitive* way, whereas "commit" reads the authz file in *case  
> sensitive* way.
>
> Here is what is observed:
> 1. Checkout is *case insensitive* about the repository name section and  
> also the path-inside-repo section.
> 2. Commit is *case sensitive* about the repository name section *but  
> case insensitive* about the path-inside-repo section.
>
> Attached an XFail testcase and the log message with this mail. Please  
> share your views.
>
>

You didn't actually say what the intended behaviour is.

> [[[
> XFail testcase for the issue 3781

Thanks for writing the XFail test first.

> Index: subversion/tests/cmdline/authz_tests.py
> ===================================================================
> --- subversion/tests/cmdline/authz_tests.py	(revision 1066732)
> +++ subversion/tests/cmdline/authz_tests.py	(working copy)
> @@ -1061,6 +1061,67 @@
>                                       [], 'ls', '-R',
>                                       sbox.repo_url)
>  
> +
> +def case_insensitive_authz(sbox):
> +  "authz issue #3781, check case insensitiveness"
> +
> +  sbox.build()
> +
> +  # test the case-insensitivity of the path inside the repo
> +  write_authz_file(sbox, {"/": "jrandom = r", "/A": "jrandom = r", "/a/Mu": "jrandom = rw"})
> +
> +  write_restrictive_svnserve_conf(sbox.repo_dir)
> +
> +  wc_dir = sbox.wc_dir
> +
> +  mu_path = os.path.join(wc_dir, 'A', 'mu')
> +  mu_url = sbox.repo_url + '/A/mu'
> +  svntest.main.file_append(mu_path, "hi")
> +
> +  # Create expected output tree.
> +  expected_output = svntest.wc.State(wc_dir, {
> +    'A/mu' : Item(verb='Sending'),
> +    })
> +
> +  # Commit the file.
> +  svntest.actions.run_and_verify_commit(wc_dir,
> +                                        expected_output,
> +                                        None,
> +                                        None,
> +                                        mu_path)

Hold on.  Why does this work?  You commit /A/mu and the authz file gives
you only 'r' access to /A!

> +  svntest.actions.run_and_verify_svn2('No error',
> +                                      svntest.verify.AnyOutput, [],
> +                                      0, 'cat', mu_url)
> +
> +  def mixcases(repo_name):
> +    mixed_repo_name = ''
> +    for i in range(0, len(repo_name)):
> +      if i % 2 == 0:
> +        mixed_val = repo_name[i].upper()
> +        mixed_repo_name = mixed_repo_name + mixed_val
> +      else:
> +        mixed_val = repo_name[i].lower()
> +        mixed_repo_name = mixed_repo_name + mixed_val
> +    return mixed_repo_name 
> +

Nice, but why not just pass NAME to sbox.build() and then hard-code
'bar' and 'baR' in the test?

> +  mixed_case_repo_dir = mixcases(os.path.basename(sbox.repo_dir))
> +
> +  # test the case-insensitivity of the repo name
> +  write_authz_file(sbox, {}, sections = {mixed_case_repo_dir + ":/": "jrandom = r",
> +                                         mixed_case_repo_dir + ":/A": "jrandom = r",
> +                                         mixed_case_repo_dir + ":/A/mu": "jrandom = rw"})
> +

Just for clarity, could you add sections for the correct-case repository
name to the authz file?

> +  svntest.main.file_append(mu_path, "hi")
> +  # Commit the file again.
> +  svntest.actions.run_and_verify_commit(wc_dir,
> +                                        expected_output,
> +                                        None,
> +                                        None,
> +                                        mu_path)
> +  svntest.actions.run_and_verify_svn2('No error',
> +                                      svntest.verify.AnyOutput, [],
> +                                      0, 'cat', mu_url) 

Could you have here both a commit that fails and a commit that succeeds?