← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~powersj/cloud-init:fix-cii-tree into cloud-init:master


Joshua Powers has proposed merging ~powersj/cloud-init:fix-cii-tree into cloud-init:master.

Commit message:
tests: Fix build tree integration tests

The build deb command was no longer working because 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.

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:fix-cii-tree into cloud-init:master.
diff --git a/tests/cloud_tests/bddeb.py b/tests/cloud_tests/bddeb.py
index 53dbf74..fe80535 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'],
+    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)

Follow ups