Alex Bennée <alex.ben...@linaro.org> writes:
> From: Robert Foley <robert.fo...@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.fo...@linaro.org> > Reviewed-by: Peter Puhov <peter.pu...@linaro.org> > Reviewed-by: Alex Bennée <alex.ben...@linaro.org> > Signed-off-by: Alex Bennée <alex.ben...@linaro.org> > Message-Id: <20200601211421.1277-3-robert.fo...@linaro.org> > Message-Id: <20200701135652.1366-7-alex.ben...@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