summaryrefslogtreecommitdiff
path: root/tests/cloud_tests
diff options
context:
space:
mode:
authorJoshua Powers <josh.powers@canonical.com>2017-07-28 13:24:37 -0700
committerScott Moser <smoser@brickies.net>2017-08-01 12:38:33 -0400
commit9d0fdf1c6d39f8b6ff0f9e0172318bece56fed06 (patch)
treea972194fef7c6c431da3d1ad328d60f46e9b371e /tests/cloud_tests
parent56103567fbf486625cdf5bfe40eea5ddcb7e8e04 (diff)
downloadvyos-cloud-init-9d0fdf1c6d39f8b6ff0f9e0172318bece56fed06.tar.gz
vyos-cloud-init-9d0fdf1c6d39f8b6ff0f9e0172318bece56fed06.zip
tests: Fix build tree integration tests
The build deb command was no longer working becasue it had assumed that you were in the root of the cloud-init directory. This changes where the deb is built and changes how the dependencies are determined as well as uses the built-in tools for determining build dependencies.
Diffstat (limited to 'tests/cloud_tests')
-rw-r--r--tests/cloud_tests/bddeb.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/cloud_tests/bddeb.py b/tests/cloud_tests/bddeb.py
index 53dbf74e..fe805356 100644
--- a/tests/cloud_tests/bddeb.py
+++ b/tests/cloud_tests/bddeb.py
@@ -11,7 +11,7 @@ from tests.cloud_tests import (config, LOG)
from tests.cloud_tests import (platforms, images, snapshots, instances)
from tests.cloud_tests.stage import (PlatformComponent, run_stage, run_single)
-build_deps = ['devscripts', 'equivs', 'git', 'tar']
+pre_reqs = ['devscripts', 'equivs', 'git', 'tar']
def _out(cmd_res):
@@ -26,13 +26,10 @@ def build_deb(args, instance):
@return_value: tuple of results and fail count
"""
# update remote system package list and install build deps
- LOG.debug('installing build deps')
- pkgs = ' '.join(build_deps)
+ LOG.debug('installing pre-reqs')
+ pkgs = ' '.join(pre_reqs)
cmd = 'apt-get update && apt-get install --yes {}'.format(pkgs)
instance.execute(['/bin/sh', '-c', cmd])
- # TODO Remove this call once we have a ci-deps Makefile target
- instance.execute(['mk-build-deps', '--install', '-t',
- 'apt-get --no-install-recommends --yes', 'cloud-init'])
# local tmpfile that must be deleted
local_tarball = tempfile.NamedTemporaryFile().name
@@ -40,7 +37,7 @@ def build_deb(args, instance):
# paths to use in remote system
output_link = '/root/cloud-init_all.deb'
remote_tarball = _out(instance.execute(['mktemp']))
- extract_dir = _out(instance.execute(['mktemp', '--directory']))
+ extract_dir = '/root'
bddeb_path = os.path.join(extract_dir, 'packages', 'bddeb')
git_env = {'GIT_DIR': os.path.join(extract_dir, '.git'),
'GIT_WORK_TREE': extract_dir}
@@ -56,6 +53,11 @@ def build_deb(args, instance):
instance.execute(['git', 'commit', '-a', '-m', 'tmp', '--allow-empty'],
env=git_env)
+ LOG.debug('installing deps')
+ deps_path = os.path.join(extract_dir, 'tools', 'read-dependencies')
+ instance.execute([deps_path, '--install', '--test-distro',
+ '--distro', 'ubuntu', '--python-version', '3'])
+
LOG.debug('building deb in remote system at: %s', output_link)
bddeb_args = args.bddeb_args.split() if args.bddeb_args else []
instance.execute([bddeb_path, '-d'] + bddeb_args, env=git_env)