[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 05/40] tests/vm: pass args through to BaseVM's __init__
From: |
Alex Bennée |
Subject: |
[PATCH v4 05/40] tests/vm: pass args through to BaseVM's __init__ |
Date: |
Wed, 1 Jul 2020 14:56:17 +0100 |
From: Robert Foley <robert.foley@linaro.org>
Adding the args parameter to BaseVM's __init__.
We will shortly need to pass more parameters to the class
so let's just pass args rather than growing the parameter list.
Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200601211421.1277-2-robert.foley@linaro.org>
---
tests/vm/basevm.py | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index a80b616a08d..5a58e6c3930 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -61,11 +61,10 @@ class BaseVM(object):
# 4 is arbitrary, but greater than 2,
# since we found we need to wait more than twice as long.
tcg_ssh_timeout_multiplier = 4
- def __init__(self, debug=False, vcpus=None, genisoimage=None,
- build_path=None):
+ def __init__(self, args):
self._guest = None
- self._genisoimage = genisoimage
- self._build_path = build_path
+ self._genisoimage = args.genisoimage
+ self._build_path = args.build_path
self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-",
suffix=".tmp",
dir="."))
@@ -78,7 +77,7 @@ class BaseVM(object):
self._ssh_pub_key_file = os.path.join(self._tmpdir, "id_rsa.pub")
open(self._ssh_pub_key_file, "w").write(SSH_PUB_KEY)
- self.debug = debug
+ self.debug = args.debug
self._stderr = sys.stderr
self._devnull = open(os.devnull, "w")
if self.debug:
@@ -92,8 +91,8 @@ class BaseVM(object):
(",ipv6=no" if not self.ipv6 else ""),
"-device", "virtio-net-pci,netdev=vnet",
"-vnc", "127.0.0.1:0,to=20"]
- if vcpus and vcpus > 1:
- self._args += ["-smp", "%d" % vcpus]
+ if args.jobs and args.jobs > 1:
+ self._args += ["-smp", "%d" % args.jobs]
if kvm_available(self.arch):
self._args += ["-enable-kvm"]
else:
@@ -456,8 +455,7 @@ def main(vmcls):
return 1
logging.basicConfig(level=(logging.DEBUG if args.debug
else logging.WARN))
- vm = vmcls(debug=args.debug, vcpus=args.jobs,
- genisoimage=args.genisoimage, build_path=args.build_path)
+ vm = vmcls(args)
if args.build_image:
if os.path.exists(args.image) and not args.force:
sys.stderr.writelines(["Image file exists: %s\n" % args.image,
--
2.20.1
- Re: [PATCH v4 01/40] hw/isa: check for current_cpu before generating IRQ, (continued)
- [PATCH v4 04/40] util/coroutine: Cleanup start_switch_fiber_ for TSAN., Alex Bennée, 2020/07/01
- [PATCH v4 12/40] python/qemu: Add ConsoleSocket for optional use in QEMUMachine, Alex Bennée, 2020/07/01
- [PATCH v4 10/40] tests/vm: Added a new script for centos.aarch64., Alex Bennée, 2020/07/01
- [PATCH v4 11/40] tests/vm: change scripts to use self._config, Alex Bennée, 2020/07/01
- [PATCH v4 07/40] tests/vm: Added configuration file support, Alex Bennée, 2020/07/01
- [PATCH v4 09/40] tests/vm: Added a new script for ubuntu.aarch64., Alex Bennée, 2020/07/01
- [PATCH v4 08/40] tests/vm: Add common Ubuntu python module, Alex Bennée, 2020/07/01
- [PATCH v4 05/40] tests/vm: pass args through to BaseVM's __init__,
Alex Bennée <=
- [PATCH v4 25/40] tests/docker: add packages needed for check-acceptance, Alex Bennée, 2020/07/01
- [PATCH v4 06/40] tests/vm: Add configuration to basevm.py, Alex Bennée, 2020/07/01
- [PATCH v4 24/40] tests/docker: add --registry support to tooling, Alex Bennée, 2020/07/01
- [PATCH v4 21/40] gitlab: build all container images during CI, Alex Bennée, 2020/07/01
- [PATCH v4 20/40] gitlab: introduce explicit "container" and "build" stages, Alex Bennée, 2020/07/01
- [PATCH v4 19/40] gitlab-ci: Fix the change rules after moving the YML files, Alex Bennée, 2020/07/01
- [PATCH v4 22/40] gitlab: convert jobs to use custom built containers, Alex Bennée, 2020/07/01
- [PATCH v4 23/40] gitlab: build containers with buildkit and metadata, Alex Bennée, 2020/07/01
- [PATCH v4 37/40] gitlab: limit re-builds of the containers, Alex Bennée, 2020/07/01
- [PATCH v4 26/40] tests/acceptance: skip s390x_ccw_vrtio_tcg on GitLab, Alex Bennée, 2020/07/01