From 7b6247554eaecb22d95e626f44452350cc69645b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 3 May 2022 15:53:34 -0700 Subject: [PATCH] Add Jammy functesting to dib This adds arm64 ubuntu-minimal Jammy functests and x86 ubuntu image based Jammy functests. To make this happen we have to install debootstrap from debian unstable on the functest nodes in order to get access to a debootstrap that knows what jammy is. As we ramp up Jammy support in our tools having good testing will be helpful. Change-Id: I1d1dc752ce176457d0656cbd50e27a2721ca9856 --- .zuul.d/jobs.yaml | 2 ++ bindep.txt | 1 + .../jammy-arm64-build-succeeds/README.rst | 4 ++++ .../jammy-arm64-build-succeeds/element-deps | 3 +++ .../environment.d/10-set-distro.bash | 1 + .../jammy-arm64-build-succeeds/test-output-formats | 1 + .../test-elements/jammy-build-succeeds/README.rst | 4 ++++ .../test-elements/jammy-build-succeeds/element-deps | 4 ++++ .../environment.d/10-set-distro.bash | 1 + .../jammy-build-succeeds/test-output-formats | 1 + playbooks/dib-functests/run.yaml | 1 + roles/dib-ensure-debootstrap/README.rst | 2 ++ roles/dib-ensure-debootstrap/tasks/main.yaml | 12 ++++++++++++ 13 files changed, 37 insertions(+) create mode 100644 diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/README.rst create mode 100644 diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/element-deps create mode 100644 diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/10-set-distro.bash create mode 100644 diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/test-output-formats create mode 100644 diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/README.rst create mode 100644 diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/element-deps create mode 100644 diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash create mode 100644 diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-output-formats create mode 100644 roles/dib-ensure-debootstrap/README.rst create mode 100644 roles/dib-ensure-debootstrap/tasks/main.yaml diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index 55bd7b03..f6391be9 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -29,6 +29,7 @@ - fedora/build-succeeds - ubuntu/bionic-build-succeeds - ubuntu/focal-build-succeeds + - ubuntu/jammy-build-succeeds # NOTE(ianw) : these jobs are split to keep the build times a bit more # reasonable. @@ -42,6 +43,7 @@ dib_functests: - ubuntu-minimal/bionic-arm64-build-succeeds - ubuntu-minimal/focal-arm64-build-succeeds + - ubuntu-minimal/jammy-arm64-build-succeeds - debian-minimal/bullseye-arm64-build-succeeds - job: diff --git a/bindep.txt b/bindep.txt index b74d2f07..075d3ffb 100644 --- a/bindep.txt +++ b/bindep.txt @@ -27,6 +27,7 @@ uuid-runtime [platform:dpkg] yum-utils [platform:dpkg !platform:ubuntu-focal !platform:debian-bullseye] dnf [platform:debian-bullseye] debootstrap [platform:dpkg] +zstd [platform:dpkg] procps [platform:dpkg] # centos/fedora diff --git a/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/README.rst b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/README.rst new file mode 100644 index 00000000..624e34e4 --- /dev/null +++ b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/README.rst @@ -0,0 +1,4 @@ +Verify we can build a ubuntu-minimal 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-minimal/test-elements/jammy-arm64-build-succeeds/element-deps b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/element-deps new file mode 100644 index 00000000..99857b0c --- /dev/null +++ b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/element-deps @@ -0,0 +1,3 @@ +block-device-efi +openstack-ci-mirrors +vm diff --git a/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/10-set-distro.bash b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 00000000..da5710c6 --- /dev/null +++ b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE=jammy diff --git a/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/test-output-formats b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/test-output-formats new file mode 100644 index 00000000..c780936b --- /dev/null +++ b/diskimage_builder/elements/ubuntu-minimal/test-elements/jammy-arm64-build-succeeds/test-output-formats @@ -0,0 +1 @@ +tar,qcow2 \ No newline at end of file diff --git a/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/README.rst b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/README.rst new file mode 100644 index 00000000..35bdfee4 --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/jammy-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/jammy-build-succeeds/element-deps b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/element-deps new file mode 100644 index 00000000..ccdc4107 --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/element-deps @@ -0,0 +1,4 @@ +block-device-mbr +openstack-ci-mirrors +vm + diff --git a/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 00000000..da5710c6 --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE=jammy diff --git a/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-output-formats b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-output-formats new file mode 100644 index 00000000..c780936b --- /dev/null +++ b/diskimage_builder/elements/ubuntu/test-elements/jammy-build-succeeds/test-output-formats @@ -0,0 +1 @@ +tar,qcow2 \ No newline at end of file diff --git a/playbooks/dib-functests/run.yaml b/playbooks/dib-functests/run.yaml index 37fbe80a..05af88d4 100644 --- a/playbooks/dib-functests/run.yaml +++ b/playbooks/dib-functests/run.yaml @@ -5,5 +5,6 @@ - bindep - dib-setup-gate-mirrors - ensure-podman + - dib-ensure-debootstrap - dib-functests diff --git a/roles/dib-ensure-debootstrap/README.rst b/roles/dib-ensure-debootstrap/README.rst new file mode 100644 index 00000000..b92d280a --- /dev/null +++ b/roles/dib-ensure-debootstrap/README.rst @@ -0,0 +1,2 @@ +Update debootstap from debian unstable. This ensures debootstrap is new +enough to recognize Jammy. diff --git a/roles/dib-ensure-debootstrap/tasks/main.yaml b/roles/dib-ensure-debootstrap/tasks/main.yaml new file mode 100644 index 00000000..b0d3b33c --- /dev/null +++ b/roles/dib-ensure-debootstrap/tasks/main.yaml @@ -0,0 +1,12 @@ +- name: Install debootstrap/unstable + # This is shell because doing it with native ansible modules went nowhere + become: yes + shell: | + set -ex + echo "APT::Default-Release: 'stable';" > /etc/apt/apt.conf.d/default-release + echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list.d/unstable-debian.list + apt-get update + apt-get install -y debootstrap/unstable + # Remove the use of unstable as it seems to interfere with other tasks + rm /etc/apt/sources.list.d/unstable-debian.list + apt-get update