qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests/vm: Add Haiku test based on their vagrant images


From: Alexander von Gluck IV
Subject: Re: [PATCH] tests/vm: Add Haiku test based on their vagrant images
Date: Sun, 06 Sep 2020 14:41:46 +0000

September 6, 2020 9:35 AM, "Alexander von Gluck IV" <kallisti5@unixzen.com> 
wrote:
> Signed-off-by: Alexander von Gluck IV <kallisti5@unixzen.com>
> ---
> tests/keys/vagrant | 27 +++++++++
> tests/keys/vagrant.pub | 1 +
> tests/vm/basevm.py | 5 +-
> tests/vm/haiku.x86_64 | 121 +++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 152 insertions(+), 2 deletions(-)
> create mode 100644 tests/keys/vagrant
> create mode 100644 tests/keys/vagrant.pub
> create mode 100755 tests/vm/haiku.x86_64
> 
> diff --git a/tests/keys/vagrant b/tests/keys/vagrant
> new file mode 100644
> index 0000000000..7d6a083909
> --- /dev/null
> +++ b/tests/keys/vagrant
> @@ -0,0 +1,27 @@
> +-----BEGIN RSA PRIVATE KEY-----
> +MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
>
> diff --git a/tests/keys/vagrant.pub b/tests/keys/vagrant.pub
> new file mode 100644
> index 0000000000..18a9c00fd5
> --- /dev/null
> +++ b/tests/keys/vagrant.pub
> @@ -0,0 +1 @@
> +ssh-rsa
> AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oX

A little background information for context. These are the Vagrant SSH keys 
which are packed with every vagrant OS image and allow OS access for 
automation.  The python vm tester knowing of these lets it leverage Vagrant OS 
images for testing without much work.



> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -44,6 +44,7 @@ DEFAULT_CONFIG = {
> 'machine' : 'pc',
> 'guest_user' : "qemu",
> 'guest_pass' : "qemupass",
> + 'root_user' : "root",
> 'root_pass' : "qemupass",
> 'ssh_key_file' : SSH_KEY_FILE,
> 'ssh_pub_key_file': SSH_PUB_KEY_FILE,
> @@ -245,13 +246,13 @@ class BaseVM(object):
> return self._ssh_do(self._config["guest_user"], cmd, False)
> 
> def ssh_root(self, *cmd):
> - return self._ssh_do("root", cmd, False)
> + return self._ssh_do(self._config["root_user"], cmd, False)
> 
> def ssh_check(self, *cmd):
> self._ssh_do(self._config["guest_user"], cmd, True)
> 
> def ssh_root_check(self, *cmd):
> - self._ssh_do("root", cmd, True)
> + self._ssh_do(self._config["root_user"], cmd, True)
> 
> def build_image(self, img):
> raise NotImplementedError


Haiku's user is UID 0, so essentially our root user isn't named root.
This adds the (optional) ability to override the root username.


> diff --git a/tests/vm/haiku.x86_64 b/tests/vm/haiku.x86_64
> new file mode 100755
> index 0000000000..9777722f51
> --- /dev/null
> +++ b/tests/vm/haiku.x86_64
> @@ -0,0 +1,121 @@
> +#!/usr/bin/env python3
> +#
> +# Haiku VM image
> +#
> +# Copyright 2020 Haiku, Inc.
> +#
> +# Authors:
> +# Alexander von Gluck IV <kallisti5@unixzen.com>
> +#
> +# This code is licensed under the GPL version 2 or later. See
> +# the COPYING file in the top-level directory.
> +#


This build script works as expected, transferring the qemu archive over
via the virtio block device and building it.

More information here (including output of tools):
https://bugs.launchpad.net/qemu/+bug/1715203

This purpose of this is trying to prevent the need to remove
upstream qemu support for Haiku.

We have some out-of-tree patches to fix the error seen in our ports, i'll
work on upstreaming these.


 -- Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]