Tests failing on xenial due to missing fakeroot command

Bug #1709029 reported by Łukasz Zemczak on 2017-08-07
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Critical
Łukasz Zemczak
ubuntu-image (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned

Bug Description

[Impact]

Currently the xenial ubuntu-image package fails autopkgtests due to the missing fakeroot dependency. Xenial has an older mkfs.ext4 that does not support a parameter that all the other series are using. Because of that, fakeroot is not really used on this release as by default the first call of mkfs.ext4 which is assuming the existence of the '-d' option is supposed to fail and then u-i is moving on to using a fallback method of copying rootfs contents into the filesystem. To the first call of the mkfs.ext4 call we have recently added fakeroot (due to a security vulnerability discovered).

The failure of calling mkfs.ext4 with an unrecognized parameter and calling fakeroot mkfs.ext4 when fakeroot is not installed both generate different errors (the first one causes run() to exit with error and the second one rises a FileNotFoundError exception). We can easily support both cases, but then we are encountering code coverage issues - as in the best case we want to have the same code for all supported series. It's not easy to mock this case in unit tests as in theory we will never be able to reach this FileNotFoundError branch on non-xenial systems. It basically requires a lot of unnecessary work that's not bringing any real merits.

[Fix]

Just dropping this part of the delta and adding the fakeroot dependency fixes all problems with little effort.

[Test Case]

Make sure that the xenial autopkgtests pass.

[Regression Potential]

None - really. We're only adding the fakeroot dependency that is installed on all the other series for the same ubuntu-image version already. Installing this dependency does not change anything in the logic of ubuntu-image - the only time it is used is for the first mkfs.ext4 command which always fails (due to being too old to support the required options).

[Original description]

There is a delta in xenial. We need to support missing fakeroot.

Changed in ubuntu-image:
importance: Undecided → Critical
assignee: nobody → Łukasz Zemczak (sil2100)
status: New → In Progress
Łukasz Zemczak (sil2100) wrote :

I would really opt for removing the xenial delta and introducing fakeroot as a dependency. Yes, it's not really used by ubuntu-image, but the way it is right now it *is* required - the code executes the command. This would make things much easier instead of just writing code and dealing with multiple stupid coverage edge-cases.

Changed in ubuntu-image:
milestone: none → 1.2

On Mon, Aug 07, 2017 at 10:20:45AM -0000, Łukasz Zemczak wrote:
> I would really opt for removing the xenial delta and introducing
> fakeroot as a dependency. Yes, it's not really used by ubuntu-image, but
> the way it is right now it *is* required - the code executes the
> command. This would make things much easier instead of just writing code
> and dealing with multiple stupid coverage edge-cases.

The code should never execute this command on xenial, because xenial's
mkfs.ext4 does not support the -d option. Instead, ubuntu-image must be
running mkfs.ext4 as real root on xenial. So I think this is either a bug
in the actual code or a bug in the test, not a bug in the deps.

Steve Langasek (vorlon) wrote :

On Mon, Aug 07, 2017 at 05:33:33PM -0000, Steve Langasek wrote:
> On Mon, Aug 07, 2017 at 10:20:45AM -0000, Łukasz Zemczak wrote:
> > I would really opt for removing the xenial delta and introducing
> > fakeroot as a dependency. Yes, it's not really used by ubuntu-image, but
> > the way it is right now it *is* required - the code executes the
> > command. This would make things much easier instead of just writing code
> > and dealing with multiple stupid coverage edge-cases.

> The code should never execute this command on xenial, because xenial's
> mkfs.ext4 does not support the -d option. Instead, ubuntu-image must be
> running mkfs.ext4 as real root on xenial. So I think this is either a bug
> in the actual code or a bug in the test, not a bug in the deps.

And then I looked at the actual code and read your comments on IRC, and
understand that we're trying fakeroot mkfs.ext4 -d first, with a fallback
only as deemed necessary.

I'm somewhat attached to the idea that we shouldn't add the dep just to work
around this; but it's a lot of work (adding further test cases etc) to
handle a marginal case (users of the .deb on xenial that don't have/want to
have fakeroot installed).

Yes, please just revert the delta by adding the dep.

description: updated
Changed in ubuntu-image (Ubuntu Xenial):
status: New → In Progress
Changed in ubuntu-image (Ubuntu):
status: New → Fix Released

Hello Łukasz, or anyone else affected,

Accepted ubuntu-image into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-image/1.1+16.04ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in ubuntu-image (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
Łukasz Zemczak (sil2100) wrote :

Xenial (1.1+16.04ubuntu4) autopkgtests pass correctly with the fakeroot dependency installed.

tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-image - 1.1+16.04ubuntu4

---------------
ubuntu-image (1.1+16.04ubuntu4) xenial; urgency=medium

  * Drop part of the xenial delta, adding the fakeroot dependency as per master.
    Properly handling the lack of the dependency and still getting 100% code
    coverage on all series requires too much unnecessary work. (LP: #1709029)

ubuntu-image (1.1+16.04ubuntu3) xenial; urgency=medium

  * Only run the snap.sh test on github PRs as it doesn't make sense to run it
    as part of regular deb package migration. (LP: #1704979)

ubuntu-image (1.1+16.04ubuntu1) xenial; urgency=medium

  [ Łukasz 'sil2100' Zemczak ]
  * SRU tracking number LP: #1702933
  * Fix snapcraft.yaml for classic snappage. (LP:1673576)
  * Add a new step in the builder that generates .manifest files listing all
    snaps installed in the resulting image. (LP:1680574)
  * Further fixes to snapcraft.yaml, making sure that we only have one
    ubuntu-image version installed in the snap. (LP:1692901)
  * Move files around during snap build to have all needed libraries and python
    files in common accessible paths, install missing dependencies into the
    snap. (LP:1694982, LP:1694993)

  [ Michael Vogt ]
  * Use fakeroot when running mkfs.ext4. (LP:1702628)

  [ Steve Langasek ]
  * Add fakeroot to the snapcraft.yaml and as a test dep. (LP:1702628)

 -- Łukasz 'sil2100' Zemczak <email address hidden> Tue, 08 Aug 2017 10:44:33 +0200

Changed in ubuntu-image (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for ubuntu-image has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Other bug subscribers