From patchwork Tue Jul 7 07:08:20 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: 234910 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp651939ilg; Tue, 7 Jul 2020 00:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp/Iyf2mRSiboqZ1N9M/C9jVQr+kY1BUaL/81w3vfciC7upxw77zxMbPZBInZzaJ4kcmqA X-Received: by 2002:a25:3f87:: with SMTP id m129mr89535794yba.371.1594105786948; Tue, 07 Jul 2020 00:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594105786; cv=none; d=google.com; s=arc-20160816; b=y1U1lK1+3qyOaKvTTuTqOxIUAKV41T4847Fa9MP9AbxrV7A+o9YUGuL2BEt2GlrIjY lb8WhHuTfqGKedB8CEIbGL5V99DPEh4UB4sO/BHyMeN1EV+l1GS4f4AKIsIYfE8iC0/Q U8dQ8tUdasr1fx1ToPideSIChv003somBnNkPr4jxLCujIafm75fEjJlF5mEJajDL14H DyOYJh4Bs7B0tC4WwIM6MYikKhUp2lpa41ZCiZ0mOsKIE+tUiD0Hks8w/1a12McU8Ljo uDk0duSL6VJ1FCL9J/47aXxb/y/p0QqqpvOpWcxNlQz8ihANWdFKDk3bAm43ooEQkR7I FaRQ== 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=f+mo9JyjAOQaUqLAqsYtfO14+eY9TpKX1IQ4XQcaJvA=; b=yw4dCk4glR3bZauP9zSh5HkOf86jL0CycOGQdXZspgvG0GGo82Mum8q5CCVZ1aciMO FZw8M7VmDiZHqRXgJJ1qvE1VnRdSWeJiHdlwy6GAGL01vdToFYTSO/XFOo6uF2JWsDOc EiknMKNpHzBdCiH9WYCrbD6prrYOb7fqEMSdOx7QNP/TOZviZqr49GQe+dTn1rFYT7e6 zx9grBZB2DFJjvM/jE9aGeohSvTgt+czVwsArl7zIdyH+O92w1ymzuwiqOmzoJaeSf5q Nu1K+pYLgCP5SdBa5IzvdTCWNTPkKqeBTnY6t06+fupKOvWYG6QTSK2u6/eyaOivWPhS BiQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pKLMru5T; 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 x184si7276920ybx.325.2020.07.07.00.09.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jul 2020 00:09:46 -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=pKLMru5T; 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]:34992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jshje-0004Nl-Dq for patch@linaro.org; Tue, 07 Jul 2020 03:09:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jshiz-0004HU-7G for qemu-devel@nongnu.org; Tue, 07 Jul 2020 03:09:05 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:56224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jshix-00042z-F3 for qemu-devel@nongnu.org; Tue, 07 Jul 2020 03:09:04 -0400 Received: by mail-wm1-x331.google.com with SMTP id g75so42097641wme.5 for ; Tue, 07 Jul 2020 00:09:03 -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=f+mo9JyjAOQaUqLAqsYtfO14+eY9TpKX1IQ4XQcaJvA=; b=pKLMru5Terw3NoNSYbVQESW5nNqn9aM1pUsdTDOL5pVY6TDXOxpTonURneZfTQJ7Ds r9kkzdQGSoM7vFhZTytWyOk9RrVSoiB6uVW4FJQSsGIEbPqPyqaZB1OmfacUe/ZzIyF/ 0HPnOSoo8TB8Shtmy8xn28BABOKmw3eE4UES6FgzJyVfwO+7+0uYwJKWLyzv59bU1cIJ GTxxQYxyXdlTVSo7p6tBra1dcfuejTWVHwCkHUsljujrwsXRsW70H7+6lG2SfgRyxBRL wVmlfVi1K89CFV+VdmGL02U0HSnA/cYHdESwYb3+BDF6PmJMgroMICxZyGgC4LwdhrmE oniQ== 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=f+mo9JyjAOQaUqLAqsYtfO14+eY9TpKX1IQ4XQcaJvA=; b=A+z7SkoG5bdrcxYHdg4VEwCs+GUoOYI2fVWIs8aIelLaSb1JiW1M/WOkNZ/V1sDALm MOl4oU6F4y47IyNXwD88/wRoQT1H/gWCM+otjf7gffj5/jTf6TcDl+KXMK9Eo1S8YG6l Cyp9qP8LfnPx3RQyxGZ4ArAB34pme/KKJmKqhLpCxANL3PylSaeUb1x2oAWj+ezF9+iR EE1jZ31KavXx+6NXkHMQXO1zzKe9iOgqEZuo7c7R/YQ8vaNezF2c6s4JIGv3ZQI2g17l huN4cPZqF+UpW1op3fiZJYZp/unu4M75UpgPnEUvOoeP7hoW2qkYZYguFR2KMOiL7iXA MhOA== X-Gm-Message-State: AOAM531PvmkUEXPEZARmoQko/KfZJgWGvLx5ydqylFb3rBoE9qZhtKKr h9xPFS1FV70OqNd+AXB9TwFHzA== X-Received: by 2002:a1c:bcd4:: with SMTP id m203mr2611987wmf.124.1594105741756; Tue, 07 Jul 2020 00:09:01 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v5sm26480240wre.87.2020.07.07.00.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 00:08:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BADF81FF8F; Tue, 7 Jul 2020 08:08:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 03/41] tests/vm: pass args through to BaseVM's __init__ Date: Tue, 7 Jul 2020 08:08:20 +0100 Message-Id: <20200707070858.6622-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200707070858.6622-1-alex.bennee@linaro.org> References: <20200707070858.6622-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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_HELO_NONE=0.001, 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_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley 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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-2-robert.foley@linaro.org> Message-Id: <20200701135652.1366-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index a80b616a08d3..5a58e6c39300 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,