From patchwork Wed May 20 14:05:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1294397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=CX57/snS; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49RvgR0xWFz9sRK for ; Thu, 21 May 2020 00:06:27 +1000 (AEST) Received: from localhost ([::1]:55694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbPMW-0000Ei-TJ for incoming@patchwork.ozlabs.org; Wed, 20 May 2020 10:06:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbPLw-0008Lt-0h for qemu-devel@nongnu.org; Wed, 20 May 2020 10:05:48 -0400 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:37226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbPLu-0001nS-O6 for qemu-devel@nongnu.org; Wed, 20 May 2020 10:05:47 -0400 Received: by mail-ed1-x544.google.com with SMTP id l25so3187035edj.4 for ; Wed, 20 May 2020 07:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UeeEkoEdpVqBre5kbf2Z3iGxDOkRZkflMSZw9nUZHA0=; b=CX57/snSsRC+YCnc4Wm2N6rdthktOl5UNJv6i/0jLSWSf/BGXt+JqN+Qc37XKVo35U gZSCVxiPf334fxDMS3bc293fwQyL5D69AYd/0i+D1VpXWMe7AAS/xUSrTgZLoYM1Sn7u EuICP4yKqpp2ji3PRQ3vjZvCJVOMgFpGk2s+f+2LIgX+Xh2PLFzDlCN46bDhqIzEKvmI kOVi32a2YGv92iSXA2azpoynaVJBIG3i6L5p4gozY0Y1wcLn4sLas0hdrOcTqik55smh LG9miTda51rA4hFH4bQFWyXCXRQvN2IY733uEQGiewcUA2lFOqonnBDKySyX9fbefPCt jYsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UeeEkoEdpVqBre5kbf2Z3iGxDOkRZkflMSZw9nUZHA0=; b=jLkps2DSJniZ7SME3ZgbFZwM7s+kaDH/70er0K7a/p5ystmObDTLPLbGDjoPJWi1wU +GIYV88LzMcRGKXmVANh0NfaXdGPTLpWZlEFH94BzjtcC1G6VwVz7JlbhF+kMe93C5b6 9SsCxQjNn341Ejsf9gteEnxGDZ2O2AO1PECDw7h1Pr4s4KEFAxvPdejLwDfagbgMDqez Z6AtSvroUHQk/QMnfHIuSE4YtbPqA81UjqoOrsXN5biWDYx7Vb7Myu2l47hgJ4QR4mit V2U0GEn6nU29GlfxdYstI8fMB8pRe5jHS3I+lZ//zwnjv4LhMxr8maWANOadI0CSGdHK 0B0Q== X-Gm-Message-State: AOAM531urxhCpYvsVrMI4Q0Quxc1R5p548zfNuD9W5UBDu37RpY1eTn4 UmB1GHOiQYZj4+aEF/pegkDUxA== X-Google-Smtp-Source: ABdhPJzu8DQ8pQoXWTmPWQ2NMX699PEfLqgwCT1F9cgBHnT6no9rYZ+LUOCMA0j1bL4GXE0YZKaYcg== X-Received: by 2002:a50:870c:: with SMTP id i12mr3723574edb.258.1589983544813; Wed, 20 May 2020 07:05:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e18sm1978935ejr.2.2020.05.20.07.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 07:05:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 680E31FF8C; Wed, 20 May 2020 15:05:41 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/15] tests/vm: pass --genisoimage to basevm script Date: Wed, 20 May 2020 15:05:28 +0100 Message-Id: <20200520140541.30256-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200520140541.30256-1-alex.bennee@linaro.org> References: <20200520140541.30256-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::544; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé --- tests/vm/Makefile.include | 1 + tests/vm/basevm.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) 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,