summaryrefslogtreecommitdiff
path: root/tests/cloud_tests
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-11-21 14:23:36 -0500
committerScott Moser <smoser@brickies.net>2017-11-21 15:46:12 -0500
commit9ac735bb8c0dec5628a33d907adb3fc02fd902e8 (patch)
tree2c511b78b77057a51e7c292c94aa2368954ad5bb /tests/cloud_tests
parentbbe91cdc6917adb503b455e6860c21ea7b3f567f (diff)
downloadvyos-cloud-init-9ac735bb8c0dec5628a33d907adb3fc02fd902e8.tar.gz
vyos-cloud-init-9ac735bb8c0dec5628a33d907adb3fc02fd902e8.zip
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.
Diffstat (limited to 'tests/cloud_tests')
-rw-r--r--tests/cloud_tests/setup_image.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/cloud_tests/setup_image.py b/tests/cloud_tests/setup_image.py
index 6672ffb3..179f40db 100644
--- a/tests/cloud_tests/setup_image.py
+++ b/tests/cloud_tests/setup_image.py
@@ -50,9 +50,9 @@ def install_deb(args, image):
LOG.debug(msg)
remote_path = os.path.join('/tmp', os.path.basename(args.deb))
image.push_file(args.deb, remote_path)
- cmd = 'dpkg -i {}; apt-get install --yes -f'.format(remote_path)
- image.execute(cmd, description=msg)
-
+ image.execute(
+ ['apt-get', 'install', '--allow-downgrades', '--assume-yes',
+ remote_path], description=msg)
# check installed deb version matches package
fmt = ['-W', "--showformat=${Version}"]
(out, err, exit) = image.execute(['dpkg-deb'] + fmt + [remote_path])