[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/12] tests/vm: pass --genisoimage to basevm script
From: |
Alex Bennée |
Subject: |
[PULL 02/12] tests/vm: pass --genisoimage to basevm script |
Date: |
Wed, 27 May 2020 15:54:45 +0100 |
If we have an alternative to genisoimage we really need to tell the
script about it as well so it can use it. It will still default to
genisoimage in case it is run outside our build machinery.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Robert Foley <address@hidden>
Message-Id: <address@hidden>
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index 1bf9693d195..74ab522c55d 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -56,6 +56,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
$(call quiet-command, \
$(PYTHON) $< \
$(if $(V)$(DEBUG), --debug) \
+ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \
--image "$@" \
--force \
--build-image $@, \
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 756ccf7acae..a2d4054d72b 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -61,8 +61,9 @@ 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):
+ def __init__(self, debug=False, vcpus=None, genisoimage=None):
self._guest = None
+ self._genisoimage = genisoimage
self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-",
suffix=".tmp",
dir="."))
@@ -381,12 +382,12 @@ class BaseVM(object):
udata.writelines(["apt:\n",
" proxy: %s" % proxy])
udata.close()
- subprocess.check_call(["genisoimage", "-output", "cloud-init.iso",
+ subprocess.check_call([self._genisoimage, "-output", "cloud-init.iso",
"-volid", "cidata", "-joliet", "-rock",
"user-data", "meta-data"],
- cwd=cidir,
- stdin=self._devnull, stdout=self._stdout,
- stderr=self._stdout)
+ cwd=cidir,
+ stdin=self._devnull, stdout=self._stdout,
+ stderr=self._stdout)
return os.path.join(cidir, "cloud-init.iso")
@@ -424,6 +425,8 @@ def parse_args(vmcls):
help="Interactively run command")
parser.add_option("--snapshot", "-s", action="store_true",
help="run tests with a snapshot")
+ parser.add_option("--genisoimage", default="genisoimage",
+ help="iso imaging tool")
parser.disable_interspersed_args()
return parser.parse_args()
@@ -435,7 +438,8 @@ def main(vmcls):
return 1
logging.basicConfig(level=(logging.DEBUG if args.debug
else logging.WARN))
- vm = vmcls(debug=args.debug, vcpus=args.jobs)
+ vm = vmcls(debug=args.debug, vcpus=args.jobs,
+ genisoimage=args.genisoimage)
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
- [PULL 00/12] testing and plugin fixes, Alex Bennée, 2020/05/27
- [PULL 01/12] configure: add alternate binary for genisoimage, Alex Bennée, 2020/05/27
- [PULL 02/12] tests/vm: pass --genisoimage to basevm script,
Alex Bennée <=
- [PULL 04/12] tests/tcg: fix invocation of the memory record/replay tests, Alex Bennée, 2020/05/27
- [PULL 05/12] tests/fp: enable extf80_le_quite tests, Alex Bennée, 2020/05/27
- [PULL 03/12] travis.yml: Use clang++ in the Clang tests, Alex Bennée, 2020/05/27
- [PULL 08/12] tests/docker: add debian11 base image, Alex Bennée, 2020/05/27
- [PULL 06/12] tests/fp: split and audit the conversion tests, Alex Bennée, 2020/05/27
- [PULL 07/12] tests/tcg: better detect confused gdb which can't connect, Alex Bennée, 2020/05/27
- [PULL 09/12] tests/docker: use a gcc-10 based image for arm64 tests, Alex Bennée, 2020/05/27
- [PULL 12/12] tests/tcg: add new threadcount test, Alex Bennée, 2020/05/27
- [PULL 10/12] cpus-common: ensure auto-assigned cpu_indexes don't clash, Alex Bennée, 2020/05/27
- [PULL 11/12] linux-user: properly "unrealize" vCPU object, Alex Bennée, 2020/05/27