[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
- [PULL 00/41] testing updates (vm, gitlab, misc build fixes), Alex Bennée, 2020/07/07
- [PULL 01/41] crypto/linux_keyring: fix 'secret_keyring' configure test, Alex Bennée, 2020/07/07
- [PULL 03/41] tests/vm: pass args through to BaseVM's __init__, Alex Bennée, 2020/07/07
- [PULL 02/41] util/coroutine: Cleanup start_switch_fiber_ for TSAN., Alex Bennée, 2020/07/07
- [PULL 04/41] tests/vm: Add configuration to basevm.py, Alex Bennée, 2020/07/07
- Re: [PULL 04/41] tests/vm: Add configuration to basevm.py,
Alex Bennée <=
- [PULL 05/41] tests/vm: Added configuration file support, Alex Bennée, 2020/07/07
- [PULL 06/41] tests/vm: Add common Ubuntu python module, Alex Bennée, 2020/07/07
- [PULL 08/41] tests/vm: Added a new script for centos.aarch64., Alex Bennée, 2020/07/07
- [PULL 07/41] tests/vm: Added a new script for ubuntu.aarch64., Alex Bennée, 2020/07/07
- [PULL 09/41] tests/vm: change scripts to use self._config, Alex Bennée, 2020/07/07
- [PULL 10/41] python/qemu: Add ConsoleSocket for optional use in QEMUMachine, Alex Bennée, 2020/07/07