From patchwork Mon Jun 22 14:31:48 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: 191353 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1103702ile; Mon, 22 Jun 2020 07:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/UFiS0zRUegBdZZ0fbSxajH0ZnPV7UuattboxSDw+ZRvUEi5clympIkJlsnlU+axBa+zx X-Received: by 2002:a25:8404:: with SMTP id u4mr29371121ybk.515.1592836856687; Mon, 22 Jun 2020 07:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592836856; cv=none; d=google.com; s=arc-20160816; b=EQFl5SdXN3YZSZj6bwVROowHwnSOwSdUh+mMIFO5BE5ohkfR3faKQKhOvrGuWjx3f5 7cZSdkZjOPNyTd8MOF3vgCZQG5PZKRGuJ5Vh0qy6OWGi/s6v/3s0kXn/rvC/fcn2wNzp 6ZnVZ8uAo/RucLDrUAlGfZN7NeMLBPqdLtRJV0fGPTdDtYPOzt29Wht/T4vGAIhieAhj EEBPQt3tKxgxhpqNxJNn0KCk8ETb88fr12x3CZZPfbIEvoN3ayDnwoGNQ07mCpPNtohC 7/XCIuLZnQMTZDbjdK0+uE1XxmDb6yiRfYWOMQKhWNd6H640RR1f23CXlMLPpp96dPYo V76A== 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=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=FL66FVyM4ucFlxEoT/6ZRqrVr318IjU8NLOuS9PY7cWsYYdjAu4odRpBaGGrHJ8LLl Z4s2WgJplJpe1062hV34F2FZZWTyzJMfRPVRGfTeu/B/JNy45K0mKb0A2NetaUpt7b8b MV/SlPVTGh3g6yxXrKwxCKpg8Dwwiyfg2oWbSb+n1S+VCfMeMxAf/lgSpQvS7FftkCzq 7ezbt6VHEdVDnPKxh3/R2vefKcepL8+JNv5C+cYZ/HSkSeogUUg2qiKmp54DqlnHQDkI 9fv52MPUaRj7lrWaITyA7Z89ggUWjel/xicGg90vDWtZupvDb7cQH+dj073oBJLuNVyB 672Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oGBYxPyO; 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 a202si13647428ybg.327.2020.06.22.07.40.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jun 2020 07:40:56 -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=oGBYxPyO; 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]:45292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNd1-0001mm-UJ for patch@linaro.org; Mon, 22 Jun 2020 10:40:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUb-0006qX-6k for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:14 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:33186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUY-0005eM-SE for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:12 -0400 Received: by mail-wr1-x42f.google.com with SMTP id l11so16942630wru.0 for ; Mon, 22 Jun 2020 07:32:10 -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=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=oGBYxPyOAYgmZ0GopkO8p/KIEz05emt4dkR/2HqeZUD9ZoWK0WNhvz/X9s35UsfWqB Vwfr8xkTrbh5gp3JaueBe1o2YJdiLPG8dUi5AnVFO0Q22/YPgedfBwP1XpES+PSIMyYA jUWj35azekwx7kmi1ymlx1SWiMl6d1XkjJlg6zTvPEHC2hPeoGsruXYf/CdcMNSKAUho nZJz4XYAl/QrUIZRWGj9hj2ZUWgyNhcEeL/H1Nf2vTmQIkpTA6ekErXYGUbDlnbu6po3 MIAAfB561yc969VzTB0gREPmg719VvcYY4WQ26SEqcm1K9DZohD4TtlpIfEEXNAeNVKo mOeQ== 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=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=aCYe/RYNpFKwKHVJm7u4xpGP9XYKVEju28X4aLaXbVHypDQaBeElsQBG3wEizwF+y5 LvSP+K0Akc2o8/jb2en2XoP8SEULTsjWWyItDyBaL2G9EH2HGGwFVhXor3BCdS5JpbVJ FWG2h4rD5fKsr9JmLoho8t3EYT7/4dSyZ32F5GOKq6Ds1wPDv6pHhmI7zjAKpDShmXU9 LYULQW/3xsplmll+tectQMemUgBvV6gSCQ4RAYNl0ztzQR0eb15QQthC2xWtX3SEw9Er 0RDnekTDW/Sa6GTj36lEBFUYdxElHHMr6t5xQUTtoUxHCfW35oJyb2g1u/Qu9wcyqoj/ Dp6g== X-Gm-Message-State: AOAM531dDH/3ib+6f6bspJnLLyr04M9OOEmUWxYCxkzLoCmgf+pQ8uLv eX01UzTgziJLMACIVJpY2M/68w== X-Received: by 2002:adf:e811:: with SMTP id o17mr5962257wrm.53.1592836329459; Mon, 22 Jun 2020 07:32:09 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o6sm18265567wrp.3.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E3E571FF8C; Mon, 22 Jun 2020 15:32:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/18] tests/vm: pass args through to BaseVM's __init__ Date: Mon, 22 Jun 2020 15:31:48 +0100 Message-Id: <20200622143204.12921-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622143204.12921-1-alex.bennee@linaro.org> References: <20200622143204.12921-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net 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> --- tests/vm/basevm.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.20.1 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,