certain upstart tests should be run as root (or via fakeroot)

Bug #1085836 reported by James Hunt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart
New
Undecided
Unassigned

Bug Description

Currently, the upstart unit/feature tests ('make check') are expected to run as a non-root user. For most tests, this is perfectly acceptable.

However, there are some test scenarios which really do need root privileges. A good example being a test for a new JobProcessErrorType. If the new type relates to a system call that only root can legitimately make, it cannot currently be tested. This is an exposure.

The plan is this:

(1) Display an informational message as part of the 'make check' run showing the user who is running the tests.

(2) Create a new test program called 'init/tests/test_root.c' which contains all tests required to be run as the super-user. To stay in keeping with the current build methodology, this test will NOT be automatically run unless the user running the tests is root). If the user running the tests is not root, a warning message should be displayed stating something like:

    WARNING: test 'test_root' skipped as requires root privileges.

Note that we may be able to use fakeroot(1) to run 'test_root' but this needs further investigation.

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1085836] [NEW] certain upstart tests should be run as root (or via fakeroot)

On Mon, Dec 03, 2012 at 09:22:54AM -0000, James Hunt wrote:
> Note that we may be able to use fakeroot(1) to run 'test_root' but this
> needs further investigation.

You should not rely on fakeroot to wrap arbitrary syscalls. It generally
only handles those calls that are needed to be able to build arbitrary
tarballs.

Cf. http://bugs.debian.org/693580.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.