diff --git a/diskimage_builder/elements/ubuntu-core/root.d/10-cache-ubuntu-image b/diskimage_builder/elements/ubuntu-core/root.d/10-cache-ubuntu-image index 9f16abfd..f3a36aba 100755 --- a/diskimage_builder/elements/ubuntu-core/root.d/10-cache-ubuntu-image +++ b/diskimage_builder/elements/ubuntu-core/root.d/10-cache-ubuntu-image @@ -23,6 +23,7 @@ release_numbers[wily]=15.10 release_numbers[xenial]=16.04 release_numbers[yakkety]=16.10 release_numbers[zesty]=17.04 +release_numbers[bionic]=18.04 numeric_release=${release_numbers[$DIB_RELEASE]} DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cdimage.ubuntu.com/ubuntu-core/releases/$numeric_release/release} diff --git a/diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball b/diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball index 41241a5b..d9e5d7bc 100755 --- a/diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball +++ b/diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball @@ -14,7 +14,11 @@ shopt -s extglob DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud-images.ubuntu.com} DIB_RELEASE=${DIB_RELEASE:-trusty} -BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz} +if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then + BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH.squashfs} +else + BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz} +fi SHA256SUMS=${SHA256SUMS:-https://${DIB_CLOUD_IMAGES##http?(s)://}/$DIB_RELEASE/current/SHA256SUMS} CACHED_FILE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE CACHED_FILE_LOCK=$DIB_LOCKFILES/$BASE_IMAGE_FILE.lock @@ -47,7 +51,11 @@ function get_ubuntu_tarball() { fi # Extract the base image (use --numeric-owner to avoid UID/GID mismatch between # image tarball and host OS e.g. when building Ubuntu image on an openSUSE host) - sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE + if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then + sudo unsquashfs -f -d $TARGET_ROOT $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE + else + sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE + fi } ( diff --git a/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/README.rst b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/README.rst new file mode 100644 index 00000000..35bdfee4 --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/README.rst @@ -0,0 +1,4 @@ +Verify we can build a ubuntu image. + +Note this test includes the vm element to test the bootloader install, +and specifies to output a .qcow2 diff --git a/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/element-deps b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/element-deps new file mode 100644 index 00000000..ccdc4107 --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/element-deps @@ -0,0 +1,4 @@ +block-device-mbr +openstack-ci-mirrors +vm + diff --git a/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 00000000..ba2fb47d --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE=bionic diff --git a/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/test-output-formats b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/test-output-formats new file mode 100644 index 00000000..c780936b --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/bionic-build-succeeds/test-output-formats @@ -0,0 +1 @@ +tar,qcow2 \ No newline at end of file diff --git a/playbooks/legacy/dib-dsvm-functests-python2-centos-7-image/run.yaml b/playbooks/legacy/dib-dsvm-functests-python2-centos-7-image/run.yaml index 30820111..63dbc451 100644 --- a/playbooks/legacy/dib-dsvm-functests-python2-centos-7-image/run.yaml +++ b/playbooks/legacy/dib-dsvm-functests-python2-centos-7-image/run.yaml @@ -67,8 +67,8 @@ opensuse/build-succeeds \ opensuse/opensuse423-build-succeeds \ fedora/build-succeeds \ - ubuntu/trusty-build-succeeds \ - ubuntu/xenial-build-succeeds + ubuntu/xenial-build-succeeds \ + ubuntu/bionic-build-succeeds set +u deactivate diff --git a/playbooks/legacy/dib-dsvm-functests-python3-image/run.yaml b/playbooks/legacy/dib-dsvm-functests-python3-image/run.yaml index 224b81ec..8ef5ee2c 100644 --- a/playbooks/legacy/dib-dsvm-functests-python3-image/run.yaml +++ b/playbooks/legacy/dib-dsvm-functests-python3-image/run.yaml @@ -67,8 +67,8 @@ opensuse/build-succeeds \ opensuse/opensuse423-build-succeeds \ fedora/build-succeeds \ - ubuntu/trusty-build-succeeds \ - ubuntu/xenial-build-succeeds + ubuntu/xenial-build-succeeds \ + ubuntu/bionic-build-succeeds set +u deactivate diff --git a/tests/run_functests.sh b/tests/run_functests.sh index 3344cf18..189845f1 100755 --- a/tests/run_functests.sh +++ b/tests/run_functests.sh @@ -44,6 +44,7 @@ DEFAULT_SKIP_TESTS=( fedora/build-succeeds ubuntu/trusty-build-succeeds ubuntu/xenial-build-succeeds + ubuntu/bionic-build-succeeds # No longer reasonable to test upstream (lacks a mirror in infra) # Note this is centos6 and should probably be removed