autopkgtest autopkgtest fails on xenial when run under autopkgtest

Bug #1686082 reported by Dimitri John Ledkov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
autopkgtest (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Iain Lane

Bug Description

[ Description ]

autopkgtest's own autopkgtests are failing in xenial. The environment now exports $ADT_NORMAL_USER into the tests, and one of the tests checks that this is not set. Commit cbac10742cc44d66c82ee9776157273a5cce7a59 cleans it out of the test in question's environment.

[ Fix ]

Cherry pick that commit.

[ QA ]

This is a testsuite fix. Check that the package builds and that the autopkgtests pass.

[ Regression potential ]

It's a test fix only. If it's bad then the test won't be fixed. If the test fix itself is wrong then we could be allowing a regression to pass through. But this fix is in subsequent releases.

[ Development fix ]

The commit is in ≥ yakkety.

[ Original description ]

======================================================================
FAIL: test_setup_commands_string (__main__.ChrootRunner)
--setup-commands with command string
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest.4F1JtS/build.knp/autopkgtest-3.20.4/tests/adt-run", line 1628, in test_setup_commands_string
    self.assertEqual(code, 0, err)
AssertionError: 16 != 0 : adt-run [12:25:30]: version @version@
adt-run [12:25:30]: host autopkgtest-lxd-muplzd; command line: /tmp/autopkgtest.4F1JtS/build.knp/autopkgtest-3.20.4/runner/adt-run -B --unbuilt-tree=/tmp/test.adt-run.4aqx12ew/testpkg --setup-commands '[ -z $ADT_NORMAL_USER ];sleep 3; cp /bin/cp /bin/cp_cp; echo setup_success > /setup.log' --setup-commands 'cp /bin/cp /bin/cp_cp' --timeout-short=1 --timeout-copy=1 --- chroot /tmp/test.adt-run.4aqx12ew/chroot
adt-run [12:25:31]: @@@@@@@@@@@@@@@@@@@@ test bed setup
adt-run [12:25:31]: ERROR: testbed failure: testbed setup commands failed with status 1

----------------------------------------------------------------------
Ran 211 tests in 189.417s

FAILED (failures=1, skipped=141)
autopkgtest [13:28:08]: test adt-run: -----------------------]
autopkgtest [13:28:08]: test adt-run: - - - - - - - - - - results - - - - - - - - - -
adt-run FAIL non-zero exit status 1
autopkgtest [13:28:09]: - - - - - - - - - - running shell - - - - - - - - - -
root@autopkgtest-lxd-muplzd:/tmp/autopkgtest.4F1JtS/build.knp/autopkgtest-3.20.4# ./tests/adt-run ChrootRunner.test_setup_commands_string
test_setup_commands_string (__main__.ChrootRunner)
--setup-commands with command string ... ok

----------------------------------------------------------------------
Ran 1 test in 4.185s

OK
root@autopkgtest-lxd-muplzd:/tmp/autopkgtest.4F1JtS/build.knp/autopkgtest-3.20.4#

This is happening on xenial and prevents smooth SRU landings.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in autopkgtest (Ubuntu):
status: New → Confirmed
Revision history for this message
Iain Lane (laney) wrote :

This fixes it, going to upload.

commit cbac10742cc44d66c82ee9776157273a5cce7a59
Author: Martin Pitt <email address hidden>
Date: Tue May 31 23:42:47 2016 +0200

    Fix ChrootRunner.test_setup_commands_string when ran recursively

    Commit a94e5ac42 exported $ADT_NORMAL_USER to tests. So remove it from the
    environment for the this test as it otherwise breaks it when we run our own
    tests through autopkgtest.

diff --git a/tests/adt-run b/tests/adt-run
index fc7e7c0..1f870a0 100755
--- a/tests/adt-run
+++ b/tests/adt-run
@@ -1638,13 +1638,19 @@ Restrictions: needs-root
         p = self.build_src('Tests: pass\nDepends:\nRestrictions: needs-root\n',
                            {'pass': '#!/bin/sh -e\n[ -x /bin/cp_cp ]; cat /setup.log\n'})

- # not expecting a normal user for chroot
+ # not expecting a normal user for chroot; but filter out any
+ # $ADT_NORMAL_USER from *our* environment
+ env = os.environ.copy()
+ try:
+ del env['ADT_NORMAL_USER']
+ except KeyError:
+ pass
         (code, out, err) = self.runtest(['-B', '--unbuilt-tree=' + p,
                                          '--setup-commands', '[ -z $ADT_NORMAL_USER ];'
                                          'sleep 3; cp /bin/cp /bin/cp_cp; '
                                          'echo setup_success > /setup.log',
                                          '--setup-commands', 'cp /bin/cp /bin/cp_cp',
- '--timeout-short=1', '--timeout-copy=1'])
+ '--timeout-short=1', '--timeout-copy=1'], env=env)
         # test should succeed
         self.assertEqual(code, 0, err)
         self.assertRegex(out, 'pass\s+PASS', out)

Changed in autopkgtest (Ubuntu):
status: Confirmed → Fix Released
Changed in autopkgtest (Ubuntu Xenial):
status: New → In Progress
assignee: nobody → Iain Lane (laney)
Revision history for this message
Iain Lane (laney) wrote :

It's there

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Dimitri, or anyone else affected,

Accepted autopkgtest into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/autopkgtest/3.20.4ubuntu1 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. 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 autopkgtest (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Change of SRU verification policy

As part of a recent change in the Stable Release Update verification policy we would like to inform that for a bug to be considered verified for a given release a verification-done-$RELEASE tag needs to be added to the bug where $RELEASE is the name of the series the package that was tested (e.g. verification-done-xenial). Please note that the global 'verification-done' tag can no longer be used for this purpose.

Thank you!

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU verification for Xenial:
I have reproduced the problem with autopkgtest 3.20.4 in xenial and have verified that the version of autopkgtest 3.20.4ubuntu1 in -proposed fixes the issue.

Marking as verification-done

tags: added: verification-done-xenial
removed: verification-needed
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for autopkgtest 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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopkgtest - 3.20.4ubuntu1

---------------
autopkgtest (3.20.4ubuntu1) xenial; urgency=medium

  * tests/adt-run: Filter out $ADT_NORMAL_USER from the chroot tests; we don't
    want this set when testing autopkgtest from within autopkgtest. Fixes a
    test failure when running our own autopkgtests. Cherry-pick of upstream
    commit cbac10742cc44d66c82ee9776157273a5cce7a59 (LP: #1686082)

 -- Iain Lane <email address hidden> Tue, 25 Apr 2017 15:13:21 +0100

Changed in autopkgtest (Ubuntu Xenial):
status: Fix Committed → Fix Released
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.