httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Apache::Test oustanding issues
Date Wed, 30 Jul 2003 01:16:13 GMT
Geoffrey Young wrote:
> 
>>> the way I handled this was to add the following to my TEST.PL
>>>
>>>   # override root blocks
>>>   local *Apache::TestConfig::default_user = sub { return 'root' };
>>>   local *Apache::TestConfig::default_group = sub { return 'root' };
>>
>>
>>
>> why do you need to run tests as root?
> 
> 
> well, it was a web services interface, and some of the services required 
> root permission to manipulate certain backend elements.

You still have the root permissions. it's only the server that starts with 
non-root perms. why do you needed that override?

>>>   # and that nasty chown stuff
>>>   local *Apache::TestRun::adjust_t_perms = sub { 1 };
>>
>>
>>
>> root can still work with files owned by 'nobody', but of course...
> 
> 
> I forget why I did that.  I think it was to enable files added by 
> root-run tests to be removed by normal users, but I'm not sure - it was 
> something like that :)

but that's exactly what adjust_t_perms does. Otherwise normal user can't 
create/write/delete them.

>> let me repeat what the problem is:
>>
>> cd /root ; mkdir t ; chmod 0777 t ;
>> sudo -u 'nobody' perl -le 'print -r "t" && -w _ && -x _ ? "OK" :
"NOK"'
>>
>> if you can make it return 'OK', than the problem is solved.
> 
> 
> yeah, ok, I get it now.
> 
> well, perhaps the /tmp copy isn't so bad (I misread it :)

I shouldn't have mentioned this idea, so may be someone will have a better one ;)

> the issue that we will have, though, is for people whose tests need to 
> get back to the base directory, ../.  so, I'd also suggest some function 
> or package global that can be used in place of ../, making
> 
> my $lib = catfile($Apache::Test::basedir, 'lib');
> 
> equivalent to (from t/)
> 
> my $lib= catfile('../', 'lib');
> 
> and
> 
> my $lib = catfile('/src/Apache-Foo', 'lib');

I don't think we need to chdir to /tmp, I think all we need is to tell Apache 
that DocRoot is /tmp/whatever/t. you still run from the normal dir. Or are you 
saying that you want the DocRoot to be the original t/?



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message