From patchwork Fri May 29 20:34:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Foley X-Patchwork-Id: 187321 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp928479ilb; Fri, 29 May 2020 13:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJndv6L/kr7AD6dv1Fhwho0thQjooeezqtNeRCy5UPI86SQTsxWoeRq6NzDY9Tm8D2rltu X-Received: by 2002:a5b:f4d:: with SMTP id y13mr17773344ybr.50.1590785028499; Fri, 29 May 2020 13:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590785028; cv=none; d=google.com; s=arc-20160816; b=ZVjAU8w8aApqR8HfvhEgBgqkT81jVErgClDmmCHLuWjtu75fIsAaX91+EMbnjqieHh h+bL7ekl59V56zRE8aVRW26HN+K33z+iHKdqTR9CLRNnFG0JJHGieAvTJOkcnVlVwUyT Zi6n32O6bCIrKyYPKidlQkDvNFfuqgI4mED4rnIBRRUoto0h2IOF0NZvgR0eTE9ne3K3 vUcXl7plJqbcJlbTuXY3j6JLT8dEEntWMs7Q/3TfZTIUNHvlXx7tS0K7auWNmnBbWqI2 oy5VDQuPIuQTRFC1Z0kXEcGVvWS6WlXgLuYAGoNTY1lvPwYpo8BuS3NPc/gM6DLhEu6V 8B8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=w1W80LI37XifJiBdMXsN+sad+Phr9kWINJYefaK6VIg=; b=MzDzm6jEZrdIzjsYRSYDsWicvlxZCXfBdk1SeukhYYBdfETSz5VepcNHVgh79/vr5Y P0rq3TdQ9FLVRcdgfYNNp2WLF9BhY13euuzDOTBwQc26nqB3AyWcYPuJWPgTMu3wSNaT yn4NECzZwW7rgqoLRJJp+Yw8bxiDx59Xq1HyavcdunGHt30zhuSN8WdRxPEM6Yf8VXvb pQznXFK8rgTDGAe09GUNzQNzjAiHZmMtsUEZoE05ZAzXbXG5TBjVrdlcwsLW7XHDSzSq NM846oneBdKgidQEg8+FdhuJiVvdnZygKvNT9cApyatCq1YH23j6w37gQlQaKGypuGgL 0f0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="YIFsw/93"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x8si8737361ybl.28.2020.05.29.13.43.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 May 2020 13:43:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="YIFsw/93"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jelr1-0006Ay-Vb for patch@linaro.org; Fri, 29 May 2020 16:43:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jelqX-0005hX-43 for qemu-devel@nongnu.org; Fri, 29 May 2020 16:43:18 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:35677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jelqV-0000e7-S3 for qemu-devel@nongnu.org; Fri, 29 May 2020 16:43:16 -0400 Received: by mail-pl1-x62b.google.com with SMTP id q16so1705757plr.2 for ; Fri, 29 May 2020 13:43:15 -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=w1W80LI37XifJiBdMXsN+sad+Phr9kWINJYefaK6VIg=; b=YIFsw/933SZGKHjIxCRowbAJrjVgXRPOYxhX6ZRqwZ8uZ7cZxDC2y2f6LVKf39hU+6 wI+VBa6CtG4f2xT++AlnSDuSq0Opp7KvccvCVOmhjqYbcfT/Eo1wuV7vnfpXN2QIDVdu CT4UooXQULl/y9Un94ZTYsgisJxz4Uvh1NemLeRMATbzB++P8AVyFEJZJ6xB+XYCaXJK L8ImYoqEJC+xRv2tkitiz7bwQ3REGTzcei9ZHKBAd/dPxI7RhqsS6ctMOFfLlRGlXriN kJVdSGmHDgrEZmnQOXZR03qAD91LWqWPdt+V0sw7xziI6IeMiDOFr2LlfdX5ylycCU5A heoQ== 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=w1W80LI37XifJiBdMXsN+sad+Phr9kWINJYefaK6VIg=; b=f0CUAfFL+Vb6oaDQOaDxsv3cyFYJh5k+wB8Fjw9n25L63nAzYGBTfO6RnJevYQsXdS L9vgI1A+oiBoKuMfystKPqRVfiO7WBsNy2kj2/5Wy7BH0W0NeuPk+UoEZOylEpdpubH4 cluXMTucWqzj1bQBPUuiW6M36w5+mpKqSRdRq7G47OlyklK7BtikaU3yU5U/QWpL0Tax fQ/vKDIKFdxNTvm9KZ9/LDDB+Tm6zweVmQhe7NGyDFFwTB90mUMQESBI1OdIDKXtot2z z0sIRPZj+/Pw3P2547equXC9+LL7LejEJqzVVk6rGByyiGHwCfuzoQcHndERf9ABvIW4 KcxQ== X-Gm-Message-State: AOAM5330vTMx8/gpa3ChSX0oDPcXrQl38dQIJTXaMG6O/LxaPTbEiX0m rGH7w2ETD18N5WHsRpyVHhZRhR2pS5y34A== X-Received: by 2002:a17:902:6b4b:: with SMTP id g11mr10668820plt.9.1590784994156; Fri, 29 May 2020 13:43:14 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:75ac:d268:da04:dde4]) by smtp.gmail.com with ESMTPSA id t12sm282839pjf.3.2020.05.29.13.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 13:43:13 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v8 01/12] tests/vm: pass args through to BaseVM's __init__ Date: Fri, 29 May 2020 16:34:47 -0400 Message-Id: <20200529203458.1038-2-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200529203458.1038-1-robert.foley@linaro.org> References: <20200529203458.1038-1-robert.foley@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=robert.foley@linaro.org; helo=mail-pl1-x62b.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 , philmd@redhat.com, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Alex Bennée --- tests/vm/basevm.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index a2d4054d72..fbefda0595 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -61,9 +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, genisoimage=None): + def __init__(self, args): self._guest = None - self._genisoimage = genisoimage + self._genisoimage = args.genisoimage self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", suffix=".tmp", dir=".")) @@ -76,7 +76,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: @@ -90,8 +90,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: @@ -438,8 +438,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) + 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,