aboutsummaryrefslogtreecommitdiff
path: root/tests/vm/basevm.py
diff options
context:
space:
mode:
authorRobert Foley <robert.foley@linaro.org>2020-07-01 14:56:21 +0100
committerAlex Bennée <alex.bennee@linaro.org>2020-07-11 15:52:59 +0100
commit13336606a5ef9d6beeb8c0763ac0a9d11c249cac (patch)
tree56877615332375aa9471fa897348fb889f61a136 /tests/vm/basevm.py
parente56833b48bdedba89ab9f874eb8747bdaf382ff6 (diff)
tests/vm: Added a new script for ubuntu.aarch64.
ubuntu.aarch64 provides a script to create an Ubuntu 18.04 VM. Another new file is also added aarch64vm.py, which is a module with common methods used by aarch64 VMs, such as how to create the flash images. Signed-off-by: Robert Foley <robert.foley@linaro.org> Reviewed-by: Peter Puhov <peter.puhov@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20200601211421.1277-6-robert.foley@linaro.org> Message-Id: <20200701135652.1366-10-alex.bennee@linaro.org>
Diffstat (limited to 'tests/vm/basevm.py')
-rw-r--r--tests/vm/basevm.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index f3a8fbbe34..53c35fadde 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -92,6 +92,7 @@ class BaseVM(object):
self._guest = None
self._genisoimage = args.genisoimage
self._build_path = args.build_path
+ self._efi_aarch64 = args.efi_aarch64
# Allow input config to override defaults.
self._config = DEFAULT_CONFIG.copy()
if config != None:
@@ -496,6 +497,14 @@ def get_qemu_path(arch, build_path=None):
qemu_path = "qemu-system-" + arch
return qemu_path
+def get_qemu_version(qemu_path):
+ """Get the version number from the current QEMU,
+ and return the major number."""
+ output = subprocess.check_output([qemu_path, '--version'])
+ version_line = output.decode("utf-8")
+ version_num = re.split(' |\(', version_line)[3].split('.')[0]
+ return int(version_num)
+
def parse_config(config, args):
""" Parse yaml config and populate our config structure.
The yaml config allows the user to override the
@@ -573,6 +582,9 @@ def parse_args(vmcls):
parser.add_option("--config", "-c", default=None,
help="Provide config yaml for configuration. "\
"See config_example.yaml for example.")
+ parser.add_option("--efi-aarch64",
+ default="/usr/share/qemu-efi-aarch64/QEMU_EFI.fd",
+ help="Path to efi image for aarch64 VMs.")
parser.disable_interspersed_args()
return parser.parse_args()