You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2006/04/26 23:15:15 UTC

[PATCH] authz for dav tests

So as part of my work on replay/update authorization I've been working
on making it possible to run the authz dependent tests over DAV.  I've
got a working patch (modulo one test that fails, which I've changed to
XFail on DAV only, which required tweaks to XFail, but anyway), but I
didn't want to just commit it because it requires tweaks to a DAV test
setup, and I didn't want to break the tests without warning.

The general approach here is to make all tests run over DAV with
mod_authz_svn installed and configured to point to an authz file in
svn-test-work.  The tests can overwrite that file if they need to
modify the authz behavior, and it'll be reverted to a virgin file
(which gives full read/write access to all users over the whole repos)
at the start of each test (actually at the creation of each sandbox,
since that's the easiest place to do it).

There are two other tweaks needed to make this sane.  First, we have
an authz test that fails over DAV, so I had to tweak XFail to allow
you to pass in a function that determines if the test is really XFail
or not.  This is different from how Skip works because to determine if
we're XFail based on an RA layer we need to wait until ARGV was
parsed, so the decision has to be delayed.  Second, for DAV tests
since we only have one authz file we need to be able to reliably
determine the name of the repositories created, so we can set up rules
that only apply to one of them (for svnsync specifically).  Currently
the names are determined via the number of the test, but that can
change if tests are moved around, which is undesireable if it's being
depended on.  Thus I added an optional parameter to Sandbox.build that
controls the name used for such things.

Anyway, I'd love some feedback on this before commit, especially from
people who run automated tests so I know they're ready to turn on
mod_authz_svn in their config.

-garrett

[[[
Turn on mod_authz_svn for tests over DAV.

* subversion/tests/cmdline/svnsync_tests.py
  (basic_authz): Pass a name to sbox.build(), and move the writing of
   the authz conf file later in the test so it doesn't get overwritten.
  (copy_from_unreadable_dir): Ditto, but also make the authz file
   conditional on the type of ra layer we're using.

* subversion/tests/cmdline/README: Mention the AUthzSVNAccessFile
  config needed for the authz tests.

* subversion/tests/cmdline/authz_tests.py
  Alias XFail.
  (skip_test_when_no_authz_available): Let http tests use authz again.
  (is_this_dav): New helper function.
  (test_list): Mark authz_open_directory as XFail on DAV.

* subversion/tests/cmdline/svntest/testcase.py
  (XFail.__init__): Add a cond parameter, don't set up _result_text here,
   stash cond for later.
  (XFail.convert_result): Set up the _result_text here, and mention why.
   Also reverse the order of the pass and fail strings, due to the fact
   that we're changing the order of the call to this function.

* subversion/tests/cmdline/svntest/main.py
  (Sandbox._set_name): Set authz_file conditionally based on ra layer.
  (Sandbox.build): Allow the user to pass in an explicit name.
  (TestRunner.run): Reverse the order fo calls to convert_result and
   run_text, to allow the XFail class to reset _result_text.
]]]

Re: [PATCH] authz for dav tests

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 4/26/06, Jani Averbach <ja...@jaa.iki.fi> wrote:
> On 2006-04-26 16:15-0700, Garrett Rooney wrote:
>
> Hello Garrett!
>
> > The general approach here is to make all tests run over DAV with
> > mod_authz_svn installed and configured to point to an authz file in
> > svn-test-work.
>
> Could you update also tools/test-scripts/svntest/mod_dav_svn.conf?
> If you don't have time, I can do that when I re-configure my system.
>
> > Anyway, I'd love some feedback on this before commit, especially from
> > people who run automated tests so I know they're ready to turn on
> > mod_authz_svn in their config.
>
> I am fine with the general concepts of your change. Thanks for asking!

Great.  Committed in r19462, along with a tweak to the test-scripts
mod_dav_svn.conf file.

Thanks,

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] authz for dav tests

Posted by Jani Averbach <ja...@jaa.iki.fi>.
On 2006-04-26 16:15-0700, Garrett Rooney wrote:

Hello Garrett!

> The general approach here is to make all tests run over DAV with
> mod_authz_svn installed and configured to point to an authz file in
> svn-test-work.

Could you update also tools/test-scripts/svntest/mod_dav_svn.conf?
If you don't have time, I can do that when I re-configure my system.

> Anyway, I'd love some feedback on this before commit, especially from
> people who run automated tests so I know they're ready to turn on
> mod_authz_svn in their config.

I am fine with the general concepts of your change. Thanks for asking!

BR, Jani

-- 
Jani Averbach

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] authz for dav tests

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 4/26/06, Julian Foad <ju...@btopenworld.com> wrote:
> Garrett Rooney wrote:
> > [[[
> > Turn on mod_authz_svn for tests over DAV.
>
> Please could the log message say why.  It's not immediately apparent why this
> is useful.  Thanks.

Will do.  For the curious, the reason is that we have several tests
that test our authz functionality, and it would be valuable to be able
to run them over DAV just like we do over ra_svn.  Currently we can't
alter the httpd.conf file during the tests to enable mod_dav_svn for
just the tests that need it, so we have to turn it on for all of them.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] authz for dav tests

Posted by Julian Foad <ju...@btopenworld.com>.
Garrett Rooney wrote:
> [[[
> Turn on mod_authz_svn for tests over DAV.

Please could the log message say why.  It's not immediately apparent why this 
is useful.  Thanks.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org