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.



  # 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 :)



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 :)

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');

--Geoff



Reply via email to