Merge lp:~fginther/ubuntu-test-cases/boottest-fix-install into lp:ubuntu-test-cases/touch

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
Approved revision: 402
Merged at revision: 402
Proposed branch: lp:~fginther/ubuntu-test-cases/boottest-fix-install
Merge into: lp:ubuntu-test-cases/touch
Prerequisite: lp:~fginther/ubuntu-test-cases/remove-source-package
Diff against target: 55 lines (+14/-9)
4 files modified
scripts/boottest.sh (+0/-7)
tests/boottest/debian/tests/control (+4/-2)
tests/getinstalledpkgs/debian/tests/control (+1/-0)
tests/getinstalledpkgs/debian/tests/getinstalledpkgs.template (+9/-0)
To merge this branch: bzr merge lp:~fginther/ubuntu-test-cases/boottest-fix-install
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+260858@code.launchpad.net

Commit message

Install boottest binary packages during getinstalledpkgs, removing that responsibility from the boottest dep8 test.

Description of the change

Install boottest binary packages during getinstalledpkgs, removing that responsibility from the boottest dep8 test.

By provisioning the device before the boottest dep8 test is executed, we allow it to be swapped out with a different dep8 test (or extended with other tests etc.). Also the boottest dep8 control file would never be able to install the packages, it must be explicitly scripted somewhere.

To post a comment you must log in.
401. By Francis Ginther

Remove insertion of bin_packages into the boottest control script, installation is now done earlier.

Revision history for this message
Paul Larson (pwlars) wrote :

I'm wondering if we can move away completely from using the getinstalledpkgs bit. Do we really need to do that with adt-run? It seems like overkill.

402. By Francis Ginther

Add a non-defualt dependency to the boottest dep8 control file.

Revision history for this message
Francis Ginther (fginther) wrote :

> I'm wondering if we can move away completely from using the getinstalledpkgs
> bit. Do we really need to do that with adt-run? It seems like overkill.

There is no strict reason to use getinstalledpkgs, but it does do a few things:
 - Adds the proposed pocket
 - Updates the apt-cache with the proposed content
 - Executes the smarts in getinstalledpkgs.template

Revision history for this message
Paul Larson (pwlars) wrote :

This makes sense. We could probably do something clever with xargs for the package list, but I'm not inclined to optimize this much right now. I'd much rather work towards stripping it out. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/boottest.sh'
2--- scripts/boottest.sh 2015-06-02 18:30:38 +0000
3+++ scripts/boottest.sh 2015-06-02 18:30:38 +0000
4@@ -179,13 +179,6 @@
5 RET=$?
6 set -e
7 else
8- FROM=${TESTS}/boottest/debian/tests/control.template
9- TARGET=${TESTS}/boottest/debian/tests/control
10-
11- # Inject the binary packages built previously
12- BIN_PACKAGES=$(tr '\n' ',' < ${PKG_SRC_DIR}/artifacts/needs_install.packages | sed -e s/,$//)
13- sed -e "s/{{ bin_packages }}/${BIN_PACKAGES}/" ${FROM} > ${TARGET}
14-
15 # Now execute the boot test
16 set +e
17 ${ADT_CMD} --unbuilt-tree ${TESTS}/boottest -o results ${ADT_OPTS}
18
19=== renamed file 'tests/boottest/debian/tests/control.template' => 'tests/boottest/debian/tests/control'
20--- tests/boottest/debian/tests/control.template 2015-01-28 16:24:12 +0000
21+++ tests/boottest/debian/tests/control 2015-06-02 18:30:38 +0000
22@@ -1,4 +1,6 @@
23 Tests: boottest
24-# Make adt-run install the binary packages by declaring a dep
25-Depends: {{ bin_packages }}
26+# Depends has to contain something, otherwise it defaults to the 'boottest'
27+# binary package, which does not exist. The package 'coreutils' is specified
28+# because the test uses 'ls', which comes from 'coreutils'.
29+Depends: coreutils
30 Restrictions: needs-root
31
32=== modified file 'tests/getinstalledpkgs/debian/tests/control'
33--- tests/getinstalledpkgs/debian/tests/control 2015-06-02 18:30:38 +0000
34+++ tests/getinstalledpkgs/debian/tests/control 2015-06-02 18:30:38 +0000
35@@ -1,2 +1,3 @@
36 Tests: getinstalledpkgs
37 Depends: dpkg-dev, dctrl-tools
38+Restrictions: needs-root
39
40=== modified file 'tests/getinstalledpkgs/debian/tests/getinstalledpkgs.template'
41--- tests/getinstalledpkgs/debian/tests/getinstalledpkgs.template 2015-06-02 18:30:38 +0000
42+++ tests/getinstalledpkgs/debian/tests/getinstalledpkgs.template 2015-06-02 18:30:38 +0000
43@@ -8,3 +8,12 @@
44 grep-aptavail -X -n -S -sPackage {{ source_package }} | sort | uniq > binary.packages
45 # Get the binary packages already installed
46 comm -1 -2 binary.packages installed.packages > needs_install.packages
47+
48+# Now install the set of needs_install.packages
49+# This are further pinned to proposed via the apt-get '-t' option
50+release=$(lsb_release -s -c)
51+package_list=""
52+while read package; do
53+ package_list="${package_list} ${package}"
54+done < needs_install.packages
55+apt-get install -t ${release}-proposed $package_list 2> apt-get-install.stderr

Subscribers

People subscribed via source and target branches