Merge ~smoser/cloud-init:fix/ci-allow-deb-older-than-distro into cloud-init:master

Proposed by Scott Moser on 2017-11-21
Status: Merged
Merged at revision: 9ac735bb8c0dec5628a33d907adb3fc02fd902e8
Proposed branch: ~smoser/cloud-init:fix/ci-allow-deb-older-than-distro
Merge into: cloud-init:master
Diff against target: 17 lines (+3/-3)
1 file modified
tests/cloud_tests/setup_image.py (+3/-3)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve on 2017-11-21
Joshua Powers (community) Approve on 2017-11-21
cloud-init commiters 2017-11-21 Pending
Review via email: mp+334074@code.launchpad.net

Commit Message

tests: Use apt-get to install a deb so that depends get resolved.

Instead of using 'dpkg -i' to install a package and then running
apt-get -f install, to hope that it would install needed dependencies
we can just use 'apt-get' directly to do the install.

The 'dpkg/apt-get -f' path was a problem if the installed deb was
older than the available deb. In that case it would get replaced.

Description of the Change

https://jenkins.ubuntu.com/server/job/cloud-init-ci/531/console
failed because of this (see failure log below).

The reason is that the submitter's branch was older than xenial had a package for. c-i installed the package with 'dpkg -i'. it failed because of the missing json-schema dependency (expected), and then tried to resolve the situation with 'apt-get -f install'.

the apt-get -f install saw there was a newer ubuntu package and just installed that.

this keeps us using the deb that we were expecting to use.

2017-11-21 18:00:31,303 - tests.cloud_tests - INFO - acquiring image for os: xenial
2017-11-21 18:00:31,345 - tests.cloud_tests - DEBUG - updating args for setup with: None
2017-11-21 18:00:31,345 - tests.cloud_tests - INFO - setting up ubuntu-xenial
2017-11-21 18:00:31,397 - tests.cloud_tests - DEBUG - install deb: "cloud-init_17.1-22-g79b3c9e7-1~bddeb_all.deb" into target
2017-11-21 18:00:56,366 - tests.cloud_tests - ERROR - stage part: setup func for --deb, install deb encountered error: install deb version "17.1-27-geb292c18-0ubuntu1~16.04.1" does not match expected "17.1-22-g79b3c9e7-1~bddeb"
2017-11-21 18:00:56,367 - tests.cloud_tests - ERROR - traceback:
  File "/var/lib/jenkins/slaves/torkoal/workspace/cloud-init-ci/tests/cloud_tests/stage.py", line 47, in run_single
    call()
  File "/var/lib/jenkins/slaves/torkoal/workspace/cloud-init-ci/tests/cloud_tests/setup_image.py", line 63, in install_deb
    .format(found_version, expected_version))

2017-11-21 18:00:56,511 - tests.cloud_tests - DEBUG - after setup complete, installed cloud-init version is: 17.1-27-geb292c18-0ubuntu1~16.04.1

To post a comment you must log in.
Joshua Powers (powersj) :
review: Approve

FAILED: Continuous integration, rev:8114424973f96ce2fbaaa81f224ed7e25d3cd923
https://jenkins.ubuntu.com/server/job/cloud-init-ci/535/
Executed test runs:
    SUCCESS: Checkout
    FAILED: Unit & Style Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/535/rebuild

review: Needs Fixing (continuous-integration)

FAILED: Continuous integration, rev:352ff0776f0c6172c901096f8f0e0dc81e9ba15b
https://jenkins.ubuntu.com/server/job/cloud-init-ci/536/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    FAILED: Ubuntu LTS: Integration

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/536/rebuild

review: Needs Fixing (continuous-integration)

PASSED: Continuous integration, rev:9ac735bb8c0dec5628a33d907adb3fc02fd902e8
https://jenkins.ubuntu.com/server/job/cloud-init-ci/537/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/537/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/cloud_tests/setup_image.py b/tests/cloud_tests/setup_image.py
2index 6672ffb..179f40d 100644
3--- a/tests/cloud_tests/setup_image.py
4+++ b/tests/cloud_tests/setup_image.py
5@@ -50,9 +50,9 @@ def install_deb(args, image):
6 LOG.debug(msg)
7 remote_path = os.path.join('/tmp', os.path.basename(args.deb))
8 image.push_file(args.deb, remote_path)
9- cmd = 'dpkg -i {}; apt-get install --yes -f'.format(remote_path)
10- image.execute(cmd, description=msg)
11-
12+ image.execute(
13+ ['apt-get', 'install', '--allow-downgrades', '--assume-yes',
14+ remote_path], description=msg)
15 # check installed deb version matches package
16 fmt = ['-W', "--showformat=${Version}"]
17 (out, err, exit) = image.execute(['dpkg-deb'] + fmt + [remote_path])

Subscribers

People subscribed via source and target branches

to all changes: