qemu/tests/vm/ubuntu.aarch64
John Snow 47f71f8912 tests/vm: upgrade Ubuntu 18.04 VM to 20.04
18.04 has fallen out of our support window, so move ubuntu.aarch64
forward to ubuntu 20.04, which is now our oldest supported Ubuntu
release.

Notes:

This checksum changes periodically; use a fixed point image with a known
checksum so that the image isn't re-downloaded on every single
invocation. (The checksum for the 18.04 image was already incorrect at
the time of writing.)

Just like the centos.aarch64 test, this test currently seems very
flaky when run as a TCG test.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220708153503.18864-6-jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-07-18 20:24:36 +02:00

73 lines
2.7 KiB
Python
Executable file

#!/usr/bin/env python3
#
# Ubuntu aarch64 image
#
# Copyright 2020 Linaro
#
# Authors:
# Robert Foley <robert.foley@linaro.org>
# Originally based on ubuntu.i386 Fam Zheng <famz@redhat.com>
#
# This code is licensed under the GPL version 2 or later. See
# the COPYING file in the top-level directory.
#
import sys
import basevm
import aarch64vm
import ubuntuvm
DEFAULT_CONFIG = {
'cpu' : "cortex-a57",
'machine' : "virt,gic-version=3",
'install_cmds' : "apt-get update,"\
"apt-get build-dep -y --arch-only qemu,"\
"apt-get install -y libfdt-dev pkg-config language-pack-en ninja-build",
# We increase beyond the default time since during boot
# it can take some time (many seconds) to log into the VM
# especially using softmmu.
'ssh_timeout' : 60,
}
class UbuntuAarch64VM(ubuntuvm.UbuntuVM):
name = "ubuntu.aarch64"
arch = "aarch64"
# NOTE: The Ubuntu 20.04 cloud images are periodically updated. The
# fixed image chosen below is the latest release at time of
# writing. Using a rolling latest instead would mean that the SHA
# would be incorrect at an indeterminate point in the future.
image_name = "focal-server-cloudimg-arm64.img"
image_link = "https://cloud-images.ubuntu.com/focal/20220615/" + image_name
image_sha256="95a027336e197debe88c92ff2e554598e23c409139e1e750b71b3b820b514832"
BUILD_SCRIPT = """
set -e;
cd $(mktemp -d);
sudo chmod a+r /dev/vdb;
tar --checkpoint=.10 -xf /dev/vdb;
./configure {configure_opts};
make --output-sync {target} -j{jobs} {verbose};
"""
def boot(self, img, extra_args=None):
aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64)
default_args = aarch64vm.get_pflash_args(self._tmpdir)
if extra_args:
extra_args.extend(default_args)
else:
extra_args = default_args
# We always add these performance tweaks
# because without them, we boot so slowly that we
# can time out finding the boot efi device.
if '-smp' not in extra_args and \
'-smp' not in self._config['extra_args'] and \
'-smp' not in self._args:
# Only add if not already there to give caller option to change it.
extra_args.extend(["-smp", "8"])
# We have overridden boot() since aarch64 has additional parameters.
# Call down to the base class method.
super(UbuntuAarch64VM, self).boot(img, extra_args=extra_args)
if __name__ == "__main__":
defaults = aarch64vm.get_config_defaults(UbuntuAarch64VM, DEFAULT_CONFIG)
sys.exit(basevm.main(UbuntuAarch64VM, defaults))