qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 04/41] tests/vm: Add configuration to basevm.py


From: Alex Bennée
Subject: Re: [PULL 04/41] tests/vm: Add configuration to basevm.py
Date: Fri, 10 Jul 2020 14:50:36 +0100
User-agent: mu4e 1.5.4; emacs 28.0.50

Alex Bennée <alex.bennee@linaro.org> writes:

> From: Robert Foley <robert.foley@linaro.org>
>
> Added use of a configuration to tests/vm/basevm.py.
> The configuration provides parameters used to configure a VM.
> This allows for providing alternate configurations to the VM being
> created/launched. cpu, machine, memory, and NUMA configuration are all
> examples of configuration which we might want to vary on the VM being created
> or launched.
> This will for example allow for creating an aarch64 vm.
>
> Signed-off-by: Robert Foley <robert.foley@linaro.org>
> Reviewed-by: Peter Puhov <peter.puhov@linaro.org>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20200601211421.1277-3-robert.foley@linaro.org>
> Message-Id: <20200701135652.1366-7-alex.bennee@linaro.org>
>
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index 5a58e6c39300..cfe20c58f7ef 100644
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -29,16 +29,41 @@ import tempfile
>  import shutil
>  import multiprocessing
>  import traceback
> -
> -SSH_KEY = open(os.path.join(os.path.dirname(__file__),
> -               "..", "keys", "id_rsa")).read()
> -SSH_PUB_KEY = open(os.path.join(os.path.dirname(__file__),
> -                   "..", "keys", "id_rsa.pub")).read()
> -
> +import shlex
> +
> +SSH_KEY_FILE = os.path.join(os.path.dirname(__file__),
> +               "..", "keys", "id_rsa")
> +SSH_PUB_KEY_FILE = os.path.join(os.path.dirname(__file__),
> +                   "..", "keys", "id_rsa.pub")
> +
> +# This is the standard configuration.
> +# Any or all of these can be overridden by
> +# passing in a config argument to the VM constructor.
> +DEFAULT_CONFIG = {
> +    'cpu'             : "max",
> +    'machine'         : 'pc',
> +    'guest_user'      : "qemu",
> +    'guest_pass'      : "qemupass",
> +    'root_pass'       : "qemupass",
> +    'ssh_key_file'    : SSH_KEY_FILE,
> +    'ssh_pub_key_file': SSH_PUB_KEY_FILE,
> +    'memory'          : "4G",
> +    'extra_args'      : [],
> +    'qemu_args'       : "",
> +    'dns'             : "",
> +    'ssh_port'        : 0,
> +    'install_cmds'    : "",
> +    'boot_dev_type'   : "block",
> +    'ssh_timeout'     : 1,
> +}
<snip>
>  
> -def main(vmcls):
> +def main(vmcls, config=None):
>      try:
> +        if config == None:
> +            config = {}

Ahh I think this is where is went wrong - should be config = DEFAULT_CONFIG

Just re-running the rest of the vm builds now.

-- 
Alex Bennée



reply via email to

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