Re: [PATCH 0/3] nfs-utils: add testing infrastructure to nfs-utils (try #3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 8 Jan 2010 00:05:56 -0500
"J. Bruce Fields" <bfields@xxxxxxxxxxxx> wrote:

> > 
> > The root privs problem is definitely a valid concern.
> > 
> > After thinking about this problem I think the thing to do is
> > probably to create a "run as root" script that starts up statd (for
> > now) and other daemons (eventually). make check can then prompt the
> > user to inspect and run that script as root and then hit return when
> > it's ok to proceed.
> > 
> > That should allow someone to run most of the actual test code as an
> > unprivileged user. I'll plan to incorporate something like this in the
> > next respin.
> 
> That sounds complicated.  And, as I said above, we might some day like
> to include tests where the privileged stuff makes up the body of the
> test.
> 
> Why not just "the tests you are about to run need root privileges, and
> will start and stop statd; continue (y/n)?"
> 

It turns out that this is a little tricky to do within "make check".
The tests are all run as individual scripts, so it's not
straightforward to have one do this check and force all of the others
to exit.

It also seems like a useless question. If we have root privileges,
there's no point in asking. If we don't have them, we just have to exit
anyway. I don't see any point in prompting...

What I can do fairly easily is add a check to the individual test that
makes sure the euid is 0, and then exits with a "skip this test" error
code if it's not. After some consideration, I like that better anyway
since it will make it possible to run a subset of the tests as an
unprivileged user.

I'll post a new set with this change in a bit...

Cheers,
-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux