'needs-root' in combination with 'build-needed' unpacks code and runs build as root

Bug #1079358 reported by James Hunt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopkgtest (Ubuntu)
New
Medium
Unassigned

Bug Description

If a DEP-8 package contains a debian/tests/control file which specifies:

  Restrictions: needs-root build-needed

... autopkgtest will:

- unpack the source as the root user
- run the build as the root user

This is unnecessary and places a burden on the test script to handle this scenario since if a test drops root privileges:

- it find that the directory tree is not writeable
- autopkgtest may well end up running the tests as root. This happens for Upstart since it has a 'make check' rule and dh calls dh_auto_test by default. However, it is not valid to run the Upstart tests as root.

I believe the behaviour of autopkgtest should be modified to:

1) Unpack the source as the user the tests would be run as if 'needs-root' were not specified.
2) Run the build as the same non-privileged user.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

A simple work-around is for build-needed to set DEB_BUILD_OPTION=nocheck
And the unit-tests need to be run as autopkgtest job.

Also the root & non-root tests should be split into separate paragraphs in the autopkgtest, if that allows specifying different constraints.

Changed in autopkgtest (Ubuntu):
importance: Undecided → Medium
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.