From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836535; cv=none; d=zohomail.com; s=zohoarc; b=KgwgJ1W2W8QM53vJPMoxM6vIJ5u9tGypvDacTFmoZj76QSg5rTLZDJanTB2x0mGgR1REy8E3v3kTbZo0iTNS8PYmwNi/8n9MnVcgvGgq9aRu9dDvphnemLfX18MQr5fqVitKF2sK4ngCF0yFsisNSFGYl/yb332/X/wjAIBa2w8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836535; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c2Ux+T+fS/HESUzVrNCO1n2kjnwyS/C8XASbbm6Vx/0=; b=ZbUX//Ke2+4vpr2iHzFwpfS9koE2ytQCffqlMcfZY0z1nLB3UlkYSmWR824wc131QwOO00uTOhMfLKPj226jnhWP5qrrj8K7z9y3rNPJrxw+Otln3HUbINJewYu4MHJXNYAStD/nnbXIqFyWKSnGiV3PjSf+Y8tTu1HVSh0XxMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836535187701.5094061844003; Mon, 22 Jun 2020 07:35:35 -0700 (PDT) Received: from localhost ([::1]:54264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNXq-0001TY-7j for importer@patchew.org; Mon, 22 Jun 2020 10:35:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUZ-0006mm-6N for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:12 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:41748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUW-0005dx-TZ for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:10 -0400 Received: by mail-wr1-x42a.google.com with SMTP id q2so14474522wrv.8 for ; Mon, 22 Jun 2020 07:32:08 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a15sm20640436wrh.54.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 CD6D71FF87; Mon, 22 Jun 2020 15:32:04 +0100 (BST) 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=c2Ux+T+fS/HESUzVrNCO1n2kjnwyS/C8XASbbm6Vx/0=; b=SiUJ905Tp4BepS/nhSEDC8wpgQWD2B9BJWGJEInLKFctofPnZeoJqSoB1wyM3LzkJu iwTxDYqyvvB7FFfJF3Y6XZOuCLuRIaZysyfIWzX7rYaaY5EwbF7scQLhp4O6rtTOWBcF +a0q7MDtJym+hAHU7NhnvmsboLIudwNEaON3BQZCTIV5W7M6Vy0YS1aTFytNW4aiwLcZ I9gOzSGJ/1F/01faouW1Qo6c9zc5nLee92r2UDqLRGUy0yrz6vnbdpSNJ+rTyMmdFtqW IMSBXcIH3cTus08xv83hZinL+83PQruG+sqIUIFy4B5ynBIeUI0leuLA2QvcHOvgfJL8 xGfg== 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=c2Ux+T+fS/HESUzVrNCO1n2kjnwyS/C8XASbbm6Vx/0=; b=X4MUw7Q84jY6bcu7mAkDXO9grOFd43kWUZNCK5Xgglg/3r1pr5jR8gzvk89XVJXyIx y4Bb8L2HT1qIHSFDgCG7hqSXvDywy1spT+rSplxnIcOJwta2Grs0c+8oPtL5mIm96DVz Zf9R0Kzk+BZOiCIJ0B2tCbmC4+DrFJ7FsTzYzIjZbo8YklJvxcE+eq/Hyz6Deamevz82 YLdbVMfIMbNiRiAkjZcgg1eu67fo/76J6YUJ4aluu0E6WwBDPV7S4u+a7qcS7a3yl2Y8 O896FYFcuqk3LgNbDSfb+9LjCLXDXjKwNML80oemnKl0kK5sHmunY9pgbYItyH7+2mas 2e1Q== X-Gm-Message-State: AOAM531wJFXw7SiviLe94zdbqvXeSWK/wZtEGuNVHZ5OPPSixF9xvkP/ YjSZ+qzE5GPSw51WKvCLQwoXBQ== X-Google-Smtp-Source: ABdhPJw+BUQf8wqVHYoX3/6ywPmXoZGVpq2xrD9cWqOMNGAIKk4+3o/lpr4O9YuILCwDOD8n9/dE8w== X-Received: by 2002:adf:ce8d:: with SMTP id r13mr17219444wrn.392.1592836326792; Mon, 22 Jun 2020 07:32:06 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 01/18] iotests: Fix 051 output after qdev_init_nofail() removal Date: Mon, 22 Jun 2020 15:31:47 +0100 Message-Id: <20200622143204.12921-2-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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 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, Kevin Wolf , Thomas Huth , berrange@redhat.com, "open list:Block layer core" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , richard.henderson@linaro.org, f4bug@amsat.org, Max Reitz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Commit 96927c744 replaced qdev_init_nofail() call by isa_realize_and_unref() which has a different error message. Update the test output accordingly. Gitlab CI error after merging b77b5b3dc7: https://gitlab.com/qemu-project/qemu/-/jobs/597414772#L4375 Reported-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200616154949.6586-1-philmd@redhat.com> Reviewed-by: John Snow Reviewed-by: Thomas Huth --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index 0ea80d35f0e..da8ad871876 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -142,7 +142,7 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive if=3Dide QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs med= ia, but drive is empty +(qemu) QEMU_PROG: Device needs media, but drive is empty =20 Testing: -drive if=3Dvirtio QEMU X.Y.Z monitor - type 'help' for more information @@ -214,7 +214,7 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dide,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is re= ad-only +(qemu) QEMU_PROG: Block node is read-only =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dvirtio,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836890; cv=none; d=zohomail.com; s=zohoarc; b=JKdq3ZSXPOiqObuYUIki0yz3kEXIXl+I0CB806HxwhTfvS5sPjr3DxCehNJ6nO9iwCDXtE7Ykw0MrVvVVeXu2Vn87yzjJ6PrgwUDx/f7ac3q9v7KuceJi29RFVJxryy2QFU5+0aMPcFUGxS1FwIXFEhEzI4p0ExFQ2VOAa9M9dk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836890; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=EYoOQukxjxAt1caVS9M2VdK0KJe67htAA5UC1I5T/bpGUVUE1eV/l69fvKcq4g8c2X2K7u8aCDUShCx8QiSkEN0ZPoOLlAeY35IsaWbXotiM1/Tw/oUHYOOjVsZcGAWx7iN+ffhr3KAf1Gdm4sTFJToaLogi9L0xI5jxOCDVV6c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836890799255.31633772438636; Mon, 22 Jun 2020 07:41:30 -0700 (PDT) Received: from localhost ([::1]:49194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNdZ-000418-V2 for importer@patchew.org; Mon, 22 Jun 2020 10:41:29 -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) 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) 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-Google-Smtp-Source: ABdhPJzs3y3WsnBiiiGT7ohytiyXv5ojrJvSdKDYytstzI2QT6zt+sQE6rc1qK1hC5M/j1aDGR33Mw== X-Received: by 2002:adf:e811:: with SMTP id o17mr5962257wrm.53.1592836329459; Mon, 22 Jun 2020 07:32:09 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-2-robert.foley@linaro.org> --- tests/vm/basevm.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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 =3D 4 - def __init__(self, debug=3DFalse, vcpus=3DNone, genisoimage=3DNone, - build_path=3DNone): + def __init__(self, args): self._guest =3D None - self._genisoimage =3D genisoimage - self._build_path =3D build_path + self._genisoimage =3D args.genisoimage + self._build_path =3D args.build_path self._tmpdir =3D os.path.realpath(tempfile.mkdtemp(prefix=3D"vm-te= st-", suffix=3D".tmp", dir=3D".")) @@ -78,7 +77,7 @@ class BaseVM(object): self._ssh_pub_key_file =3D os.path.join(self._tmpdir, "id_rsa.pub") open(self._ssh_pub_key_file, "w").write(SSH_PUB_KEY) =20 - self.debug =3D debug + self.debug =3D args.debug self._stderr =3D sys.stderr self._devnull =3D open(os.devnull, "w") if self.debug: @@ -92,8 +91,8 @@ class BaseVM(object): (",ipv6=3Dno" if not self.ipv6 else ""), "-device", "virtio-net-pci,netdev=3Dvnet", "-vnc", "127.0.0.1:0,to=3D20"] - if vcpus and vcpus > 1: - self._args +=3D ["-smp", "%d" % vcpus] + if args.jobs and args.jobs > 1: + self._args +=3D ["-smp", "%d" % args.jobs] if kvm_available(self.arch): self._args +=3D ["-enable-kvm"] else: @@ -456,8 +455,7 @@ def main(vmcls): return 1 logging.basicConfig(level=3D(logging.DEBUG if args.debug else logging.WARN)) - vm =3D vmcls(debug=3Dargs.debug, vcpus=3Dargs.jobs, - genisoimage=3Dargs.genisoimage, build_path=3Dargs.build= _path) + vm =3D 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.im= age, --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837037; cv=none; d=zohomail.com; s=zohoarc; b=Vk4AJezdfupCG/vJC4xVxuhI+gVRHdsXbVHbX5AvA0uvabkEZKTD7E016CvZ90N3bKomFyVt64ywhUh32tvO5BqkcE6sLfWbvJ6aShcNGNv2UhGCZreiCaRsJX+Zt70kh0wSvk7bYNNd+ctyxnaJOY6dmzmiN49m1lUG0HgP+AE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837037; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Uqu+G7KWNLFFsBFSWuF2fzigErk1o01AVduM2CJF95Y=; b=E9FAxsWKna0RZr5DMNSZ11MFRWXPFKpP77DkTON5sAZ7XGEIjOz6b8znzzbKfPm1A1mrR1QS+KFAEkvhr3HMl+IMc7U97rxk3KAyhpNWqc0bK5Zh0mpv73cyDLB+l5Vl31WVYXHlL6cCYzKFnJIJo1exX1xcRwXtbnuYaQi0BTQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837037639849.923106438594; Mon, 22 Jun 2020 07:43:57 -0700 (PDT) Received: from localhost ([::1]:57466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNfw-0007S4-BU for importer@patchew.org; Mon, 22 Jun 2020 10:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUd-0006tm-Iy for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:15 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:36256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUa-0005eW-Sa for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:15 -0400 Received: by mail-wr1-x42d.google.com with SMTP id k6so4452863wrn.3 for ; Mon, 22 Jun 2020 07:32:12 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y17sm18970877wrd.58.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0566A1FF8F; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=Uqu+G7KWNLFFsBFSWuF2fzigErk1o01AVduM2CJF95Y=; b=sbnRHdloFlnP6e2dlUbwNezFOjToBjyM5/4MDayOl3y8lz9ZVNkGGXa1FRNZ86/pAZ pItxpPbBeNjMj34UX9yO6ARuuVqQjgC8YsRJTNfs5TYwUnESFwL74XTO0Kl+vhEeDN6V 1oiHfrbGQ+4QMXkNojdH+pXxW7ZKATsCxg75mYm8RQ0vXGIPzJ23BZ1B7vagOwc2xCb+ 1jDKeyBoGye8RV3QtsAqB3OB0LBnnbJAw6J+kR4kWzUE6HGYfOWPl4JTdS5Ldv/iQKtg bZn80fzU3keVltrvRgVB+nQ32oR1/yojHqwxO+Apqks232JzOidx+Z7nubGJ6qOF01hy ZCLA== 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=Uqu+G7KWNLFFsBFSWuF2fzigErk1o01AVduM2CJF95Y=; b=lOK7ElB4qr7PdP8WEkrubFTVVVaXbqR4QoGdj5jawIjKxrNNCvwhdWg4GE4TUYfGwJ he5dJc3+9MaR7p3STBJITvRNcHDlNr100UQQ7Fkwbm5OP9TLpcEqWN0rb3qEtzmcuB5R uVg9WRHhDYs4PEdmpDLDFrTmz5onG0lsjBYOJyTUyPxk0JtVw7aN02Y0fEwon3EcfJrN F3D7oiA8pqOB6547aSCGt1VBeJ6QcKT2OihL+zQb6kbFMppht4gSCPzWYX1GMoyk8v2n 1WDO/hU22bcXHTgX4mkQkvwHJTtQfP7z9uDqullJYA6CzzAsV0t88YaaYlHriwP16zDq 7noQ== X-Gm-Message-State: AOAM531tj7CNDXUcu4PEukFvixTZhrGFOpwMuYj+U9BP7iaSX7AHzsTo t+zAH9Af5yxK3/BwSMqoCPxmDQ== X-Google-Smtp-Source: ABdhPJz1KFFr/ADeayV+eZEUzBdByTyLZRqB5fJrYaToeJ5RrQB6R4D6SFBTAXOWFvwwS55CpETnEA== X-Received: by 2002:a5d:4710:: with SMTP id y16mr19924700wrq.189.1592836331156; Mon, 22 Jun 2020 07:32:11 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 03/18] tests/vm: Add configuration to basevm.py Date: Mon, 22 Jun 2020 15:31:49 +0100 Message-Id: <20200622143204.12921-4-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley Added use of a configuration to tests/vm/basevm.py. The configuration provides parameters used to configure a VM. This allows for providing alternate configurations to the VM being created/launched. cpu, machine, memory, and NUMA configuration are all examples of configuration which we might want to vary on the VM being creat= ed or launched. This will for example allow for creating an aarch64 vm. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-3-robert.foley@linaro.org> --- tests/vm/basevm.py | 172 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 133 insertions(+), 39 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5a58e6c3930..cfe20c58f7e 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -29,16 +29,41 @@ import tempfile import shutil import multiprocessing import traceback - -SSH_KEY =3D open(os.path.join(os.path.dirname(__file__), - "..", "keys", "id_rsa")).read() -SSH_PUB_KEY =3D open(os.path.join(os.path.dirname(__file__), - "..", "keys", "id_rsa.pub")).read() - +import shlex + +SSH_KEY_FILE =3D os.path.join(os.path.dirname(__file__), + "..", "keys", "id_rsa") +SSH_PUB_KEY_FILE =3D os.path.join(os.path.dirname(__file__), + "..", "keys", "id_rsa.pub") + +# This is the standard configuration. +# Any or all of these can be overridden by +# passing in a config argument to the VM constructor. +DEFAULT_CONFIG =3D { + 'cpu' : "max", + 'machine' : 'pc', + 'guest_user' : "qemu", + 'guest_pass' : "qemupass", + 'root_pass' : "qemupass", + 'ssh_key_file' : SSH_KEY_FILE, + 'ssh_pub_key_file': SSH_PUB_KEY_FILE, + 'memory' : "4G", + 'extra_args' : [], + 'qemu_args' : "", + 'dns' : "", + 'ssh_port' : 0, + 'install_cmds' : "", + 'boot_dev_type' : "block", + 'ssh_timeout' : 1, +} +BOOT_DEVICE =3D { + 'block' : "-drive file=3D{},if=3Dnone,id=3Ddrive0,cache=3Dwriteback "\ + "-device virtio-blk,drive=3Ddrive0,bootindex=3D0", + 'scsi' : "-device virtio-scsi-device,id=3Dscsi "\ + "-drive file=3D{},format=3Draw,if=3Dnone,id=3Dhd0 "\ + "-device scsi-hd,drive=3Dhd0,bootindex=3D0", +} class BaseVM(object): - GUEST_USER =3D "qemu" - GUEST_PASS =3D "qemupass" - ROOT_PASS =3D "qemupass" =20 envvars =3D [ "https_proxy", @@ -57,25 +82,38 @@ class BaseVM(object): poweroff =3D "poweroff" # enable IPv6 networking ipv6 =3D True + # This is the timeout on the wait for console bytes. + socket_timeout =3D 120 # Scale up some timeouts under TCG. # 4 is arbitrary, but greater than 2, # since we found we need to wait more than twice as long. tcg_ssh_timeout_multiplier =3D 4 - def __init__(self, args): + def __init__(self, args, config=3DNone): self._guest =3D None self._genisoimage =3D args.genisoimage self._build_path =3D args.build_path + # Allow input config to override defaults. + self._config =3D DEFAULT_CONFIG.copy() + if config !=3D None: + self._config.update(config) + self.validate_ssh_keys() self._tmpdir =3D os.path.realpath(tempfile.mkdtemp(prefix=3D"vm-te= st-", suffix=3D".tmp", dir=3D".")) atexit.register(shutil.rmtree, self._tmpdir) - - self._ssh_key_file =3D os.path.join(self._tmpdir, "id_rsa") - open(self._ssh_key_file, "w").write(SSH_KEY) - subprocess.check_call(["chmod", "600", self._ssh_key_file]) - - self._ssh_pub_key_file =3D os.path.join(self._tmpdir, "id_rsa.pub") - open(self._ssh_pub_key_file, "w").write(SSH_PUB_KEY) + # Copy the key files to a temporary directory. + # Also chmod the key file to agree with ssh requirements. + self._config['ssh_key'] =3D \ + open(self._config['ssh_key_file']).read().rstrip() + self._config['ssh_pub_key'] =3D \ + open(self._config['ssh_pub_key_file']).read().rstrip() + self._ssh_tmp_key_file =3D os.path.join(self._tmpdir, "id_rsa") + open(self._ssh_tmp_key_file, "w").write(self._config['ssh_key']) + subprocess.check_call(["chmod", "600", self._ssh_tmp_key_file]) + + self._ssh_tmp_pub_key_file =3D os.path.join(self._tmpdir, "id_rsa.= pub") + open(self._ssh_tmp_pub_key_file, + "w").write(self._config['ssh_pub_key']) =20 self.debug =3D args.debug self._stderr =3D sys.stderr @@ -84,11 +122,14 @@ class BaseVM(object): self._stdout =3D sys.stdout else: self._stdout =3D self._devnull + netdev =3D "user,id=3Dvnet,hostfwd=3D:127.0.0.1:{}-:22" self._args =3D [ \ - "-nodefaults", "-m", "4G", - "-cpu", "max", - "-netdev", "user,id=3Dvnet,hostfwd=3D:127.0.0.1:0-:22" + - (",ipv6=3Dno" if not self.ipv6 else ""), + "-nodefaults", "-m", self._config['memory'], + "-cpu", self._config['cpu'], + "-netdev", + netdev.format(self._config['ssh_port']) + + (",ipv6=3Dno" if not self.ipv6 else "") + + (",dns=3D" + self._config['dns'] if self._config['dns'] else "= "), "-device", "virtio-net-pci,netdev=3Dvnet", "-vnc", "127.0.0.1:0,to=3D20"] if args.jobs and args.jobs > 1: @@ -99,6 +140,55 @@ class BaseVM(object): logging.info("KVM not available, not using -enable-kvm") self._data_args =3D [] =20 + if self._config['qemu_args'] !=3D None: + qemu_args =3D self._config['qemu_args'] + qemu_args =3D qemu_args.replace('\n',' ').replace('\r','') + # shlex groups quoted arguments together + # we need this to keep the quoted args together for when + # the QEMU command is issued later. + args =3D shlex.split(qemu_args) + self._config['extra_args'] =3D [] + for arg in args: + if arg: + # Preserve quotes around arguments. + # shlex above takes them out, so add them in. + if " " in arg: + arg =3D '"{}"'.format(arg) + self._config['extra_args'].append(arg) + + def validate_ssh_keys(self): + """Check to see if the ssh key files exist.""" + if 'ssh_key_file' not in self._config or\ + not os.path.exists(self._config['ssh_key_file']): + raise Exception("ssh key file not found.") + if 'ssh_pub_key_file' not in self._config or\ + not os.path.exists(self._config['ssh_pub_key_file']): + raise Exception("ssh pub key file not found.") + + def wait_boot(self, wait_string=3DNone): + """Wait for the standard string we expect + on completion of a normal boot. + The user can also choose to override with an + alternate string to wait for.""" + if wait_string is None: + if self.login_prompt is None: + raise Exception("self.login_prompt not defined") + wait_string =3D self.login_prompt + # Intentionally bump up the default timeout under TCG, + # since the console wait below takes longer. + timeout =3D self.socket_timeout + if not kvm_available(self.arch): + timeout *=3D 8 + self.console_init(timeout=3Dtimeout) + self.console_wait(wait_string) + + def __getattr__(self, name): + # Support direct access to config by key. + # for example, access self._config['cpu'] by self.cpu + if name.lower() in self._config.keys(): + return self._config[name.lower()] + return object.__getattribute__(self, name) + def _download_with_cache(self, url, sha256sum=3DNone, sha512sum=3DNone= ): def check_sha256sum(fname): if not sha256sum: @@ -130,8 +220,9 @@ class BaseVM(object): "-t", "-o", "StrictHostKeyChecking=3Dno", "-o", "UserKnownHostsFile=3D" + os.devnull, - "-o", "ConnectTimeout=3D1", - "-p", self.ssh_port, "-i", self._ssh_key_file] + "-o", + "ConnectTimeout=3D{}".format(self._config["ssh_timeout"= ]), + "-p", self.ssh_port, "-i", self._ssh_tmp_key_file] # If not in debug mode, set ssh to quiet mode to # avoid printing the results of commands. if not self.debug: @@ -180,14 +271,14 @@ class BaseVM(object): "virtio-blk,drive=3D%s,serial=3D%s,bootindex= =3D1" % (name, name)] =20 def boot(self, img, extra_args=3D[]): - args =3D self._args + [ - "-drive", "file=3D%s,if=3Dnone,id=3Ddrive0,cache=3Dwriteback" = % img, - "-device", "virtio-blk,drive=3Ddrive0,bootindex=3D0"] - args +=3D self._data_args + extra_args + boot_dev =3D BOOT_DEVICE[self._config['boot_dev_type']] + boot_params =3D boot_dev.format(img) + args =3D self._args + boot_params.split(' ') + args +=3D self._data_args + extra_args + self._config['extra_args'] logging.debug("QEMU args: %s", " ".join(args)) qemu_path =3D get_qemu_path(self.arch, self._build_path) guest =3D QEMUMachine(binary=3Dqemu_path, args=3Dargs) - guest.set_machine('pc') + guest.set_machine(self._config['machine']) guest.set_console() try: guest.launch() @@ -301,7 +392,8 @@ class BaseVM(object): self.console_send(command) =20 def console_ssh_init(self, prompt, user, pw): - sshkey_cmd =3D "echo '%s' > .ssh/authorized_keys\n" % SSH_PUB_KEY.= rstrip() + sshkey_cmd =3D "echo '%s' > .ssh/authorized_keys\n" \ + % self._config['ssh_pub_key'].rstrip() self.console_wait_send("login:", "%s\n" % user) self.console_wait_send("Password:", "%s\n" % pw) self.console_wait_send(prompt, "mkdir .ssh\n") @@ -360,23 +452,23 @@ class BaseVM(object): "local-hostname: {}-guest\n".format(name)]) mdata.close() udata =3D open(os.path.join(cidir, "user-data"), "w") - print("guest user:pw {}:{}".format(self.GUEST_USER, - self.GUEST_PASS)) + print("guest user:pw {}:{}".format(self._config['guest_user'], + self._config['guest_pass'])) udata.writelines(["#cloud-config\n", "chpasswd:\n", " list: |\n", - " root:%s\n" % self.ROOT_PASS, - " %s:%s\n" % (self.GUEST_USER, - self.GUEST_PASS), + " root:%s\n" % self._config['root_pass'], + " %s:%s\n" % (self._config['guest_user'], + self._config['guest_pass']), " expire: False\n", "users:\n", - " - name: %s\n" % self.GUEST_USER, + " - name: %s\n" % self._config['guest_user'], " sudo: ALL=3D(ALL) NOPASSWD:ALL\n", " ssh-authorized-keys:\n", - " - %s\n" % SSH_PUB_KEY, + " - %s\n" % self._config['ssh_pub_key'], " - name: root\n", " ssh-authorized-keys:\n", - " - %s\n" % SSH_PUB_KEY, + " - %s\n" % self._config['ssh_pub_key'], "locale: en_US.UTF-8\n"]) proxy =3D os.environ.get("http_proxy") if not proxy is None: @@ -447,15 +539,17 @@ def parse_args(vmcls): parser.disable_interspersed_args() return parser.parse_args() =20 -def main(vmcls): +def main(vmcls, config=3DNone): try: + if config =3D=3D None: + config =3D {} args, argv =3D parse_args(vmcls) if not argv and not args.build_qemu and not args.build_image: print("Nothing to do?") return 1 logging.basicConfig(level=3D(logging.DEBUG if args.debug else logging.WARN)) - vm =3D vmcls(args) + vm =3D vmcls(args, config=3Dconfig) if args.build_image: if os.path.exists(args.image) and not args.force: sys.stderr.writelines(["Image file exists: %s\n" % args.im= age, --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837130; cv=none; d=zohomail.com; s=zohoarc; b=lrOtVxKq7+wfusfCJMqj9hRNecqzPFqnpj4S2rPynaj5MRKHi6cBd+OFPy8FmldZ6FAc0LQMVBZ9tZxvjwxUvXM/+n1abXGD0tixJVkQ85RmuW/SNb9VQgIRWwIfIkCxAmPNcSkKHvLF4oR+yPC1GFNM/GynfR8Fj9v7o+ii6SU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837130; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pGIpjP7qRP3HOQlOwPPW1ES/n6FIPKIld3S95ijuCnE=; b=aj+QXi4aQgPRhZKiZNCiimZAWuScKLVd7C1Qi+R0pggwgQvLmbMzlF++azXvE7cL8UHxD10UL5Xnx3OjpDL87vPcPqA++3n+BORMN75PpUS0DQGqgO5TnGISAbrm4N6CwzGQS6hv0UgJJf8wfLr49VDGWx+CdjrCZfBQgZvEZnE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837130606613.8041160595565; Mon, 22 Jun 2020 07:45:30 -0700 (PDT) Received: from localhost ([::1]:34188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNhR-0001PZ-KF for importer@patchew.org; Mon, 22 Jun 2020 10:45:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUh-0006wZ-Om for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:19 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUb-0005ec-OT for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:19 -0400 Received: by mail-wr1-x441.google.com with SMTP id a6so14952896wrm.4 for ; Mon, 22 Jun 2020 07:32:13 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w14sm18273942wrt.55.2020.06.22.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 22AC01FF90; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=pGIpjP7qRP3HOQlOwPPW1ES/n6FIPKIld3S95ijuCnE=; b=DZis4CAXG2iqBDuLCmUd6y2etihQE/tjUqAG8Xx6XP8Qukh0wUvytsE1ZbhLQW2pJs 8vGOyoxSUEHQH2kqaKJ+bSsd3FF4Tg1rT1dy/Bkkfk2jMFRTDieBxFxPwXueqEyALUeo EvJv5eELKXX7SCxy2WfCgw2U9phMe4aARedgwOf2buyvWzVt02mjcvFMkVzSCVEx6flH Eu8I0nRIytj1UcyqbSAw4OtRIHlmPB+tWCxF4Vlxu+oWLX9ubxSgk/XVZo/4uroVoqrU jVKOFBqCi4zcT2A5hqgnprR09J2g/sgHRLEnzprTPS9N1mjE5F4/MtWDhA4/0UE5ZYkn ECCA== 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=pGIpjP7qRP3HOQlOwPPW1ES/n6FIPKIld3S95ijuCnE=; b=nuCs5sQX2GbbMhbtkXgTgvZv+OUtElWgO/h+imP4ph/kLrh6YVxW0Rvatc8vSqeKkv MichJupaBIACwxTYcGsgO33qYUL7w+aljpFtKwwpQWAC5nbdfgZyQ9Vivb5hCRQUy3/M YVq7Z5MDND0aW7YEyl2c0P4j6ciiZseGvIqEL8OB2lOXN7YNqaZDf0NaUe68FYnSBQAF kRUBPL1sf9VMfWZtn2hElaERs4lCx179blYn2bxtPDP5p5GJckNg37web98NItHV3V0i nK8N4LAIS+1M0mpzzsLVWMjxq50CSQt4b2Gz5sULOIBjUc9IEIlfXXJKqrd2YUDDtFN+ IJpA== X-Gm-Message-State: AOAM533SQsZevLZ/E2lTdZkvoMLobq9JfES1JYwO5JxFg/Z4aAMVo6ST RHCrvZYuKkKE+KA/6a1TVO0sNg== X-Google-Smtp-Source: ABdhPJzegVhaGqZoR5DlHsHc1CJzS4eHo9TPVhicrW6vWAwbtinsmra7qinbeAaC8nCWdCrhe5qnRQ== X-Received: by 2002:adf:ded2:: with SMTP id i18mr19738123wrn.109.1592836332230; Mon, 22 Jun 2020 07:32:12 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 04/18] tests/vm: Added configuration file support Date: Mon, 22 Jun 2020 15:31:50 +0100 Message-Id: <20200622143204.12921-5-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley Changes to tests/vm/basevm.py to allow accepting a configuration file as a parameter. Allows for specifying VM options such as cpu, machine, memory, and arbitrary qemu arguments for specifying options such as NUMA configuration. Also added an example conf_example_aarch64.yml and conf_example_x86.yml. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-4-robert.foley@linaro.org> --- configure | 9 ++++++ tests/vm/Makefile.include | 6 ++++ tests/vm/basevm.py | 40 +++++++++++++++++++++++- tests/vm/conf_example_aarch64.yml | 51 +++++++++++++++++++++++++++++++ tests/vm/conf_example_x86.yml | 50 ++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 tests/vm/conf_example_aarch64.yml create mode 100644 tests/vm/conf_example_x86.yml diff --git a/configure b/configure index ba88fd18244..6d14f2c2d6c 100755 --- a/configure +++ b/configure @@ -958,6 +958,13 @@ do fi done =20 +# Check for existence of python3 yaml, needed to +# import yaml config files into vm-build. +python_yaml=3D"no" +if $(python3 -c "import yaml" 2> /dev/null); then + python_yaml=3D"yes" +fi + : ${smbd=3D${SMBD-/usr/sbin/smbd}} =20 # Default objcc to clang if available, otherwise use CC @@ -6751,6 +6758,7 @@ if test "$docs" !=3D "no"; then echo "sphinx-build $sphinx_build" fi echo "genisoimage $genisoimage" +echo "python_yaml $python_yaml" echo "slirp support $slirp $(echo_version $slirp $slirp_version)" if test "$slirp" !=3D "no" ; then echo "smbd $smbd" @@ -7830,6 +7838,7 @@ echo "PYTHON=3D$python" >> $config_host_mak echo "SPHINX_BUILD=3D$sphinx_build" >> $config_host_mak echo "SPHINX_WERROR=3D$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=3D$genisoimage" >> $config_host_mak +echo "PYTHON_YAML=3D$python_yaml" >> $config_host_mak echo "CC=3D$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "IASL=3D$iasl" >> $config_host_mak diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index a253aba4579..f6c3892bb28 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -44,6 +44,12 @@ endif @echo " QEMU_LOCAL=3D1 - Use QEMU binary local to this= build." @echo " QEMU=3D/path/to/qemu - Change path to QEMU binary" @echo " QEMU_IMG=3D/path/to/qemu-img - Change path to qemu-img tool" +ifeq ($(PYTHON_YAML),yes) + @echo " QEMU_CONFIG=3D/path/conf.yml - Change path to VM configurati= on .yml file." +else + @echo " (install python3-yaml to enable support for yaml file to confi= gure a VM.)" +endif + @echo " See conf_example_*.yml for file= format details." =20 vm-build-all: $(addprefix vm-build-, $(IMAGES)) =20 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index cfe20c58f7e..fa56fbbb4b6 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -481,7 +481,6 @@ class BaseVM(object): cwd=3Dcidir, stdin=3Dself._devnull, stdout=3Dself._stdout, stderr=3Dself._stdout) - return os.path.join(cidir, "cloud-init.iso") =20 def get_qemu_path(arch, build_path=3DNone): @@ -497,6 +496,41 @@ def get_qemu_path(arch, build_path=3DNone): qemu_path =3D "qemu-system-" + arch return qemu_path =20 +def parse_config(config, args): + """ Parse yaml config and populate our config structure. + The yaml config allows the user to override the + defaults for VM parameters. In many cases these + defaults can be overridden without rebuilding the VM.""" + if args.config: + config_file =3D args.config + elif 'QEMU_CONFIG' in os.environ: + config_file =3D os.environ['QEMU_CONFIG'] + else: + return config + if not os.path.exists(config_file): + raise Exception("config file {} does not exist".format(config_file= )) + # We gracefully handle importing the yaml module + # since it might not be installed. + # If we are here it means the user supplied a .yml file, + # so if the yaml module is not installed we will exit with error. + try: + import yaml + except ImportError: + print("The python3-yaml package is needed "\ + "to support config.yaml files") + # Instead of raising an exception we exit to avoid + # a raft of messy (expected) errors to stdout. + exit(1) + with open(config_file) as f: + yaml_dict =3D yaml.safe_load(f) + + if 'qemu-conf' in yaml_dict: + config.update(yaml_dict['qemu-conf']) + else: + raise Exception("config file {} is not valid"\ + " missing qemu-conf".format(config_file)) + return config + def parse_args(vmcls): =20 def get_default_jobs(): @@ -536,6 +570,9 @@ def parse_args(vmcls): help=3D"run tests with a snapshot") parser.add_option("--genisoimage", default=3D"genisoimage", help=3D"iso imaging tool") + parser.add_option("--config", "-c", default=3DNone, + help=3D"Provide config yaml for configuration. "\ + "See config_example.yaml for example.") parser.disable_interspersed_args() return parser.parse_args() =20 @@ -547,6 +584,7 @@ def main(vmcls, config=3DNone): if not argv and not args.build_qemu and not args.build_image: print("Nothing to do?") return 1 + config =3D parse_config(config, args) logging.basicConfig(level=3D(logging.DEBUG if args.debug else logging.WARN)) vm =3D vmcls(args, config=3Dconfig) diff --git a/tests/vm/conf_example_aarch64.yml b/tests/vm/conf_example_aarc= h64.yml new file mode 100644 index 00000000000..9d44ae356f7 --- /dev/null +++ b/tests/vm/conf_example_aarch64.yml @@ -0,0 +1,51 @@ +# +# Example yaml for use by any of the scripts in tests/vm. +# Can be provided as an environment variable QEMU_CONFIG +# +qemu-conf: + + # If any of the below are not provided, we will just use the qemu defa= ults. + + # Login username and password(has to be sudo enabled) + guest_user: qemu + guest_pass: "qemupass" + + # Password for root user can be different from guest. + root_pass: "qemupass" + + # If one key is provided, both must be provided. + #ssh_key: /complete/path/of/your/keyfile/id_rsa + #ssh_pub_key: /complete/path/of/your/keyfile/id_rsa.pub + + cpu: max + machine: virt,gic-version=3Dmax + memory: 16G + + # The below is a example for how to configure NUMA topology with + # 4 NUMA nodes and 2 different NUMA distances. + qemu_args: "-smp cpus=3D16,sockets=3D2,cores=3D8 + -numa node,cpus=3D0-3,nodeid=3D0 -numa node,cpus=3D4-7,nod= eid=3D1 + -numa node,cpus=3D8-11,nodeid=3D2 -numa node,cpus=3D12-15,= nodeid=3D3 + -numa dist,src=3D0,dst=3D1,val=3D15 -numa dist,src=3D2,dst= =3D3,val=3D15 + -numa dist,src=3D0,dst=3D2,val=3D20 -numa dist,src=3D0,dst= =3D3,val=3D20 + -numa dist,src=3D1,dst=3D2,val=3D20 -numa dist,src=3D1,dst= =3D3,val=3D20" + + # By default we do not set the DNS. + # You override the defaults by setting the below. + #dns: 1.234.567.89 + + # By default we will use a "block" device, but + # you can also boot from a "scsi" device. + # Just keep in mind your scripts might need to change + # As you will have /dev/sda instead of /dev/vda (for block device) + boot_dev_type: "block" + + # By default the ssh port is not fixed. + # A fixed ssh port makes it easier for automated tests. + #ssh_port: 5555 + + # To install a different set of packages, provide a command to issue + #install_cmds: "apt-get update ; apt-get build-dep -y qemu" + + # Or to skip the install entirely, just provide "" + #install_cmds: "" diff --git a/tests/vm/conf_example_x86.yml b/tests/vm/conf_example_x86.yml new file mode 100644 index 00000000000..78d3f5830fa --- /dev/null +++ b/tests/vm/conf_example_x86.yml @@ -0,0 +1,50 @@ +# +# Example yaml for use by any of the x86 based scripts in tests/vm. +# Can be provided as an environment variable QEMU_CONFIG +# +qemu-conf: + + # If any of the below are not provided, we will just use the qemu defa= ults. + + # Login username and password(has to be sudo enabled) + guest_user: "qemu" + guest_pass: "qemupass" + + # Password for root user can be different from guest. + root_pass: "qemupass" + + # Provide default ssh keys of current user. + # You need to edit the below for your user. + #ssh_key_file: /home//.ssh/id_rsa + #ssh_pub_key_file: /home//.ssh/id_rsa.pub + + cpu: max + machine: pc + memory: 8G + + # The below is a example for how to configure NUMA topology with + # 4 NUMA nodes and 2 different NUMA distances. + qemu_args: "-smp cpus=3D8,sockets=3D2,cores=3D4 + -object memory-backend-ram,size=3D4G,policy=3Dbind,host-no= des=3D0,id=3Dram-node0 + -object memory-backend-ram,size=3D4G,policy=3Dbind,host-no= des=3D0,id=3Dram-node1 + -object memory-backend-ram,size=3D4G,policy=3Dbind,host-no= des=3D1,id=3Dram-node2 + -object memory-backend-ram,size=3D4G,policy=3Dbind,host-no= des=3D1,id=3Dram-node3 + -numa node,cpus=3D0-1,nodeid=3D0 -numa node,cpus=3D2-3,nod= eid=3D1 + -numa node,cpus=3D4-5,nodeid=3D2 -numa node,cpus=3D6-7,nod= eid=3D3 + -numa dist,src=3D0,dst=3D1,val=3D15 -numa dist,src=3D2,dst= =3D3,val=3D15 + -numa dist,src=3D0,dst=3D2,val=3D20 -numa dist,src=3D0,dst= =3D3,val=3D20 + -numa dist,src=3D1,dst=3D2,val=3D20 -numa dist,src=3D1,dst= =3D3,val=3D20" + + # By default we do not set the DNS. + # You override the defaults by setting the below. + #dns: "1.234.567.89" + + # By default we will use a "block" device, but + # you can also boot from a "scsi" device. + # Just keep in mind your scripts might need to change + # As you will have /dev/sda instead of /dev/vda (for block device) + boot_dev_type: "block" + + # By default the ssh port is not fixed. + # A fixed ssh port makes it easier for automated tests. + ssh_port: 5555 --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836462; cv=none; d=zohomail.com; s=zohoarc; b=mitGPofjzUBlC4FaDasM39TlWZHV5JszUyQvxGzkzJAM8QT4rv/mpU1CLT/lu5xFlsXjsbXR30MeFCJF72z7h7Yn7WzUBoxKE5S8+Sl5HFJSXRz9XVhhPCm+fG67ddMVyolHRX4Ow4dADqvYjL8qr2Ua5kBywyAAFpG9OR6ECpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836462; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yfaWvkBHiSQ15nCnLOaiCfwwNxNyBgCuiCJ/EYYdU+8=; b=SDJbTN0zHqjbeUfa+xjh2OZqLWivjAMrakZ4TQoEnjVXTCp4o/OkX2Zs5t+IN8Kyv7B2JanKeWV9TljMbkHUAOdEbISpAeFWErbnMGC+iMQI6Yf3sH39sBRMRCO+zOOMHLM4i4elcOtfqlf3YCgWvMF/16ripntboCzh+oogZEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15928364627621023.3264091323178; Mon, 22 Jun 2020 07:34:22 -0700 (PDT) Received: from localhost ([::1]:51320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNWf-0000ET-DH for importer@patchew.org; Mon, 22 Jun 2020 10:34:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUg-0006vn-8p for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:18 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:33186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUd-0005eu-Sw for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:17 -0400 Received: by mail-wr1-x42e.google.com with SMTP id l11so16942929wru.0 for ; Mon, 22 Jun 2020 07:32:15 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v20sm18654864wrb.51.2020.06.22.07.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3BDB11FF91; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=yfaWvkBHiSQ15nCnLOaiCfwwNxNyBgCuiCJ/EYYdU+8=; b=SEir2Ahmo7Nd8yYiRd1WY5NTq6XP8EapsZxIfXHKNxxTIH4rVqBKKe+lqTPduXe/aB GJcuInCEAuGbIuxTUT5opCJYtM+gLX5EzbvZ8dpV0amp1aqGid/NT5xzD+8Fi59HZDkl c5fa6gQZQN4HdR9t8Tz7XpvW/wq6BNV2pN31BrmEq9fza7BZJb/C6lPG75LI1ZAJWzzM nOJV0oRsV/VCsqlpFyGN0aajuwrE7TYZGhkA3ejQUr7FRCRBArZuzScFX+ZqU/Ah8pft IRvEffzjCrM/aezdP+1Qjw7FXfCr3Sc2LeLgESQSEi+kVp4yA5b666OgwJQbR703zD3C ejEQ== 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=yfaWvkBHiSQ15nCnLOaiCfwwNxNyBgCuiCJ/EYYdU+8=; b=DZdTIXg/HadSrWOkXeK4N+8BpYNumUfbXvvdDtkhq4EonSx4oTgxc3dzbgohVjDIfG 3qnQtTgAfUaf4xbI9o/Xshond5zCVTjBgnbtQxpLgXSmTgL7D9NatCJm/x3Js3sHL+bL ohxH2q9vSGQj5gToSqpJdUIJgdI7fXcLqXvTb7cQYVaI419iQDjOeZuu65lpSFmnFw5C 8irrZjIbk1gvr2Z3bkzZgbXiOS+DMY6Hq7ZiK9YufIWN9+ul1qfsGo/MeUcWzQrOccrJ PM/XlPiXNFba955y8miMxwarHGgPuXcWszDsH7j4LTlClpu9q6MMub9VBLs+Jq2zHHdF 55Eg== X-Gm-Message-State: AOAM533zpFlqyadootKqoMGUF7QcNFUYeeXyQsg4i/0tQeVoV6bGpQOP XvPBmQJQVTD3BbxO03NKAXUXISI4y20= X-Google-Smtp-Source: ABdhPJwYHQcPL2toOToigrRr178+6cFvpKM8wpnjdasMqS4n/aHvaayMXVt+USBCSt+ed5hBivo+sw== X-Received: by 2002:a5d:4687:: with SMTP id u7mr4093252wrq.357.1592836334123; Mon, 22 Jun 2020 07:32:14 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 05/18] tests/vm: Add common Ubuntu python module Date: Mon, 22 Jun 2020 15:31:51 +0100 Message-Id: <20200622143204.12921-6-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.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?Philippe=20Mathieu-Daud=C3=A9?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley Add a common Ubuntu python module and make use of it with the ubuntu.i386 script. This is preparation for adding an Ubuntu script ubuntu.aarch64. Splitting out the common logic such as build_image() will reduce duplication. Signed-off-by: Robert Foley Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-5-robert.foley@linaro.org> --- tests/vm/ubuntu.i386 | 46 +++++++++------------------------ tests/vm/ubuntuvm.py | 60 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 34 deletions(-) create mode 100644 tests/vm/ubuntuvm.py diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index 24527cc78c7..5ce72610a6c 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -11,15 +11,22 @@ # the COPYING file in the top-level directory. # =20 -import os import sys -import subprocess import basevm -import time +import ubuntuvm =20 -class UbuntuX86VM(basevm.BaseVM): +DEFAULT_CONFIG =3D { + 'install_cmds' : "apt-get update,"\ + "apt-get build-dep -y qemu,"\ + "apt-get install -y libfdt-dev language-pack-en", +} + +class UbuntuX86VM(ubuntuvm.UbuntuVM): name =3D "ubuntu.i386" arch =3D "i386" + image_link=3D"https://cloud-images.ubuntu.com/releases/bionic/"\ + "release-20191114/ubuntu-18.04-server-cloudimg-i386.img" + image_sha256=3D"28969840626d1ea80bb249c08eef1a4533e8904aa51a327b40f37a= c4b4ff04ef" BUILD_SCRIPT =3D """ set -e; cd $(mktemp -d); @@ -29,34 +36,5 @@ class UbuntuX86VM(basevm.BaseVM): make --output-sync {target} -j{jobs} {verbose}; """ =20 - def build_image(self, img): - cimg =3D self._download_with_cache( - "https://cloud-images.ubuntu.com/releases/bionic/release-20191= 114/ubuntu-18.04-server-cloudimg-i386.img", - sha256sum=3D"28969840626d1ea80bb249c08eef1a4533e8904aa51a327b4= 0f37ac4b4ff04ef") - img_tmp =3D img + ".tmp" - subprocess.check_call(["cp", "-f", cimg, img_tmp]) - self.exec_qemu_img("resize", img_tmp, "50G") - self.boot(img_tmp, extra_args =3D [ - "-device", "VGA", - "-cdrom", self.gen_cloud_init_iso() - ]) - self.wait_ssh() - self.ssh_root_check("touch /etc/cloud/cloud-init.disabled") - self.ssh_root_check("apt-get update") - self.ssh_root_check("apt-get install -y cloud-initramfs-growroot") - # Don't check the status in case the guest hang up too quickly - self.ssh_root("sync && reboot") - time.sleep(5) - self.wait_ssh() - # The previous update sometimes doesn't survive a reboot, so do it= again - self.ssh_root_check("sed -ie s/^#\ deb-src/deb-src/g /etc/apt/sour= ces.list") - self.ssh_root_check("apt-get update") - self.ssh_root_check("apt-get build-dep -y qemu") - self.ssh_root_check("apt-get install -y libfdt-dev language-pack-e= n") - self.ssh_root("poweroff") - self.wait() - os.rename(img_tmp, img) - return 0 - if __name__ =3D=3D "__main__": - sys.exit(basevm.main(UbuntuX86VM)) + sys.exit(basevm.main(UbuntuX86VM, DEFAULT_CONFIG)) diff --git a/tests/vm/ubuntuvm.py b/tests/vm/ubuntuvm.py new file mode 100644 index 00000000000..6689ad87aa8 --- /dev/null +++ b/tests/vm/ubuntuvm.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# +# Ubuntu VM testing library +# +# Copyright 2017 Red Hat Inc. +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.i386 Fam Zheng +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. + +import os +import subprocess +import basevm + +class UbuntuVM(basevm.BaseVM): + + def __init__(self, args, config=3DNone): + self.login_prompt =3D "ubuntu-{}-guest login:".format(self.arch) + basevm.BaseVM.__init__(self, args, config) + + def build_image(self, img): + """Build an Ubuntu VM image. The child class will + define the install_cmds to init the VM.""" + os_img =3D self._download_with_cache(self.image_link, + sha256sum=3Dself.image_sha256) + img_tmp =3D img + ".tmp" + subprocess.check_call(["cp", "-f", os_img, img_tmp]) + self.exec_qemu_img("resize", img_tmp, "+50G") + ci_img =3D self.gen_cloud_init_iso() + + self.boot(img_tmp, extra_args =3D [ "-device", "VGA", "-cdrom", ci= _img, ]) + + # First command we issue is fix for slow ssh login. + self.wait_ssh(wait_root=3DTrue, + cmd=3D"chmod -x /etc/update-motd.d/*") + # Wait for cloud init to finish + self.wait_ssh(wait_root=3DTrue, + cmd=3D"ls /var/lib/cloud/instance/boot-finished") + self.ssh_root("touch /etc/cloud/cloud-init.disabled") + # Disable auto upgrades. + # We want to keep the VM system state stable. + self.ssh_root('sed -ie \'s/"1"/"0"/g\' '\ + '/etc/apt/apt.conf.d/20auto-upgrades') + self.ssh_root("sed -ie s/^#\ deb-src/deb-src/g /etc/apt/sources.li= st") + + # If the user chooses not to do the install phase, + # then we will jump right to the graceful shutdown + if self._config['install_cmds'] !=3D "": + # Issue the install commands. + # This can be overriden by the user in the config .yml. + install_cmds =3D self._config['install_cmds'].split(',') + for cmd in install_cmds: + self.ssh_root(cmd) + self.graceful_shutdown() + os.rename(img_tmp, img) + return 0 --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836782; cv=none; d=zohomail.com; s=zohoarc; b=IiJY21nHnzwWdl/1/lRRb9NPVDax9NriQ4F1fzbIJ/AUwr193wogfCAYmMa4mtpPSfc8aL9X7SP/Evgb0cuqe83LgpLpn16tzAN3EEMN3yIsg1RSyn7tS4SjAfahRODhIv/aafDiAQSSLnHMsjc41fMAqQGTKTGSU3uluOj1xYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836782; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jbHRXShDrv/4W9ykS91A4mqd/64E3Bx1bZyQFn8BAsA=; b=UkttWgFlemYwdYI8foYDZw+OZ/3AVku41Ru+CEqoYFWSI+ipb7xrqpWc4KglVSs2I/ED/UU6msHW82RiVMd1l4Ruu0as6CSkzlFxg78GoRldSPJB5ww59nOU32SE+trTtPx2mGlfHMqRgdng/ZWX8Yx6l1z+sW6dhXFcvbf3E54= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836782764982.1187878921677; Mon, 22 Jun 2020 07:39:42 -0700 (PDT) Received: from localhost ([::1]:43100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNbp-0000kk-N8 for importer@patchew.org; Mon, 22 Jun 2020 10:39:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUi-0006xT-NS for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:20 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUe-0005fC-Tw for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:20 -0400 Received: by mail-wr1-x435.google.com with SMTP id l11so16943010wru.0 for ; Mon, 22 Jun 2020 07:32:16 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t125sm5191848wmf.10.2020.06.22.07.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 599FE1FF92; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=jbHRXShDrv/4W9ykS91A4mqd/64E3Bx1bZyQFn8BAsA=; b=cbSKRDjXX7uEIvHzzX8XukmK7CaRCucNNUXYkaVYT3zVm+tcSi/qoaXHyOg586kbhw X4IjYyeeAHPb4oqU+UrFv0nAbO7yAdsUyZvFJcIgpbgRdXd02hxmDAXcQZGU/MXBkhsl SMOOQHdZSW8dVjlnMcwx9KcjapgV0dwSxd9h5MvrVX3KC+Fdg/whyKCOAvNQq5k8Xhf1 cMAk1WIZjmtiF9OUIw5JCtZMhMUAM0oxgNlFyFsHD4vy8h9RsFt/DDxOKKdhR+clq7/7 NJ/rdIfpQVt50FAxtMXnnDpRfgFh10E1WozAIVbiL49A2yet8KmJs0p3uWrnRhB1dwBB KciA== 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=jbHRXShDrv/4W9ykS91A4mqd/64E3Bx1bZyQFn8BAsA=; b=Sp5xzmkryJbdFGVJNVnkGqh3Z4Idlaw9N2H6kgWYuTN3rfKKrYfpJibTuEarwC4tYy B9MvrF2il/sESNuLPvN5ruH89BCu1Ubx5yDmfQOjHL0N8tEToMM8HefbcRec4wrvrniU t/G7CVPEmky2lxJF4H1UmFP5myK0UdvEVXsqlBJIpv+2pcQOQyaWoOrt7p7vSp9BoAtr ChguTMxLANx/cd2NKplnNqMdW82M/2QnirVGulSx5jttkwPMUaQflltF+G+eWPRk8vuq AO4A+rhiDuWCdgpHp7rXDhyUfv4APYV7/iQ9owPj1RsoqZf6e6sCNSSNgZTGpaULGuIC lMWA== X-Gm-Message-State: AOAM531UiL9qDZ88PVUwpPCp7XQ8rJ3NYX5SvpmZoskvGL7G+FagKNtU K3A9pOwMuOM5w/HePnHzBCzCkA== X-Google-Smtp-Source: ABdhPJzb76eisKSlQEjcmebAi0Cf+H6i3Fev0t9v8JdXEOeNYVv2/ewS4hv5jMVNuu2fC60naiBQPQ== X-Received: by 2002:adf:ef8a:: with SMTP id d10mr9976062wro.126.1592836335103; Mon, 22 Jun 2020 07:32:15 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 06/18] tests/vm: Added a new script for ubuntu.aarch64. Date: Mon, 22 Jun 2020 15:31:52 +0100 Message-Id: <20200622143204.12921-7-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley ubuntu.aarch64 provides a script to create an Ubuntu 18.04 VM. Another new file is also added aarch64vm.py, which is a module with common methods used by aarch64 VMs, such as how to create the flash images. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-6-robert.foley@linaro.org> --- configure | 20 +++++++ tests/vm/Makefile.include | 11 ++++ tests/vm/aarch64vm.py | 106 ++++++++++++++++++++++++++++++++++++++ tests/vm/basevm.py | 12 +++++ tests/vm/ubuntu.aarch64 | 68 ++++++++++++++++++++++++ 5 files changed, 217 insertions(+) create mode 100644 tests/vm/aarch64vm.py create mode 100755 tests/vm/ubuntu.aarch64 diff --git a/configure b/configure index 6d14f2c2d6c..b4420e0c2a2 100755 --- a/configure +++ b/configure @@ -417,6 +417,7 @@ prefix=3D"/usr/local" mandir=3D"\${prefix}/share/man" datadir=3D"\${prefix}/share" firmwarepath=3D"\${prefix}/share/qemu-firmware" +efi_aarch64=3D"" qemu_docdir=3D"\${prefix}/share/doc/qemu" bindir=3D"\${prefix}/bin" libdir=3D"\${prefix}/lib" @@ -1107,6 +1108,8 @@ for opt do ;; --firmwarepath=3D*) firmwarepath=3D"$optarg" ;; + --efi-aarch64=3D*) efi_aarch64=3D"$optarg" + ;; --host=3D*|--build=3D*|\ --disable-dependency-tracking|\ --sbindir=3D*|--sharedstatedir=3D*|\ @@ -1777,6 +1780,7 @@ Advanced options (experts only): --sysconfdir=3DPATH install config in PATH$confsuffix --localstatedir=3DPATH install local state in PATH (set at runtime o= n win32) --firmwarepath=3DPATH search PATH for firmware files + --efi-aarch64=3DPATH PATH of efi file to use for aarch64 VMs. --with-confsuffix=3DSUFFIX suffix for QEMU data inside datadir/libdir/sy= sconfdir [$confsuffix] --with-pkgversion=3DVERS use specified string as sub-version of the pa= ckage --enable-debug enable common debug build options @@ -3593,6 +3597,20 @@ EOF fi fi =20 +############################################ +# efi-aarch64 probe +# Check for efi files needed by aarch64 VMs. +# By default we will use the efi included with QEMU. +# Allow user to override the path for efi also. +if ! test -f "$efi_aarch64"; then + if test -f $source_path/pc-bios/edk2-aarch64-code.fd.bz2; then + # valid after build + efi_aarch64=3D$PWD/pc-bios/edk2-aarch64-code.fd + else + efi_aarch64=3D"" + fi +fi + ########################################## # libcap-ng library probe if test "$cap_ng" !=3D "no" ; then @@ -6758,6 +6776,7 @@ if test "$docs" !=3D "no"; then echo "sphinx-build $sphinx_build" fi echo "genisoimage $genisoimage" +echo "efi_aarch64 $efi_aarch64" echo "python_yaml $python_yaml" echo "slirp support $slirp $(echo_version $slirp $slirp_version)" if test "$slirp" !=3D "no" ; then @@ -7838,6 +7857,7 @@ echo "PYTHON=3D$python" >> $config_host_mak echo "SPHINX_BUILD=3D$sphinx_build" >> $config_host_mak echo "SPHINX_WERROR=3D$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=3D$genisoimage" >> $config_host_mak +echo "EFI_AARCH64=3D$efi_aarch64" >> $config_host_mak echo "PYTHON_YAML=3D$python_yaml" >> $config_host_mak echo "CC=3D$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index f6c3892bb28..4fa292765d5 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -5,6 +5,9 @@ IMAGES :=3D freebsd netbsd openbsd centos fedora ifneq ($(GENISOIMAGE),) IMAGES +=3D ubuntu.i386 centos +ifneq ($(EFI_AARCH64),) +IMAGES +=3D ubuntu.aarch64 +endif endif =20 IMAGES_DIR :=3D $(HOME)/.cache/qemu-vm/images @@ -23,6 +26,11 @@ vm-help vm-test: ifneq ($(GENISOIMAGE),) @echo " vm-build-centos - Build QEMU in CentOS VM, with = Docker" @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" +ifneq ($(EFI_AARCH64),) + @echo " vm-build-ubuntu.aarch64 - Build QEMU in ubuntu aarch64 V= M" +else + @echo " (to build centos/ubuntu aarch64 images use configure --efi-aarch= 64)" +endif else @echo " (install genisoimage to build centos/ubuntu images)" endif @@ -65,6 +73,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(if $(V)$(DEBUG), --debug) \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --image "$@" \ --force \ --build-image $@, \ @@ -80,6 +89,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(J),--jobs $(J)) \ $(if $(V),--verbose) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ @@ -102,6 +112,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(if $(J),--jobs $(J)) \ $(if $(V)$(DEBUG), --debug) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --image "$<" \ --interactive \ false, \ diff --git a/tests/vm/aarch64vm.py b/tests/vm/aarch64vm.py new file mode 100644 index 00000000000..bb04cb19c91 --- /dev/null +++ b/tests/vm/aarch64vm.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# +# VM testing aarch64 library +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# +import os +import sys +import subprocess +import basevm +from qemu.accel import kvm_available + +# This is the config needed for current version of QEMU. +# This works for both kvm and tcg. +CURRENT_CONFIG =3D { + 'cpu' : "max", + 'machine' : "virt,gic-version=3Dmax", +} + +# The minimum minor version of QEMU we will support with aarch64 VMs is 3. +# QEMU versions less than 3 have various issues running these VMs. +QEMU_AARCH64_MIN_VERSION =3D 3 + +# The DEFAULT_CONFIG will default to a version of +# parameters that works for backwards compatibility. +DEFAULT_CONFIG =3D {'kvm' : {'cpu' : "host", + 'machine' : "virt,gic-version=3Dhost"}, + 'tcg' : {'cpu' : "cortex-a57", + 'machine' : "virt"}, +} + +def get_config_defaults(vmcls, default_config): + """Fetch the configuration defaults for this VM, + taking into consideration the defaults for + aarch64 first, followed by the defaults for this VM.""" + config =3D default_config + config.update(aarch_get_config_defaults(vmcls)) + return config + +def aarch_get_config_defaults(vmcls): + """Set the defaults for current version of QEMU.""" + config =3D CURRENT_CONFIG + args, argv =3D basevm.parse_args(vmcls) + qemu_path =3D basevm.get_qemu_path(vmcls.arch, args.build_path) + qemu_version =3D basevm.get_qemu_version(qemu_path) + if qemu_version < QEMU_AARCH64_MIN_VERSION: + error =3D "\nThis major version of QEMU {} is to old for aarch64 V= Ms.\n"\ + "The major version must be at least {}.\n"\ + "To continue with the current build of QEMU, "\ + "please restart with QEMU_LOCAL=3D1 .\n" + print(error.format(qemu_version, QEMU_AARCH64_MIN_VERSION)) + exit(1) + if qemu_version =3D=3D QEMU_AARCH64_MIN_VERSION: + # We have an older version of QEMU, + # set the config values for backwards compatibility. + if kvm_available('aarch64'): + config.update(DEFAULT_CONFIG['kvm']) + else: + config.update(DEFAULT_CONFIG['tcg']) + return config + +def create_flash_images(flash_dir=3D"./", efi_img=3D""): + """Creates the appropriate pflash files + for an aarch64 VM.""" + flash0_path =3D get_flash_path(flash_dir, "flash0") + flash1_path =3D get_flash_path(flash_dir, "flash1") + fd_null =3D open(os.devnull, 'w') + subprocess.check_call(["dd", "if=3D/dev/zero", "of=3D{}".format(flash0= _path), + "bs=3D1M", "count=3D64"], + stdout=3Dfd_null, stderr=3Dsubprocess.STDOUT) + # A reliable way to get the QEMU EFI image is via an installed package= or + # via the bios included with qemu. + if not os.path.exists(efi_img): + sys.stderr.write("*** efi argument is invalid ({})\n".format(efi_i= mg)) + sys.stderr.write("*** please check --efi-aarch64 argument or "\ + "install qemu-efi-aarch64 package\n") + exit(3) + subprocess.check_call(["dd", "if=3D{}".format(efi_img), + "of=3D{}".format(flash0_path), + "conv=3Dnotrunc"], + stdout=3Dfd_null, stderr=3Dsubprocess.STDOUT) + subprocess.check_call(["dd", "if=3D/dev/zero", + "of=3D{}".format(flash1_path), + "bs=3D1M", "count=3D64"], + stdout=3Dfd_null, stderr=3Dsubprocess.STDOUT) + fd_null.close() + +def get_pflash_args(flash_dir=3D"./"): + """Returns a string that can be used to + boot qemu using the appropriate pflash files + for aarch64.""" + flash0_path =3D get_flash_path(flash_dir, "flash0") + flash1_path =3D get_flash_path(flash_dir, "flash1") + pflash_args_str =3D "-drive file=3D{},format=3Draw,if=3Dpflash "\ + "-drive file=3D{},format=3Draw,if=3Dpflash" + pflash_args =3D pflash_args_str.format(flash0_path, flash1_path) + return pflash_args.split(" ") + +def get_flash_path(flash_dir, name): + return os.path.join(flash_dir, "{}.img".format(name)) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index fa56fbbb4b6..5fd66f6b26a 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -92,6 +92,7 @@ class BaseVM(object): self._guest =3D None self._genisoimage =3D args.genisoimage self._build_path =3D args.build_path + self._efi_aarch64 =3D args.efi_aarch64 # Allow input config to override defaults. self._config =3D DEFAULT_CONFIG.copy() if config !=3D None: @@ -496,6 +497,14 @@ def get_qemu_path(arch, build_path=3DNone): qemu_path =3D "qemu-system-" + arch return qemu_path =20 +def get_qemu_version(qemu_path): + """Get the version number from the current QEMU, + and return the major number.""" + output =3D subprocess.check_output([qemu_path, '--version']) + version_line =3D output.decode("utf-8") + version_num =3D re.split(' |\(', version_line)[3].split('.')[0] + return int(version_num) + def parse_config(config, args): """ Parse yaml config and populate our config structure. The yaml config allows the user to override the @@ -573,6 +582,9 @@ def parse_args(vmcls): parser.add_option("--config", "-c", default=3DNone, help=3D"Provide config yaml for configuration. "\ "See config_example.yaml for example.") + parser.add_option("--efi-aarch64", + default=3D"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", + help=3D"Path to efi image for aarch64 VMs.") parser.disable_interspersed_args() return parser.parse_args() =20 diff --git a/tests/vm/ubuntu.aarch64 b/tests/vm/ubuntu.aarch64 new file mode 100755 index 00000000000..21d454c27f1 --- /dev/null +++ b/tests/vm/ubuntu.aarch64 @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 +# +# Ubuntu aarch64 image +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.i386 Fam Zheng +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import sys +import basevm +import aarch64vm +import ubuntuvm + +DEFAULT_CONFIG =3D { + 'cpu' : "cortex-a57", + 'machine' : "virt,gic-version=3D3", + 'install_cmds' : "apt-get update,"\ + "apt-get build-dep -y --arch-only qemu,"\ + "apt-get install -y libfdt-dev pkg-config language-pa= ck-en", + # We increase beyond the default time since during boot + # it can take some time (many seconds) to log into the VM + # especially using softmmu. + 'ssh_timeout' : 60, +} + +class UbuntuAarch64VM(ubuntuvm.UbuntuVM): + name =3D "ubuntu.aarch64" + arch =3D "aarch64" + image_name =3D "ubuntu-18.04-server-cloudimg-arm64.img" + image_link =3D "https://cloud-images.ubuntu.com/releases/18.04/release= /" + image_name + image_sha256=3D"0fdcba761965735a8a903d8b88df8e47f156f48715c00508e4315c= 506d7d3cb1" + BUILD_SCRIPT =3D """ + set -e; + cd $(mktemp -d); + sudo chmod a+r /dev/vdb; + tar --checkpoint=3D.10 -xf /dev/vdb; + ./configure {configure_opts}; + make --output-sync {target} -j{jobs} {verbose}; + """ + def boot(self, img, extra_args=3DNone): + aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64) + default_args =3D aarch64vm.get_pflash_args(self._tmpdir) + if extra_args: + extra_args.extend(default_args) + else: + extra_args =3D default_args + # We always add these performance tweaks + # because without them, we boot so slowly that we + # can time out finding the boot efi device. + if '-smp' not in extra_args and \ + '-smp' not in self._config['extra_args'] and \ + '-smp' not in self._args: + # Only add if not already there to give caller option to chang= e it. + extra_args.extend(["-smp", "8"]) + + # We have overridden boot() since aarch64 has additional parameter= s. + # Call down to the base class method. + super(UbuntuAarch64VM, self).boot(img, extra_args=3Dextra_args) + +if __name__ =3D=3D "__main__": + defaults =3D aarch64vm.get_config_defaults(UbuntuAarch64VM, DEFAULT_CO= NFIG) + sys.exit(basevm.main(UbuntuAarch64VM, defaults)) --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837365; cv=none; d=zohomail.com; s=zohoarc; b=K2ojmStskfRlcALlw/Q5D0q0TWu85dbTYSAfqOIBgrDzNMlzxKjZvtZi3WPXMNCe/mEYk9/iRiCn+sEYBbJJZXHOeos8GeAIv1AxPniGYItlG4OTyLjnnKJc+dxQqdJgwXysnal4JiFdYVEQjSL6vz61g/Xr9OMNsR+Xe195Vkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837365; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kdMIZtPe+aZda1/mXQW7aQb8KseTM0tT+oUaOxEz8I4=; b=VbkPuKOkMPVFt4cebobQuRDQT9iWYxwHTDi7BOY/065gYi6J1KNtOAjF6pyDRrdMw6q1GutdkQtTCP8lmVgnamHdL6zJtDUsOftENPOjMDEO6C2OWOZyEPqs6HhR3EJZEXLM0EKe29sBNbrXvq1v9UIyfnPYRTUvO7JngTcVOMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837365651444.49673952202977; Mon, 22 Jun 2020 07:49:25 -0700 (PDT) Received: from localhost ([::1]:49120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNlE-0000rA-Oa for importer@patchew.org; Mon, 22 Jun 2020 10:49:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUl-00071a-CB for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:23 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:39054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUg-0005fV-7D for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:23 -0400 Received: by mail-wm1-x32b.google.com with SMTP id t194so15955171wmt.4 for ; Mon, 22 Jun 2020 07:32:17 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 1sm12407654wmf.21.2020.06.22.07.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 74E051FF93; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=kdMIZtPe+aZda1/mXQW7aQb8KseTM0tT+oUaOxEz8I4=; b=RORXMQdBX7FXwpQMA4TazBP6tW5Af4DhJWsMXMtl/eIwkKj7Zv+OJM0tQ09wFgEB7r Aw6O5xOaNHsuF0lsLf94bs6h8A+g7FL+p25qRUIKcJXN9QHCr19iFLXK1SVmvP/0GWhf EFm1uK6H7D2/i9RluukpSF9lGGh/UQqpTTyVNvmNUZjGCXHFz0CkloTD5Fj3ZE1pFK4Q G/QQePX82foNpYB8tIrFt3KB3e2FnEs5ElwHGZCHasDohkejAiwNkjCh6uAOsbEkM4kk /ibUoQM6v5xaKN3h+U/8gF2LHUCokAMD7C0RtPnxxwycxbFNTt7Fzqzi3F0ybskxFJnT Q5mA== 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=kdMIZtPe+aZda1/mXQW7aQb8KseTM0tT+oUaOxEz8I4=; b=Xuc9FOUBYH48Y4jHHKe4D0k6RbLsWf64hKyPGxTGEtJA5ng9co6LSA/qQNnnZj/LVB IFjQBX9wWALYl7igqh5OFL8LMp/MkwiOLiQI7PCvKaaUQUN6hblNXzrwzHLULF3zmD9Q 5HyjY7hih5tSjcBD2jTs2DOkTG6janQs5raPFUxy52AaLU4KI3a1eV1WqTSzr7KjD99C QDCkL6VB99QBnljiql09A2JX8g5kWiJmm3OqxhBO1js85DhdtTV6DEC8dpOTbZJrYnkN Rohqu10OxCgLziYu/mif8OO9X2cbU1gMIvfn9d8fx6L/xdxQNQ0tLN/IOKdnu7Cns+/n EBpA== X-Gm-Message-State: AOAM533nRnLqcLdEnVWyYznFa6z5jUJV0vdEpfaiqPj+QbH7NV/wiXMc 2NoWsIpYBGecMhPWK0ckxsfIYg== X-Google-Smtp-Source: ABdhPJzdYf5FpSu7oXCYqdkDYWMIeC3oEqkGdCKZb2q9bwD4M8H0IFYmfUbVYEgfuzdPvtmqgJTtFw== X-Received: by 2002:a05:600c:21d7:: with SMTP id x23mr19714500wmj.95.1592836336500; Mon, 22 Jun 2020 07:32:16 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/18] tests/vm: Added a new script for centos.aarch64. Date: Mon, 22 Jun 2020 15:31:53 +0100 Message-Id: <20200622143204.12921-8-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley centos.aarch64 creates a CentOS 8 image. Also added a new kickstart script used to build the centos.aarch64 image. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-7-robert.foley@linaro.org> --- tests/vm/Makefile.include | 3 +- tests/vm/centos-8-aarch64.ks | 51 ++++++++ tests/vm/centos.aarch64 | 227 +++++++++++++++++++++++++++++++++++ 3 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 tests/vm/centos-8-aarch64.ks create mode 100755 tests/vm/centos.aarch64 diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 4fa292765d5..39f918a430a 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -6,7 +6,7 @@ IMAGES :=3D freebsd netbsd openbsd centos fedora ifneq ($(GENISOIMAGE),) IMAGES +=3D ubuntu.i386 centos ifneq ($(EFI_AARCH64),) -IMAGES +=3D ubuntu.aarch64 +IMAGES +=3D ubuntu.aarch64 centos.aarch64 endif endif =20 @@ -28,6 +28,7 @@ ifneq ($(GENISOIMAGE),) @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" ifneq ($(EFI_AARCH64),) @echo " vm-build-ubuntu.aarch64 - Build QEMU in ubuntu aarch64 V= M" + @echo " vm-build-centos.aarch64 - Build QEMU in CentOS aarch64 V= M" else @echo " (to build centos/ubuntu aarch64 images use configure --efi-aarch= 64)" endif diff --git a/tests/vm/centos-8-aarch64.ks b/tests/vm/centos-8-aarch64.ks new file mode 100644 index 00000000000..fd6ebe4d49e --- /dev/null +++ b/tests/vm/centos-8-aarch64.ks @@ -0,0 +1,51 @@ +# CentOS aarch64 image kickstart file. +# This file is used by the CentOS installer to +# script the generation of the image. +# +# Copyright 2020 Linaro +# +ignoredisk --only-use=3Dvda +# System bootloader configuration +bootloader --append=3D" crashkernel=3Dauto" --location=3Dmbr --boot-drive= =3Dvda +autopart --type=3Dplain +# Partition clearing information +clearpart --linux --initlabel --drives=3Dvda +# Use text mode install +text +repo --name=3D"AppStream" --baseurl=3Dfile:///run/install/repo/AppStream +# Use CDROM installation media +cdrom +# Keyboard layouts +keyboard --vckeymap=3Dus --xlayouts=3D'' +# System language +lang en_US.UTF-8 + +# Network information +network --bootproto=3Ddhcp --device=3Denp0s1 --onboot=3Doff --ipv6=3Dauto= --no-activate +network --hostname=3Dlocalhost.localdomain +# Run the Setup Agent on first boot +firstboot --enable +# Do not configure the X Window System +skipx +# System services +services --enabled=3D"chronyd" +# System timezone +timezone America/New_York --isUtc + +# Shutdown after installation is complete. +shutdown + +%packages +@^server-product-environment +kexec-tools + +%end + +%addon com_redhat_kdump --enable --reserve-mb=3D'auto' + +%end +%anaconda +pwpolicy root --minlen=3D6 --minquality=3D1 --notstrict --nochanges --note= mpty +pwpolicy user --minlen=3D6 --minquality=3D1 --notstrict --nochanges --empt= yok +pwpolicy luks --minlen=3D6 --minquality=3D1 --notstrict --nochanges --note= mpty +%end diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64 new file mode 100755 index 00000000000..d5232ecdb8c --- /dev/null +++ b/tests/vm/centos.aarch64 @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 +# +# Centos aarch64 image +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.aarch64 +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import os +import sys +import subprocess +import basevm +import time +import traceback +import aarch64vm + +DEFAULT_CONFIG =3D { + 'cpu' : "max", + 'machine' : "virt,gic-version=3Dmax", + 'install_cmds' : "yum install -y make git python3 gcc gcc-c++ flex bis= on, "\ + "yum install -y glib2-devel pixman-devel zlib-devel, "\ + "yum install -y perl-Test-Harness, "\ + "alternatives --set python /usr/bin/python3, "\ + "sudo dnf config-manager "\ + "--add-repo=3Dhttps://download.docker.com/linux/centos/docker-ce.r= epo,"\ + "sudo dnf install --nobest -y docker-ce.aarch64,"\ + "systemctl enable docker", + # We increase beyond the default time since during boot + # it can take some time (many seconds) to log into the VM. + 'ssh_timeout' : 60, +} + +class CentosAarch64VM(basevm.BaseVM): + name =3D "centos.aarch64" + arch =3D "aarch64" + login_prompt =3D "localhost login:" + prompt =3D '[root@localhost ~]#' + image_name =3D "CentOS-8-aarch64-1905-dvd1.iso" + image_link =3D "http://mirrors.usc.edu/pub/linux/distributions/centos/= 8.0.1905/isos/aarch64/" + image_link +=3D image_name + BUILD_SCRIPT =3D """ + set -e; + cd $(mktemp -d); + sudo chmod a+r /dev/vdb; + tar --checkpoint=3D.10 -xf /dev/vdb; + ./configure {configure_opts}; + make --output-sync {target} -j{jobs} {verbose}; + """ + def set_key_perm(self): + """Set permissions properly on certain files to allow + ssh access.""" + self.console_wait_send(self.prompt, + "/usr/sbin/restorecon -R -v /root/.ssh\n") + self.console_wait_send(self.prompt, + "/usr/sbin/restorecon -R -v "\ + "/home/{}/.ssh\n".format(self._config["guest_user"])) + + def create_kickstart(self): + """Generate the kickstart file used to generate the centos image."= "" + # Start with the template for the kickstart. + ks_file =3D "../tests/vm/centos-8-aarch64.ks" + subprocess.check_call("cp {} ./ks.cfg".format(ks_file), shell=3DTr= ue) + # Append the ssh keys to the kickstart file + # as the post processing phase of installation. + with open("ks.cfg", "a") as f: + # Add in the root pw and guest user. + rootpw =3D "rootpw --plaintext {}\n" + f.write(rootpw.format(self._config["root_pass"])) + add_user =3D "user --groups=3Dwheel --name=3D{} "\ + "--password=3D{} --plaintext\n" + f.write(add_user.format(self._config["guest_user"], + self._config["guest_pass"])) + # Add the ssh keys. + f.write("%post --log=3D/root/ks-post.log\n") + f.write("mkdir -p /root/.ssh\n") + addkey =3D 'echo "{}" >> /root/.ssh/authorized_keys\n' + addkey_cmd =3D addkey.format(self._config["ssh_pub_key"]) + f.write(addkey_cmd) + f.write('mkdir -p /home/{}/.ssh\n'.format(self._config["guest_= user"])) + addkey =3D 'echo "{}" >> /home/{}/.ssh/authorized_keys\n' + addkey_cmd =3D addkey.format(self._config["ssh_pub_key"], + self._config["guest_user"]) + f.write(addkey_cmd) + f.write("%end\n") + # Take our kickstart file and create an .iso from it. + # The .iso will be provided to qemu as we boot + # from the install dvd. + # Anaconda will recognize the label "OEMDRV" and will + # start the automated installation. + gen_iso_img =3D 'genisoimage -output ks.iso -volid "OEMDRV" ks.cfg' + subprocess.check_call(gen_iso_img, shell=3DTrue) + + def wait_for_shutdown(self): + """We wait for qemu to shutdown the VM and exit. + While this happens we display the console view + for easier debugging.""" + # The image creation is essentially done, + # so whether or not the wait is successful we want to + # wait for qemu to exit (the self.wait()) before we return. + try: + self.console_wait("reboot: Power down") + except Exception as e: + sys.stderr.write("Exception hit\n") + if isinstance(e, SystemExit) and e.code =3D=3D 0: + return 0 + traceback.print_exc() + finally: + self.wait() + + def build_base_image(self, dest_img): + """Run through the centos installer to create + a base image with name dest_img.""" + # We create the temp image, and only rename + # to destination when we are done. + img =3D dest_img + ".tmp" + # Create an empty image. + # We will provide this as the install destination. + qemu_img_create =3D "qemu-img create {} 50G".format(img) + subprocess.check_call(qemu_img_create, shell=3DTrue) + + # Create our kickstart file to be fed to the installer. + self.create_kickstart() + # Boot the install dvd with the params as our ks.iso + os_img =3D self._download_with_cache(self.image_link) + dvd_iso =3D "centos-8-dvd.iso" + subprocess.check_call(["cp", "-f", os_img, dvd_iso]) + extra_args =3D "-cdrom ks.iso" + extra_args +=3D " -drive file=3D{},if=3Dnone,id=3Ddrive1,cache=3Dw= riteback" + extra_args +=3D " -device virtio-blk,drive=3Ddrive1,bootindex=3D1" + extra_args =3D extra_args.format(dvd_iso).split(" ") + self.boot(img, extra_args=3Dextra_args) + self.console_wait_send("change the selection", "\n") + # We seem to need to hit esc (chr(27)) twice to abort the + # media check, which takes a long time. + # Waiting a bit seems to be more reliable before hitting esc. + self.console_wait("Checking") + time.sleep(5) + self.console_wait_send("Checking", chr(27)) + time.sleep(5) + self.console_wait_send("Checking", chr(27)) + print("Found Checking") + # Give sufficient time for the installer to create the image. + self.console_init(timeout=3D7200) + self.wait_for_shutdown() + os.rename(img, dest_img) + print("Done with base image build: {}".format(dest_img)) + + def check_create_base_img(self, img_base, img_dest): + """Create a base image using the installer. + We will use the base image if it exists. + This helps cut down on install time in case we + need to restart image creation, + since the base image creation can take a long time.""" + if not os.path.exists(img_base): + print("Generate new base image: {}".format(img_base)) + self.build_base_image(img_base); + else: + print("Use existing base image: {}".format(img_base)) + # Save a copy of the base image and copy it to dest. + # which we will use going forward. + subprocess.check_call(["cp", img_base, img_dest]) + + def boot(self, img, extra_args=3DNone): + aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64) + default_args =3D aarch64vm.get_pflash_args(self._tmpdir) + if extra_args: + extra_args.extend(default_args) + else: + extra_args =3D default_args + # We always add these performance tweaks + # because without them, we boot so slowly that we + # can time out finding the boot efi device. + if '-smp' not in extra_args and \ + '-smp' not in self._config['extra_args'] and \ + '-smp' not in self._args: + # Only add if not already there to give caller option to chang= e it. + extra_args.extend(["-smp", "8"]) + # We have overridden boot() since aarch64 has additional parameter= s. + # Call down to the base class method. + super(CentosAarch64VM, self).boot(img, extra_args=3Dextra_args) + + def build_image(self, img): + img_tmp =3D img + ".tmp" + self.check_create_base_img(img + ".base", img_tmp) + + # Boot the new image for the first time to finish installation. + self.boot(img_tmp) + self.console_init() + self.console_wait_send(self.login_prompt, "root\n") + self.console_wait_send("Password:", + "{}\n".format(self._config["root_pass"])) + + self.set_key_perm() + self.console_wait_send(self.prompt, "rpm -q centos-release\n") + enable_adapter =3D "sed -i 's/ONBOOT=3Dno/ONBOOT=3Dyes/g'" \ + " /etc/sysconfig/network-scripts/ifcfg-enp0s1\n" + self.console_wait_send(self.prompt, enable_adapter) + self.console_wait_send(self.prompt, "ifup enp0s1\n") + self.console_wait_send(self.prompt, + 'echo "qemu ALL=3D(ALL) NOPASSWD:ALL" | '\ + 'sudo tee /etc/sudoers.d/qemu\n') + self.console_wait(self.prompt) + + # Rest of the commands we issue through ssh. + self.wait_ssh(wait_root=3DTrue) + + # If the user chooses *not* to do the second phase, + # then we will jump right to the graceful shutdown + if self._config['install_cmds'] !=3D "": + install_cmds =3D self._config['install_cmds'].split(',') + for cmd in install_cmds: + self.ssh_root(cmd) + self.ssh_root("poweroff") + self.wait_for_shutdown() + os.rename(img_tmp, img) + print("image creation complete: {}".format(img)) + return 0 + +if __name__ =3D=3D "__main__": + defaults =3D aarch64vm.get_config_defaults(CentosAarch64VM, DEFAULT_CO= NFIG) + sys.exit(basevm.main(CentosAarch64VM, defaults)) --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837253; cv=none; d=zohomail.com; s=zohoarc; b=IjB61vih3jZMiY0j46nzNGxbA4+S/p74Z+tHfWMwYtkNprz8nW5TXTK+HWcnrSeTlBe1rES2xicFEgVRiqa5jf8cqV6fiyuYdpRYHQ8f/sLixABf+pOAzQYYOoFToxIw0wcJaxVRu5Q4YTSlRweAsYgBwoXEIG+cypyYvh9gE38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837253; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qDw5tmNjtaEA2MrxzXTWX9WRb/d3hDPxln94PjTXX2k=; b=Fkkh3QJQjno9iYwmnDcZHXiXFko0apxF/6wTnOQ3LA2beZiFFVL12yVp4upTif65kWi0EViGWcb+SdPpK7ScFVUsGS2S1/jSmm8qhWAMYU18LGeftKJQUn0BBoFdBgas2dzscPM2ID+CQVocQXUCTtbyGfesI/35fJfgQBdUg4Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837253208943.0140908226282; Mon, 22 Jun 2020 07:47:33 -0700 (PDT) Received: from localhost ([::1]:41206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNjQ-0004Ye-7j for importer@patchew.org; Mon, 22 Jun 2020 10:47:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUj-0006yg-IL for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:21 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:33404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUh-0005fj-5N for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:21 -0400 Received: by mail-wr1-x442.google.com with SMTP id l11so16943158wru.0 for ; Mon, 22 Jun 2020 07:32:18 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h2sm5654429wrw.62.2020.06.22.07.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 90D031FF96; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=qDw5tmNjtaEA2MrxzXTWX9WRb/d3hDPxln94PjTXX2k=; b=WIFkl2vjy4nRo12cfiqpis7I8EBiDRf1kMgpIKp3Zvqw7aGIf7Cx5dgCgcvN2nBfys vt5JknOSKx1eUCcBq5cBrQSm70KIwbokh7Kqtu4m0BAbK9uD14LH4cbVHT9b/FpZiiJF FPWf+b+MwNBUuAIWiSqd5J9XWE/nbvXBZMY8xv2Ef1Uc9acoKKEkobYf4YsSHcbYKY98 fBjpTGYEaClD7z0dwIOTyDiDDleK4XOlcXZRwJjc5fwNwqjDZPhfSb+TDI2JRnCgMW2y pZ947rgna5VzwZC9YBRgs4av80mUEWSkqo0czd8DjFpxrQIzDEXwikzD8G2GY4wYuK/h 2erw== 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=qDw5tmNjtaEA2MrxzXTWX9WRb/d3hDPxln94PjTXX2k=; b=C0y9nlNKOsUuJOMCik3rEnM1sNSFbEiBSoCUB/3ZX5Ed9OJ8sHvsrMVHQ2b4NV3dZd sil2xAVQb2qTgqehQbiQ/K0vK7Vd1PQME4NBIxwI/vRpHPDnl0/Zf5zLUpaP5lmMNOdU lFFtcr4njjZiDib36vpF1BmeLa5y6MqDeWCCMp/yyCVqkbg7a2Gvwv1t06aDM0GYInwt zfISf2+505YntIV1vhCX2lz/e5rw4UMVm7up53LpXTC6/9qnp37psfFJ6hiuUD5NrUc/ 4OQDCPP3lIBTvvO8sJS6rICERluD6LwPBw2r4JYugAa9T12OFGAGK0x6Gzq5i2mUsvyo sHJw== X-Gm-Message-State: AOAM531JdbeId3gVjX5mcyhGJm7A5LsiyeiI7XiJlpvSxLr/PQGMHbeI rb55bWPx/gEKsjZsI44GfHzHfzLQ3Ho= X-Google-Smtp-Source: ABdhPJy8CgEJl92OHA/lXqu7MWdUg5+8WbM1jVbLgsEQE0XFsgx+R46xTLnQ1YyJNBzqRjub5xGOSQ== X-Received: by 2002:a5d:4607:: with SMTP id t7mr10974843wrq.251.1592836337667; Mon, 22 Jun 2020 07:32:17 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 08/18] tests/vm: change scripts to use self._config Date: Mon, 22 Jun 2020 15:31:54 +0100 Message-Id: <20200622143204.12921-9-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x442.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley This change converts existing scripts to using for example self.ROOT_PASS, to self._config['root_pass']. We made similar changes for GUEST_USER, and GUEST_PASS. This allows us also to remove the change in basevm.py, which adds __getattr__ for backwards compatibility. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-8-robert.foley@linaro.org> --- tests/vm/basevm.py | 11 ++--------- tests/vm/fedora | 17 +++++++++-------- tests/vm/freebsd | 16 ++++++++-------- tests/vm/netbsd | 19 ++++++++++--------- tests/vm/openbsd | 17 +++++++++-------- 5 files changed, 38 insertions(+), 42 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5fd66f6b26a..f716798b405 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -183,13 +183,6 @@ class BaseVM(object): self.console_init(timeout=3Dtimeout) self.console_wait(wait_string) =20 - def __getattr__(self, name): - # Support direct access to config by key. - # for example, access self._config['cpu'] by self.cpu - if name.lower() in self._config.keys(): - return self._config[name.lower()] - return object.__getattribute__(self, name) - def _download_with_cache(self, url, sha256sum=3DNone, sha512sum=3DNone= ): def check_sha256sum(fname): if not sha256sum: @@ -239,13 +232,13 @@ class BaseVM(object): return r =20 def ssh(self, *cmd): - return self._ssh_do(self.GUEST_USER, cmd, False) + return self._ssh_do(self._config["guest_user"], cmd, False) =20 def ssh_root(self, *cmd): return self._ssh_do("root", cmd, False) =20 def ssh_check(self, *cmd): - self._ssh_do(self.GUEST_USER, cmd, True) + self._ssh_do(self._config["guest_user"], cmd, True) =20 def ssh_root_check(self, *cmd): self._ssh_do("root", cmd, True) diff --git a/tests/vm/fedora b/tests/vm/fedora index a9195670f4b..b2b478fdbca 100755 --- a/tests/vm/fedora +++ b/tests/vm/fedora @@ -108,20 +108,20 @@ class FedoraVM(basevm.BaseVM): =20 self.console_wait_send("7) [!] Root password", "7\n") self.console_wait("Password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Password (confirm):") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) =20 self.console_wait_send("8) [ ] User creation", "8\n") self.console_wait_send("1) [ ] Create user", "1\n") self.console_wait_send("3) User name", "3\n") - self.console_wait_send("ENTER:", "%s\n" % self.GUEST_USER) + self.console_wait_send("ENTER:", "%s\n" % self._config["guest_user= "]) self.console_wait_send("4) [ ] Use password", "4\n") self.console_wait_send("5) Password", "5\n") self.console_wait("Password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Password (confirm):") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("7) Groups", "c\n") =20 while True: @@ -139,7 +139,7 @@ class FedoraVM(basevm.BaseVM): if good: break time.sleep(10) - self.console_send("r\n" % self.GUEST_PASS) + self.console_send("r\n" % self._config["guest_pass"]) =20 self.console_wait_send("'b' to begin install", "b\n") =20 @@ -150,12 +150,13 @@ class FedoraVM(basevm.BaseVM): =20 # setup qemu user prompt =3D " ~]$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], + self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") =20 # setup root user prompt =3D " ~]#" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) =20 # setup virtio-blk #1 (tarfile) diff --git a/tests/vm/freebsd b/tests/vm/freebsd index f87db2b126e..29252fa4a64 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -113,9 +113,9 @@ class FreeBSDVM(basevm.BaseVM): =20 # post-install configuration self.console_wait("New Password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Retype New Password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) =20 self.console_wait_send("Network Configuration", "\n") self.console_wait_send("IPv4", "y") @@ -134,9 +134,9 @@ class FreeBSDVM(basevm.BaseVM): # qemu user self.console_wait_send("Add User Accounts", "y") self.console_wait("Username") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait("Full name") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait_send("Uid", "\n") self.console_wait_send("Login group", "\n") self.console_wait_send("Login group", "\n") @@ -148,9 +148,9 @@ class FreeBSDVM(basevm.BaseVM): self.console_wait_send("Use an empty password", "\n") self.console_wait_send("Use a random password", "\n") self.console_wait("Enter password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Enter password again:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait_send("Lock out", "\n") self.console_wait_send("OK", "yes\n") self.console_wait_send("Add another user", "no\n") @@ -164,12 +164,12 @@ class FreeBSDVM(basevm.BaseVM): =20 # setup qemu user prompt =3D "$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], self._co= nfig["guest_pass"]) self.console_wait_send(prompt, "exit\n") =20 # setup root user prompt =3D "root@freebsd:~ #" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) =20 # setup serial console diff --git a/tests/vm/netbsd b/tests/vm/netbsd index cdac502dad8..dc0e45c1d45 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -120,24 +120,24 @@ class NetBSDVM(basevm.BaseVM): self.console_wait_send("d: Change root password", "d\n") self.console_wait_send("a: Yes", "a\n") self.console_wait("New password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("New password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Retype new password:") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) =20 self.console_wait_send("o: Add a user", "o\n") self.console_wait("username") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("to group wheel") self.console_wait_send("a: Yes", "a\n") self.console_wait_send("a: /bin/sh", "a\n") self.console_wait("New password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("New password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Retype new password:") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) =20 self.console_wait_send("a: Configure network", "a\n") self.console_wait_send("a: vioif0", "a\n") @@ -170,12 +170,13 @@ class NetBSDVM(basevm.BaseVM): =20 # setup qemu user prompt =3D "localhost$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], + self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") =20 # setup root user prompt =3D "localhost#" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) =20 # setup virtio-blk #1 (tarfile) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 13e7f9a6d56..dfe633e4532 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -98,9 +98,9 @@ class OpenBSDVM(basevm.BaseVM): self.console_wait_send("Which network interface", "done\n") self.console_wait_send("DNS domain name", "localnet\n") self.console_wait("Password for root account") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait("Password for root account") - self.console_send("%s\n" % self.ROOT_PASS) + self.console_send("%s\n" % self._config["root_pass"]) self.console_wait_send("Start sshd(8)", "yes\n") self.console_wait_send("X Window System", "\n") self.console_wait_send("xenodm", "\n") @@ -108,13 +108,13 @@ class OpenBSDVM(basevm.BaseVM): self.console_wait_send("Which speed", "\n") =20 self.console_wait("Setup a user") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait("Full name") - self.console_send("%s\n" % self.GUEST_USER) + self.console_send("%s\n" % self._config["guest_user"]) self.console_wait("Password") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) self.console_wait("Password") - self.console_send("%s\n" % self.GUEST_PASS) + self.console_send("%s\n" % self._config["guest_pass"]) =20 self.console_wait_send("Allow root ssh login", "yes\n") self.console_wait_send("timezone", "UTC\n") @@ -135,12 +135,13 @@ class OpenBSDVM(basevm.BaseVM): =20 # setup qemu user prompt =3D "$" - self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_ssh_init(prompt, self._config["guest_user"], + self._config["guest_pass"]) self.console_wait_send(prompt, "exit\n") =20 # setup root user prompt =3D "openbsd#" - self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_ssh_init(prompt, "root", self._config["root_pass"]) self.console_sshd_config(prompt) =20 # setup virtio-blk #1 (tarfile) --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836950; cv=none; d=zohomail.com; s=zohoarc; b=T/soaV26qOeh4HTZiwkif9eD6vKffb/khWIIfh2buN0w+lCvhZ5cNwW5cvMeY1OTTwlCGwZdgyyLkzxbg5v7YA6bgPIT9ZhmHJt25e4/Jk+J2IciawR3afGr8ssINzsW8O3QHJnzSEXkJqTCGZcaa6sisUSsAI6Jd6d7vmNv6g4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836950; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SfCKKjXRpSzktD2zHuCdVYnzBzWod3odSIiX8dUA3RA=; b=QCmSz++SshyIdlfEdXgWsUzn7YNkpinZP1VaE5TC7lSYmkElZDvAOyeixeGfLOOw+2EUgWNOf5MXgelW5juK+4ftlufxQfI85r8fncvr45qy0v8d8IjT046lyffy7TeOIP+ACfr2MLRnQlysNDQG4eqrRh+Vi0sMM+ARlKYuJ7Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836950134631.7242787435412; Mon, 22 Jun 2020 07:42:30 -0700 (PDT) Received: from localhost ([::1]:52958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNeX-0005ZE-6c for importer@patchew.org; Mon, 22 Jun 2020 10:42:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUm-00073f-KJ for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:24 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:35651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUk-0005g7-6e for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:24 -0400 Received: by mail-wr1-x42c.google.com with SMTP id g18so7858384wrm.2 for ; Mon, 22 Jun 2020 07:32:21 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n16sm12311571wrq.39.2020.06.22.07.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A7DED1FF98; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=SfCKKjXRpSzktD2zHuCdVYnzBzWod3odSIiX8dUA3RA=; b=Xar42K/1wjtXTgnbv0KVk7mQFYnxiGeu4JK4TeU0aAiM6kwk4XSzTnkRSCFiNHCWe7 siWnL8D9HevP5Wv+vXMoZlwEy2thSP40n/u1gVFC1ABdURO3y9q9YH3VQYHW1HZBMIpj 3EGy8AEfHXQRZSN9GbdMg4baZASUDbSa6cd8BAcH3Z7ndGfYCDYQ5lQFhM/pE+V+m6jr XTt42PKolpQP9oIzRkQHIMtfS73F7xEeAVP5w4nFZ3gELPd0DQBuqkTFdZ/NxWMsY2y7 wKHuJyO+au0b11EEgGFEO6P1+Y+Ux7flXPHJwX9lDNPTYSoQVEDVcVDGscLcGhcJFCWy iDPA== 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=SfCKKjXRpSzktD2zHuCdVYnzBzWod3odSIiX8dUA3RA=; b=Laa/xzEnPcUz6y/nBIEbNO5dJuQFr0MKxPROyifB5+tYR711vk5uxQ+tAegMd8XAxx xIGKfHplMHad1drytKtR2gmU0HGHVNyHQAiYLJdm5JMSDp3+WlJ8PamJHfq+xEu+GPdN L9kr3/OuMVlyRrOajcKiUuDs2jG01isAYZ7mp6BycR/njHGSDkJRndVA3YTspdSN3ei3 aP4ZJ82A+BixUobqWY8lw+CQCJu8wcoDV/nMHqjqTT0iUQE5ji4CVxIvXUUIMtnxG9eA UWLDZQxjiyv/Y+t9CJOQriygpB8w174Dc2j1zkz/Q7VZOkt714L8rGJXjCaeuS0gba4C 9dQw== X-Gm-Message-State: AOAM533r3qPe2XLLUM2C+vCugdAkjumoVh/fAN0JP+eOk5XiobQpgIkf 7h9eNOnWMATwiEj7Dd5dUitBHw== X-Google-Smtp-Source: ABdhPJw+mNytSMdBKqjRwIGaWmbMZh1+4yMCyO/Wu8sCUNK2I0qcthqnjDUItiYCg3WwWyIdo4LigQ== X-Received: by 2002:adf:edc8:: with SMTP id v8mr17920774wro.125.1592836340554; Mon, 22 Jun 2020 07:32:20 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 09/18] python/qemu: Add ConsoleSocket for optional use in QEMUMachine Date: Mon, 22 Jun 2020 15:31:55 +0100 Message-Id: <20200622143204.12921-10-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Cleber Rosa , Peter Puhov , aurelien@aurel32.net, Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley We add the ConsoleSocket object, which has a socket interface and which will consume all arriving characters on the socket, placing them into an in memory buffer. This will also provide those chars via recv() as would a regular socket. ConsoleSocket also has the option of dumping the console bytes to a log file. We also give QEMUMachine the option of using ConsoleSocket to drain and to use for logging console to a file. By default QEMUMachine does not use ConsoleSocket. This is added in preparation for use by basevm.py in a later commit. This is a workaround we found was needed for basevm.py since there is a known issue where QEMU will hang waiting for console characters to be consumed. Cc: Eduardo Habkost Cc: Cleber Rosa Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Acked-by: Alex Benn=C3=A9e Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-9-robert.foley@linaro.org> --- python/qemu/console_socket.py | 110 ++++++++++++++++++++++++++++++++++ python/qemu/machine.py | 23 +++++-- 2 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 python/qemu/console_socket.py diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py new file mode 100644 index 00000000000..830cb7c6282 --- /dev/null +++ b/python/qemu/console_socket.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +# +# This python module implements a ConsoleSocket object which is +# designed always drain the socket itself, and place +# the bytes into a in memory buffer for later processing. +# +# Optionally a file path can be passed in and we will also +# dump the characters to this file for debug. +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# +import asyncore +import socket +import threading +import io +import os +import sys +from collections import deque +import time +import traceback + +class ConsoleSocket(asyncore.dispatcher): + + def __init__(self, address, file=3DNone): + self._recv_timeout_sec =3D 300 + self._buffer =3D deque() + self._asyncore_thread =3D None + self._sock =3D socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + self._sock.connect(address) + self._logfile =3D None + if file: + self._logfile =3D open(file, "w") + asyncore.dispatcher.__init__(self, sock=3Dself._sock) + self._open =3D True + self._thread_start() + + def _thread_start(self): + """Kick off a thread to wait on the asyncore.loop""" + if self._asyncore_thread is not None: + return + self._asyncore_thread =3D threading.Thread(target=3Dasyncore.loop, + kwargs=3D{'timeout':1}) + self._asyncore_thread.daemon =3D True + self._asyncore_thread.start() + + def handle_close(self): + """redirect close to base class""" + # Call the base class close, but not self.close() since + # handle_close() occurs in the context of the thread which + # self.close() attempts to join. + asyncore.dispatcher.close(self) + + def close(self): + """Close the base object and wait for the thread to terminate""" + if self._open: + self._open =3D False + asyncore.dispatcher.close(self) + if self._asyncore_thread is not None: + thread, self._asyncore_thread =3D self._asyncore_thread, N= one + thread.join() + if self._logfile: + self._logfile.close() + self._logfile =3D None + + def handle_read(self): + """process arriving characters into in memory _buffer""" + try: + data =3D asyncore.dispatcher.recv(self, 1) + # latin1 is needed since there are some chars + # we are receiving that cannot be encoded to utf-8 + # such as 0xe2, 0x80, 0xA6. + string =3D data.decode("latin1") + except: + print("Exception seen.") + traceback.print_exc() + return + if self._logfile: + self._logfile.write("{}".format(string)) + self._logfile.flush() + for c in string: + self._buffer.extend(c) + + def recv(self, n=3D1, sleep_delay_s=3D0.1): + """Return chars from in memory buffer""" + start_time =3D time.time() + while len(self._buffer) < n: + time.sleep(sleep_delay_s) + elapsed_sec =3D time.time() - start_time + if elapsed_sec > self._recv_timeout_sec: + raise socket.timeout + chars =3D ''.join([self._buffer.popleft() for i in range(n)]) + # We choose to use latin1 to remain consistent with + # handle_read() and give back the same data as the user would + # receive if they were reading directly from the + # socket w/o our intervention. + return chars.encode("latin1") + + def set_blocking(self): + """Maintain compatibility with socket API""" + pass + + def settimeout(self, seconds): + """Set current timeout on recv""" + self._recv_timeout_sec =3D seconds diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 041c615052e..c25f0b42cf6 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -26,6 +26,7 @@ import socket import tempfile from typing import Optional, Type from types import TracebackType +from qemu.console_socket import ConsoleSocket =20 from . import qmp =20 @@ -75,7 +76,8 @@ class QEMUMachine: =20 def __init__(self, binary, args=3DNone, wrapper=3DNone, name=3DNone, test_dir=3D"/var/tmp", monitor_address=3DNone, - socket_scm_helper=3DNone, sock_dir=3DNone): + socket_scm_helper=3DNone, sock_dir=3DNone, + drain_console=3DFalse, console_log=3DNone): ''' Initialize a QEMUMachine =20 @@ -86,6 +88,9 @@ class QEMUMachine: @param test_dir: where to create socket and log file @param monitor_address: address for QMP monitor @param socket_scm_helper: helper program, required for send_fd_scm= () + @param sock_dir: where to create socket (overrides test_dir for so= ck) + @param console_log: (optional) path to console log file + @param drain_console: (optional) True to drain console socket to b= uffer @note: Qemu process is not started until launch() is used. ''' if args is None: @@ -122,6 +127,12 @@ class QEMUMachine: self._console_address =3D None self._console_socket =3D None self._remove_files =3D [] + self._console_log_path =3D console_log + if self._console_log_path: + # In order to log the console, buffering needs to be enabled. + self._drain_console =3D True + else: + self._drain_console =3D drain_console =20 def __enter__(self): return self @@ -580,7 +591,11 @@ class QEMUMachine: Returns a socket connected to the console """ if self._console_socket is None: - self._console_socket =3D socket.socket(socket.AF_UNIX, - socket.SOCK_STREAM) - self._console_socket.connect(self._console_address) + if self._drain_console: + self._console_socket =3D ConsoleSocket(self._console_addre= ss, + file=3Dself._console_l= og_path) + else: + self._console_socket =3D socket.socket(socket.AF_UNIX, + socket.SOCK_STREAM) + self._console_socket.connect(self._console_address) return self._console_socket --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836771; cv=none; d=zohomail.com; s=zohoarc; b=i8yb0MnoIqN6Xty/o2ukjjI5k2bNLiw7gimcwfPwX1bPH+r3B58lxDSAC8tLQbhg5e6CXOxUE0qKL01YAGEn45nQHu6yCeAN5Dnsot8r93k0+M3aZ0CWi0e8zD6v2WQo6YoNDhnOww1/SE6dfsS9975ot5T9MzT9/Hf3qfdyTrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836771; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5xSn2L6kzBKcKjTR8zPwxbT757SBhdGuGZ/3k/jBdz8=; b=ck5PPZ3NC8q3OBGKmpQkx79ReS1DqPX03He3s+TZ/Q/K3ooOG8/Rc/BC2vzfRjsayPFX7J3HY5KBQAtmrHGf0iAlNXgTGiL/oWc2IoGgR93+2z3XmKQgbdfxnG/3y3v3if4whyu2AbaNSVX7lQM6/t1e+YSHaZ4lqUkIFRa/gt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836771710521.0692993726839; Mon, 22 Jun 2020 07:39:31 -0700 (PDT) Received: from localhost ([::1]:42080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNbe-0000J1-Su for importer@patchew.org; Mon, 22 Jun 2020 10:39:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUk-000706-IE for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:22 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUi-0005fq-FO for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:22 -0400 Received: by mail-wr1-x444.google.com with SMTP id g18so7858285wrm.2 for ; Mon, 22 Jun 2020 07:32:19 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r12sm18115626wrc.22.2020.06.22.07.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BECA81FF99; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=5xSn2L6kzBKcKjTR8zPwxbT757SBhdGuGZ/3k/jBdz8=; b=BXega6gZk1JeXV23r9dnm+EWlgsnTwI+c2Cn8PsTqXzXZBRK7OryEEgFKbS88f++Un qi4wPrlPybPbqodl0zHoulHrnOP6NucY/wYw+489IqvBhnVZnV+2IFMb9k65s/qehRPC KD2DmtLLyGt8IwVr4VeI8pox1VDMDPETew9YBpCdH5OHNAt6xvyvpRmpwUiItyMwoYUx pRWVE3aEZ3ZhdmyAuqNbemj1Q6Er3uosxUBjaMDSy5w3mcKkCC4Q1+lAu5R7SQH9b8Ji P4y8jyD4N+4qgb3R1AWPNogaSDC5YfVAxR7Vb4MV+LNKA5Xrt5ID3uc+PNeI2PJyl7QF MlhA== 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=5xSn2L6kzBKcKjTR8zPwxbT757SBhdGuGZ/3k/jBdz8=; b=bypNgLB6sKTX3Pl/2cDA+4Ziq+y1sEVhZcoeIVkWlNRa+6qZI5f8BejSvMfDgqUJbV p73ksUVAU7ZyITWfPKHm2+6MqDkPXa9BcfvMFginBLN2J6sm0yPkvu12dHHJczQ66qT1 gqYAEh+VEP5uit9a0caKhyTXO3SA0/P/O0T7zR4A3KCDwSJTtCbyM3S4Z4iMT15Le31t IKKMYQeb9VrROxZHoQZxcS7ai3D+KuRuJa7iCFSqkcawmujujRrRQORz3c4fneTqrGY1 P1KnVebBQvY0R0Wq+YOn4E9vF/a1tHm13u9eu9xMup1MtGfwfVVB2NlSn9kzXW4YQxXS v94Q== X-Gm-Message-State: AOAM5329Yd0ig5TSKujW/RupTCvXlRcc3IacUC5A8bGdNz24zSXFxiIN wDYDPT2ZQE3UDw5d++P06idF9A== X-Google-Smtp-Source: ABdhPJxen4zbc82hR5naVus51Q+a0XQXlzX2PeQ2qqeZW8KmQ6Pqg8w4raURdDL4J5PmCWVbgVmkMw== X-Received: by 2002:a5d:498f:: with SMTP id r15mr20672510wrq.175.1592836338920; Mon, 22 Jun 2020 07:32:18 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 10/18] tests/vm: Add workaround to consume console Date: Mon, 22 Jun 2020 15:31:56 +0100 Message-Id: <20200622143204.12921-11-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.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=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, Peter Puhov , aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Robert Foley This adds support to basevm.py so that we always drain the console chars. This makes use of support added in an earlier commit that allows QEMUMachine to use the ConsoleSocket. This is a workaround we found was needed since there is a known issue where QEMU will hang waiting for console characters to be consumed. We also added the option of logging the console to a file. LOG_CONSOLE=3D1 will now log the output to a file. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov Acked-by: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Message-Id: <20200601211421.1277-10-robert.foley@linaro.org> --- tests/vm/Makefile.include | 4 ++++ tests/vm/basevm.py | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 39f918a430a..f21948c46a5 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -49,6 +49,7 @@ endif @echo ' EXTRA_CONFIGURE_OPTS=3D"..."' @echo " J=3D[0..9]* - Override the -jN parameter for make= commands" @echo " DEBUG=3D1 - Enable verbose output on host and i= nteractive debugging" + @echo " LOG_CONSOLE=3D1 - Log console to file in: ~/.cache/qe= mu-vm " @echo " V=3D1 - Enable verbose ouput on host and guest commands" @echo " QEMU_LOCAL=3D1 - Use QEMU binary local to this= build." @echo " QEMU=3D/path/to/qemu - Change path to QEMU binary" @@ -75,6 +76,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ + $(if $(LOG_CONSOLE),--log-console) \ --image "$@" \ --force \ --build-image $@, \ @@ -91,6 +93,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(V),--verbose) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ + $(if $(LOG_CONSOLE),--log-console) \ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ --snapshot \ @@ -114,6 +117,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(if $(V)$(DEBUG), --debug) \ $(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \ $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ + $(if $(LOG_CONSOLE),--log-console) \ --image "$<" \ --interactive \ false, \ diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index f716798b405..04d083409a5 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -117,6 +117,11 @@ class BaseVM(object): "w").write(self._config['ssh_pub_key']) =20 self.debug =3D args.debug + self._console_log_path =3D None + if args.log_console: + self._console_log_path =3D \ + os.path.join(os.path.expanduser("~/.cache/qemu-vm= "), + "{}.install.log".format(self.name)) self._stderr =3D sys.stderr self._devnull =3D open(os.devnull, "w") if self.debug: @@ -271,7 +276,13 @@ class BaseVM(object): args +=3D self._data_args + extra_args + self._config['extra_args'] logging.debug("QEMU args: %s", " ".join(args)) qemu_path =3D get_qemu_path(self.arch, self._build_path) - guest =3D QEMUMachine(binary=3Dqemu_path, args=3Dargs) + + # Since console_log_path is only set when the user provides the + # log_console option, we will set drain_console=3DTrue so the + # console is always drained. + guest =3D QEMUMachine(binary=3Dqemu_path, args=3Dargs, + console_log=3Dself._console_log_path, + drain_console=3DTrue) guest.set_machine(self._config['machine']) guest.set_console() try: @@ -285,6 +296,8 @@ class BaseVM(object): raise atexit.register(self.shutdown) self._guest =3D guest + # Init console so we can start consuming the chars. + self.console_init() usernet_info =3D guest.qmp("human-monitor-command", command_line=3D"info usernet") self.ssh_port =3D None @@ -296,7 +309,9 @@ class BaseVM(object): raise Exception("Cannot find ssh port from 'info usernet':\n%s= " % \ usernet_info) =20 - def console_init(self, timeout =3D 120): + def console_init(self, timeout =3D None): + if timeout =3D=3D None: + timeout =3D self.socket_timeout vm =3D self._guest vm.console_socket.settimeout(timeout) self.console_raw_path =3D os.path.join(vm._temp_dir, @@ -578,6 +593,8 @@ def parse_args(vmcls): parser.add_option("--efi-aarch64", default=3D"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", help=3D"Path to efi image for aarch64 VMs.") + parser.add_option("--log-console", action=3D"store_true", + help=3D"Log console to file.") parser.disable_interspersed_args() return parser.parse_args() =20 --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836909; cv=none; d=zohomail.com; s=zohoarc; b=AR6czjCaRV6+A24gudWRx5umZlea+++nec0R8QlC/dUcqyg7VkDfYj2LgCGVYQ0dh7F9xWKm32E/Vqqd9WRPWparVxJ+wP6sMMhbYFN+6x52Yt3AO09GJ5yhfv2cl+JVd858hdDXhAKkCiCnpeF8b7jK0AzG8d+c404L33Gak0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836909; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bm2ly00woNerpONQhYQFASSG/lyJnzbAQIWgk91BqYY=; b=anMMuOHD1oRnX9UJKgLEIUtEe2scnolROlhF6kOUChIKitID7yRYPCEHlIdK+nyqGcXK0B5xJUSzCbVE9JWK2EzF8KU3nPXrZtH6SnRCrTZfJcHVsBoQ+23fUmNV8LWqw7zfxD5yqMXAmUuD9vCdqlLEAQN5SRtXfsipAS7vApQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836909196855.3593151243272; Mon, 22 Jun 2020 07:41:49 -0700 (PDT) Received: from localhost ([::1]:50958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNds-0004ky-7l for importer@patchew.org; Mon, 22 Jun 2020 10:41:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUs-000779-54 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:30 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:43134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUp-0005i2-7x for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:29 -0400 Received: by mail-wr1-x444.google.com with SMTP id l10so16921619wrr.10 for ; Mon, 22 Jun 2020 07:32:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f13sm16667938wmb.33.2020.06.22.07.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D3BC51FF9A; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=bm2ly00woNerpONQhYQFASSG/lyJnzbAQIWgk91BqYY=; b=suLiJ9lmZh42KbF+odfoQ/v5qXCRBd4mfPOXB5jM8JurChsVXVLT9KSOuCKvxTGb9k ecDyC7Fy8rQ/BtQfkF6sfcPEC6pyOKtXnyZN7+Ji1dMGPhO2s+Y1gWoTptfS4Uaea/Nv G6tExBQxPC+2InuqhDLCS2WVtV2tzCOaM23VazYJxdIaipIQ4RNLy1AXhchJpb8L3HP3 d3vTwtyt/1Dt6xAj3rUE2xgn58eGpShmReYhso6o6Hkx8nE/T+FgZLM0QdrbcoUyU+OX o84dfaIb6D8/5OMCpLv1Y3WvjFOwYHBWbBnlh6Rs3dn6MmemT9MilQ56EkccN5jCow+K qyEQ== 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=bm2ly00woNerpONQhYQFASSG/lyJnzbAQIWgk91BqYY=; b=PClAvGXCRlQK6N3QG/HeQlc9y9TYqR7KmmbvL2lSC7iyRUpgIgQz+qfX37DvqE40dY jQhjha9PW8dn9PBNhbRTXGAgMaIKRlT8gt0nesCZpmrNu6miDOM4vlwJXhDn0X85YKEi V47Z6a76opoWnY1/pk0FVn5rd4GdlQ07vk5812NqpakWvlkED8w8ay6hGzqjk4opkNVq COAtutGkHE96hULF709RmqRiGPhBnAno9Gwm8vT7TRUtUX9w0jmMvfYX/B56EB3hWIkn NZpSyu/brOs7nMscX5+8ANuw0Oj7ltgZpexQMTCcW5/FHc2rM92qXtFDGlkeU2RD8c2b X8zw== X-Gm-Message-State: AOAM53363X19MY2jNMuZNn8cjTQ1UPdNer4XbzRRF4EJtiYPfM/uFjoc zuKzh5S2znmA5VhHNN0Zg3ezBQ== X-Google-Smtp-Source: ABdhPJzvgOGQ68/QnQwiO4GwNWaKhBqsapBqW7ykXmT5AVawcFdKAyfa6b7ZYUIfkhQ1BzOuGAxvPg== X-Received: by 2002:adf:c382:: with SMTP id p2mr19131688wrf.283.1592836344914; Mon, 22 Jun 2020 07:32:24 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 11/18] tests/vm: switch from optsparse to argparse Date: Mon, 22 Jun 2020 15:31:57 +0100 Message-Id: <20200622143204.12921-12-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.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, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) optparse has been deprecated since version 3.2 and argparse is the blessed replacement. Take the opportunity to enhance our help output showing defaults when called. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Robert Foley --- tests/vm/basevm.py | 84 +++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 04d083409a5..93859362606 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -23,7 +23,7 @@ from qemu.accel import kvm_available from qemu.machine import QEMUMachine import subprocess import hashlib -import optparse +import argparse import atexit import tempfile import shutil @@ -556,47 +556,47 @@ def parse_args(vmcls): else: return 1 =20 - parser =3D optparse.OptionParser( - description=3D"VM test utility. Exit codes: " - "0 =3D success, " - "1 =3D command line error, " - "2 =3D environment initialization failed, " - "3 =3D test command failed") - parser.add_option("--debug", "-D", action=3D"store_true", - help=3D"enable debug output") - parser.add_option("--image", "-i", default=3D"%s.img" % vmcls.name, - help=3D"image file name") - parser.add_option("--force", "-f", action=3D"store_true", - help=3D"force build image even if image exists") - parser.add_option("--jobs", type=3Dint, default=3Dget_default_jobs(), - help=3D"number of virtual CPUs") - parser.add_option("--verbose", "-V", action=3D"store_true", - help=3D"Pass V=3D1 to builds within the guest") - parser.add_option("--build-image", "-b", action=3D"store_true", - help=3D"build image") - parser.add_option("--build-qemu", - help=3D"build QEMU from source in guest") - parser.add_option("--build-target", - help=3D"QEMU build target", default=3D"check") - parser.add_option("--build-path", default=3DNone, - help=3D"Path of build directory, "\ - "for using build tree QEMU binary. ") - parser.add_option("--interactive", "-I", action=3D"store_true", - help=3D"Interactively run command") - parser.add_option("--snapshot", "-s", action=3D"store_true", - help=3D"run tests with a snapshot") - parser.add_option("--genisoimage", default=3D"genisoimage", - help=3D"iso imaging tool") - parser.add_option("--config", "-c", default=3DNone, - help=3D"Provide config yaml for configuration. "\ - "See config_example.yaml for example.") - parser.add_option("--efi-aarch64", - default=3D"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", - help=3D"Path to efi image for aarch64 VMs.") - parser.add_option("--log-console", action=3D"store_true", - help=3D"Log console to file.") - parser.disable_interspersed_args() - return parser.parse_args() + parser =3D argparse.ArgumentParser( + formatter_class=3Dargparse.ArgumentDefaultsHelpFormatter, + description=3D"Utility for provisioning VMs and running builds", + epilog=3D"""Remaining arguments are passed to the command. + Exit codes: 0 =3D success, 1 =3D command line error, + 2 =3D environment initialization failed, + 3 =3D test command failed""") + parser.add_argument("--debug", "-D", action=3D"store_true", + help=3D"enable debug output") + parser.add_argument("--image", "-i", default=3D"%s.img" % vmcls.name, + help=3D"image file name") + parser.add_argument("--force", "-f", action=3D"store_true", + help=3D"force build image even if image exists") + parser.add_argument("--jobs", type=3Dint, default=3Dget_default_jobs(), + help=3D"number of virtual CPUs") + parser.add_argument("--verbose", "-V", action=3D"store_true", + help=3D"Pass V=3D1 to builds within the guest") + parser.add_argument("--build-image", "-b", action=3D"store_true", + help=3D"build image") + parser.add_argument("--build-qemu", + help=3D"build QEMU from source in guest") + parser.add_argument("--build-target", + help=3D"QEMU build target", default=3D"check") + parser.add_argument("--build-path", default=3DNone, + help=3D"Path of build directory, "\ + "for using build tree QEMU binary. ") + parser.add_argument("--interactive", "-I", action=3D"store_true", + help=3D"Interactively run command") + parser.add_argument("--snapshot", "-s", action=3D"store_true", + help=3D"run tests with a snapshot") + parser.add_argument("--genisoimage", default=3D"genisoimage", + help=3D"iso imaging tool") + parser.add_argument("--config", "-c", default=3DNone, + help=3D"Provide config yaml for configuration. "\ + "See config_example.yaml for example.") + parser.add_argument("--efi-aarch64", + default=3D"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd= ", + help=3D"Path to efi image for aarch64 VMs.") + parser.add_argument("--log-console", action=3D"store_true", + help=3D"Log console to file.") + return parser.parse_known_args() =20 def main(vmcls, config=3DNone): try: --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836734; cv=none; d=zohomail.com; s=zohoarc; b=hgbGH4HuqMgWWEWeO9WLX+O8ZBh2Fi94ANTMajdXUVVAqgVNFYWQcJI6H7ELpSUVMjPfaukHgMxfvtf4JCZ/ymnpTZpJwptXaJP5LOdyNZPz5X4g+j3UhMLSb0pciv8Tk6XBHNzvTb3sX0cFO+9gmMODPQV1X2ShXTnc4umhC0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836734; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1Wx+3OKlQnJklFN0bA9dHl2yXauQUDmxH1f7TXMpyuU=; b=giB1yX5Bm8f7zEX1psq5tQo4FFzFSYg+eE50vTXfKQKeXHjKqiyXucSGRxKC338zWk9HZuV8vpoHXG37V0OL6+Ngbd4LkB3HyqFgrybYFLvp3g3d8iBpYfeDyiZxg2NsnQUe7VYjsm2SwRiVs5HtLEaiLT+Ah/lHhfrjcyEBEtE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836734818880.6053980713978; Mon, 22 Jun 2020 07:38:54 -0700 (PDT) Received: from localhost ([::1]:39396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNb4-0007L2-0a for importer@patchew.org; Mon, 22 Jun 2020 10:38:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUp-000764-Hd for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:29 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUm-0005gd-Ki for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:27 -0400 Received: by mail-wm1-x341.google.com with SMTP id 17so1390750wmo.1 for ; Mon, 22 Jun 2020 07:32:24 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a126sm16899979wme.28.2020.06.22.07.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E84121FF9B; Mon, 22 Jun 2020 15:32:05 +0100 (BST) 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=1Wx+3OKlQnJklFN0bA9dHl2yXauQUDmxH1f7TXMpyuU=; b=rtxJco2+yMnH4D5lvbxK8/HNQ0DDP3DXmhiFFU72dAsiu81+Vl7BIx/dnuho+GxfzA 5bCat+I0W4XlVntXEUmqM5Gfp5/Wc6odLJmsrlBRLTQBgbTIwNWS+h3j7x3QNC1H6tbF 0BTK/D7AuHdsxy2RUjXwtb2z/uhNKS6I8C8o29Us/NoafMjKYIcZaI7uQaPDyzBENoGl Xt2rHfZhgAdIzVaAMU7pRPQQfZzaTJMHCa6mC4QnH5o0EyUmL9sZutjFAzHUi2XjBjtA J5JD4uGDY+ULUFhDU/QMMswSiIAyc2jeFoZtnxlhvAEKYDEukvThTXpuOeEVK2HWWALV UEPA== 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=1Wx+3OKlQnJklFN0bA9dHl2yXauQUDmxH1f7TXMpyuU=; b=KPJbH0cpgXjowCk213HY33umOI7/MQbi5wucxk31rZbukq7oLrVXNLUOHJZOz3nLJq awNp9+yCzdtpvSnGFgF2iv0zlZl2sZnQbAXn9vPyd0h2JOYgFg2qWzXsqUcDwYy9SkDg MT4HGEOROTWzKqrJFhuFCx+DWjjtI7onniSHtaEFWvees4GizJuRJ4UjbxZ40B7bzJ3Z QUWQNqFTX/0PWDbtbliL0LWK98pxjtfaHVQMhUt4Xgl0qniwNp/dIxZGFjSCvAbHaBkd x5YO5PowDmT4jCJk8lmDB+07MQGA8abJfUkEE7p3X1pWTncVohCEQvyUUJWPPmIHiF+g Piuw== X-Gm-Message-State: AOAM531y1ibJ6j0qDOy2nAwlHs85hxTbVFI8ptob3XGNQT0gfY1hrngF N7Gc8LzXp0tpyzgfa1Z0lExRwg== X-Google-Smtp-Source: ABdhPJyKMBn6ykF2Ift71dllhkHDT+wVp8BWd1Xr9qwOSs1v/a5e/f2XF67aW4BBzTK/ut2dTUPENg== X-Received: by 2002:a7b:c5d5:: with SMTP id n21mr18762611wmk.106.1592836342900; Mon, 22 Jun 2020 07:32:22 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 12/18] tests/vm: allow us to take advantage of MTTCG Date: Mon, 22 Jun 2020 15:31:58 +0100 Message-Id: <20200622143204.12921-13-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.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, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We currently limit TCG guests to -smp 1 but now we have added some aarch64 guests we can do better when running on x86_64 hardware. Raise the limit for TCG guests when it is safe to do so. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Robert Foley --- tests/vm/basevm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 93859362606..dd96a6d4af6 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -553,6 +553,12 @@ def parse_args(vmcls): def get_default_jobs(): if kvm_available(vmcls.arch): return multiprocessing.cpu_count() // 2 + elif os.uname().machine =3D=3D "x86_64" and \ + vmcls.arch in ["aarch64", "x86_64", "i386"]: + # MTTCG is available on these arches and we can allow more cor= es. + # But only up to a reasonable limit. User can always override + # these limits with --jobs. + return min(multiprocessing.cpu_count() // 2, 8) else: return 1 =20 --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837447; cv=none; d=zohomail.com; s=zohoarc; b=brOL8bPTWJ+SyYkZ8nGVUM6k13x7vsS+E7J89hZdIIO0aMWii8dceJlOyfdEaxHkTWB8XuBEfr84I6uRss570BxZfDtsvih+sA4cNnjyB51SrG8c0YPQiwWdNB7cyvPjZiUx4KtFmFDQqpBsfhQNY6RHCls+4BmVMjJ7e3xzd6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837447; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4LEU0pltPGXSZOYL7F80Ql3BPnvdmnM8vPzgdqbMG+Y=; b=VvXSTKAx2cQPEWMb21/n1wi6srXqZUeh+oBKupI9ioTcJuyBpPv0MiuAXTqYpU/BRxXgUVy+9cHgMUygkC0IvZgjRb4SkNkaBDcmvabrbdNBvIzD1+eIaSE+AKNgtuM2qq63SWHKlh7eqp4wpTF1FFEPa/FoT+J0GOmgHhl5smI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837447026261.948576913285; Mon, 22 Jun 2020 07:50:47 -0700 (PDT) Received: from localhost ([::1]:52940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNmX-0002Zo-RI for importer@patchew.org; Mon, 22 Jun 2020 10:50:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUt-00077H-70 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:32 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:37725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUp-0005i7-8H for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:30 -0400 Received: by mail-wm1-x342.google.com with SMTP id y20so15957894wmi.2 for ; Mon, 22 Jun 2020 07:32:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g16sm12906153wrh.91.2020.06.22.07.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0A3FA1FF9C; Mon, 22 Jun 2020 15:32:06 +0100 (BST) 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=4LEU0pltPGXSZOYL7F80Ql3BPnvdmnM8vPzgdqbMG+Y=; b=ClTW9mEP2z1SuAZrbYrN4X2uyDDtTeaMHTMAuXtQb0dWLZ7UR/tU9sR4XnTOKCVcYo 10R5TGdKkfpm9h9E6Mfs7fRDDbZ8zKKrQ1e9EoxFYXA2HnkHhp+Fh9LY7dLVvFZgXmk3 nJ1xxev4DfzGB6vxdA4eQzrBQpS2xqN0hvGoeMCot1tAooqIhQ1m/M1NOtsPEBa9scpq 1WOMm6wEmF+E3L+7Tonqm+Y3ZD5KiQGTZrzLk5e4Yr8drt7+lBqQJJE6gs0PzhW+Qwih bwDPP3WPgmugRSAJ5vYid0YEMdFrJGEIVagVckv//ROeuvx9D9KQIKdfIg0QNCSYKjnW 2IwA== 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=4LEU0pltPGXSZOYL7F80Ql3BPnvdmnM8vPzgdqbMG+Y=; b=JMjQBW/Dqpqz+68gSwqK77cF7iefdGNFSVrkoe/72a1I6r1q9xFtDebYW0RQNRXlu/ icoJ3kL+Wd76tb/qiaVCcEfRgoSaJswXQCGMALsDduSBL9XDKavI31k+XfSD6Qg+LOVo c3UAJtygXgMQRGbKdRP6SbG3tQHQCdXWNMWn1i0EbXnsAtTe2XkBeXKM71sjPW0CRYU6 kfWgmpYTHWTC1WFuAuzDNUb7i6dVkAWZ1oQqy9qwyS/9kHHUxeoEXrYT8re/xQkTObtp jfg05iZNiUrE1Yb1+oJEWwpI3x3clwMsEsgoo42aUxE1A+hynRCMq6uv0gaigKf7urMM XWjQ== X-Gm-Message-State: AOAM531sN2V+Pmzn5/5DHEfwHgFox2eyY1kvewmKFqz91wqTYIYrjtIw uE1RR7JTFxhUQd7/Q4F5ILcWUw== X-Google-Smtp-Source: ABdhPJzem75xc6RN0sszS/iqc9X5FMbeb2RGvMm2eiWSB3XX0SgrcpOvbDmNws5HlQXFPPdGc9zpEg== X-Received: by 2002:a1c:2044:: with SMTP id g65mr20322718wmg.16.1592836345796; Mon, 22 Jun 2020 07:32:25 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 13/18] tests/docker: check for an parameters not empty string Date: Mon, 22 Jun 2020 15:31:59 +0100 Message-Id: <20200622143204.12921-14-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.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 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, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Reported-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Suggested-by: Peter Maydell --- tests/docker/common.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/common.rc b/tests/docker/common.rc index 02cd67a8c5e..b27ce17e333 100755 --- a/tests/docker/common.rc +++ b/tests/docker/common.rc @@ -47,7 +47,7 @@ build_qemu() check_qemu() { # default to make check unless the caller specifies - if test -z "$@"; then + if [ $# =3D=3D 0 ]; then INVOCATION=3D"check" else INVOCATION=3D"$@" --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836600; cv=none; d=zohomail.com; s=zohoarc; b=SkGd9uakYwnxvd5mnpACjUKBLAk3TkQYEsHZauO2U/aAbqCMQU1G+qaGXlowEi+vwlTd2JQElgq6O8BVA840G+emi4RhrNr7FteRbQXdIGQeDoaenjD2g/kr3bp6BxhI8jUC9/7T/fGxEqYQ7s1GjWJUc1y+6auOsnKvIwc6UI8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836600; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Teb5CYlwDix3ktwKyP7XUM4qHJXbLvwhht+HlFFEsmI=; b=LjfOPU0uqueRr+cGLevCwsfUg/3vglbYmW5qu4j0gh6C0Dx8TBU5poNMwAZjtNd4R3fQNcv/5fjGWMiJ+7Vixp7QWp7Xl5CAlUd9pBw75QBP8qzP8rfGh8iLxwOxmhK9BuVaQPs/73NpIn176YpM9q9NyajLk8y7doHPlRTE5Uk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836600247728.4481675555228; Mon, 22 Jun 2020 07:36:40 -0700 (PDT) Received: from localhost ([::1]:59556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNYt-0003uH-CG for importer@patchew.org; Mon, 22 Jun 2020 10:36:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNUr-00076I-2y for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:29 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNUn-0005gr-E0 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:32:28 -0400 Received: by mail-wm1-x343.google.com with SMTP id t194so15955641wmt.4 for ; Mon, 22 Jun 2020 07:32:24 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 104sm18668728wrl.25.2020.06.22.07.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:32:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 204E31FF9D; Mon, 22 Jun 2020 15:32:06 +0100 (BST) 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=Teb5CYlwDix3ktwKyP7XUM4qHJXbLvwhht+HlFFEsmI=; b=DnrJMFhspYGXqHtI5Oie2h43khYDeSShJ/ASj99kqUXnXBX/cETlxetXcgj17nod5w is1QW8XeORvhV7Gnm1RFLLxqZmCOKOjmkjvo8SesnixHQ7YDGLaQPcFsb0i+/2ksIyxF 9Rd6/q2HV3GoKtFhMB51vHWUm6US0MWXIwE8eSmvXedED4YNzNoIs2micQ96zEgDYnKz f75DpgBryD4TRqBJYgRO58b78QG0IoEZxIluiLRCcKdEr0FU4AjPOAGQIkFXYshPB762 OThE1n2uRBFKYmewvkxbRIABrXpFJiOUjaHt2mbqpfY4tcpGbj6Y9AVrdbcHKn6EULU1 oFCA== 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=Teb5CYlwDix3ktwKyP7XUM4qHJXbLvwhht+HlFFEsmI=; b=IE/7X07olQT2grONZu8kVwBl/LSrZSP1GKMxBst3vwTeJc1DjauSSZaIWVCSa4Maci ZoVaVmlrzkgKW1fbZ8Sy4zoxtABbXZvdIA16uSAGySpKszfaio3pUImL0n4uWu7XluLI G/cLHa9gRLhEEf6knN7edNOLFzqx8Mi4R/r0ZVEfClKX6A8KqFACyEnMiam9VUtz8cbp xGmmztI3/CXesnr7m6XdwhAleRwt5LXSGy3Ah3zG29grnV2mlwMaBAGiv9Ps8Mt4KqJ8 0tXy9lwf9n6dt4jdRrirwnwPuvtcNrveXff6P4j6WewqsdYBWUglVLkejBBV153w2yyF dWVQ== X-Gm-Message-State: AOAM533l5ZVVfdwbILO1rsXujRYt73AdhsRuYsgVI6zbAz62Ssq2cp+g P8Zui6Mmje9cETOPCqy1kvPFOg== X-Google-Smtp-Source: ABdhPJysydiwd6tjoielmDCg1a4a67BVX+PqahCMbJtcL9ALpttJRLjEWEOtHR8mGQ+XmbptiQgfyw== X-Received: by 2002:a1c:2485:: with SMTP id k127mr16136950wmk.138.1592836343981; Mon, 22 Jun 2020 07:32:23 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 14/18] .gitignore: un-ignore .gitlab-ci.d Date: Mon, 22 Jun 2020 15:32:00 +0100 Message-Id: <20200622143204.12921-15-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.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 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, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The sooner we deprecate in-tree builds the sooner this mess of regexes can be thrown away. Signed-off-by: Alex Benn=C3=A9e --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 90acb4347d4..9016ee0a0b4 100644 --- a/.gitignore +++ b/.gitignore @@ -92,7 +92,7 @@ *.toc *.tp *.vr -*.d +!\.*.d !/scripts/qemu-guest-agent/fsfreeze-hook.d *.o .sdk --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837516; cv=none; d=zohomail.com; s=zohoarc; b=hs6TKj0uozA5S0ip+ehO9PYCCZi7IG96MM2eQO1SHU88gi2nZRSn8N2b6L0MFKEjK7x4DOX8a2mMduD9Zz8SSJCmmXNZ3biYywNf0+gUFlWD/EHvhVZU6j8kMD+b7K4tMy+aV8FaqYHcwLo8h4DSc104Cz7Bx2+OV+R1dz4snG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837516; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kpO6jorqg4gFYmKvuQF8bVTYfoSxIW2vkh7ytMeEuyk=; b=YMFmxBIERm1COWqBmfc5xd/jIBsqDb33uv7p5WI4Dtq6JfUKOE4gv276HCcHpEN/0rElxucMF/WDhm5M3gFQ+XBg7WZAyDVQVV3ACDJ7CXuSGAH0KQ73qTqiEeYpspsz3AUCeNg5+SfyvGum/YBkd4KNYlNbAho2ez8/zGoHC4g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837516346477.74894238649244; Mon, 22 Jun 2020 07:51:56 -0700 (PDT) Received: from localhost ([::1]:55386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNne-0003e6-Tn for importer@patchew.org; Mon, 22 Jun 2020 10:51:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZk-00061J-7g for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:32 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:36332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZh-0006a8-RG for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:31 -0400 Received: by mail-wm1-x333.google.com with SMTP id 17so1410850wmo.1 for ; Mon, 22 Jun 2020 07:37:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 138sm17498376wma.23.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 36FFC1FF9E; Mon, 22 Jun 2020 15:32:06 +0100 (BST) 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=kpO6jorqg4gFYmKvuQF8bVTYfoSxIW2vkh7ytMeEuyk=; b=rK0ik3peQ8vYDiJvOQixOTa6eSoI47JBg277LPIRPimM9dnIEzuHvdb97m9kkNK4+J BZqEGhD/2xQvsthTGuHxTYPmssYHb213SIHaF8gutSFE1RzHuLj8bX2LNdU2VtEBhcRS 7tFWzTTQ1Wj79dydAE+7oXghK/jwqyNmQ9VBL53/xVHTB8+ZyYRcV4CSDwPmCDX83cvF MjHTl/XsDhhK5E3rgE48W1Z2rKfQK3w486vuZtkV43jddT4pLVEjGD5g0fa+RqhOnmNy vutLqoSYlrjAm8ZM9QZ4wvGSq9a+snSgdb4pkyMoHcTZu7oxnh8JasiEdocKtJmK4QXA sEFQ== 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=kpO6jorqg4gFYmKvuQF8bVTYfoSxIW2vkh7ytMeEuyk=; b=MA5JnXHtPeknz4jmTrPpYaeQ7u1ggpcNtNn6rnTOqhOZ6RLI4XkAsyCJZhg+gA8UyE uneMU+dU7R9WHwH7xY4Mc7yzUq937abC+zaJn3CVriqfOTGlRseUd1E8YJwjP5FWIeL8 /K3I+fcpqXfp27yzd9QorlWSGGA5IgkEnP9eFaPL6OHzlCrqpxzZpCJCaofbLqctz1zv chaaEho8g7n1mSgcqE3UDhNgbciH9Pf0uHeaORWOEyWa9z28n/5tsYUhAcN3Dse0J28l q+5dYIsjS9gQ+1ITJckqvOsORWikCIseyu6JR275+FHwcN1HspBu641EKWyDDAKMh9lq kDYA== X-Gm-Message-State: AOAM533M5duMzBi2uhrdyHhpxMd0sSGYVmid1y+kynYFZ+kPY2sBCwdy /Hs9hqBe9NFpfuhLb2lUmkx0zA== X-Google-Smtp-Source: ABdhPJyYz9E6Vk3PxbiNHnGQaHsdAz75ABnNjB0a/SH3bbQ2MXRZlXZDVZgirsO/O7Xd0roCMi9SnQ== X-Received: by 2002:a1c:f203:: with SMTP id s3mr16955752wmc.126.1592836648326; Mon, 22 Jun 2020 07:37:28 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 15/18] .gitlab: add acceptance testing to system builds Date: Mon, 22 Jun 2020 15:32:01 +0100 Message-Id: <20200622143204.12921-16-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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 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, Thomas Huth , berrange@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) As part of migrating things from Travis to GitLab add the acceptance tests. To do this: - split system1 into ubuntu-main and debian-alt - use artifacts to save build stage - rename system2 to fedora-misc - split into build/check/acceptance - remove -j from check stages - add packages needed for acceptance - add post acceptance template and use Signed-off-by: Alex Benn=C3=A9e --- .gitlab-ci.yml | 122 ++++++++++++++++++++++++++++++++++++++++++++++--- .travis.yml | 23 ---------- 2 files changed, 115 insertions(+), 30 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 349c77aa580..fc3a561d9bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,15 @@ +# +# Currently we have two build stages: +# - build (for traditional build and test or first stage build) +# - test (for test stages, using build artefacts from a build stage) +stages: + - build + - test + +variables: + BASE_CONFIG: "--disable-docs" + MAIN_SOFTMMU_TARGETS: "aarch64-softmmu,mips64-softmmu,ppc64-softmmu,risc= v64-softmmu,s390x-softmmu,x86_64-softmmu" + include: - local: '/.gitlab-ci.d/edk2.yml' - local: '/.gitlab-ci.d/opensbi.yml' @@ -16,22 +28,93 @@ include: make python3 perl-podlators perl-Test-Harness pixman-devel zlib-de= vel - JOBS=3D$(expr $(nproc) + 1) =20 -build-system1: +.post_acceptance_template: &post_acceptance + after_script: + - python3 -c 'import json; r =3D json.load(open("tests/results/latest/= results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] no= t in ("PASS", "SKIP")]' | xargs cat + - du -chs $HOME/avocado/data/cache + +build:system-ubuntu-main: image: ubuntu:19.10 + stage: build <<: *before_script_apt script: - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdepl= ug-dev - mkdir build - cd build - - ../configure --enable-werror --target-list=3D"aarch64-softmmu alpha-sof= tmmu - cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-so= ftmmu - mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-soft= mmu" + - ../configure ${BASE_CONFIG} --enable-werror --target-list=3D"${MAIN_SOF= TMMU_TARGETS}" - make -j"$JOBS" - - make -j"$JOBS" check + artifacts: + paths: + - build =20 -build-system2: +check:system-ubuntu-main: + image: ubuntu:19.10 + stage: test + dependencies: + - build:system-ubuntu-main + <<: *before_script_apt + script: + - cd build + - make check + +acceptance:system-ubuntu-main: + image: ubuntu:19.10 + stage: test + dependencies: + - build:system-ubuntu-main + <<: *before_script_apt + script: + - DEBIAN_FRONTEND=3Dnoninteractive apt-get install -y -qq + python3-pil python3-pip python3-numpy python3-opencv python3-venv + rpm2cpio tesseract-ocr tesseract-ocr-eng + - cd build + - make check-acceptance + <<: *post_acceptance + +build:system-debian-alt: + image: debian:buster-slim + stage: build + <<: *before_script_apt + script: + - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev + libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdepl= ug-dev + - mkdir build + - cd build + - ../configure ${BASE_CONFIG} --enable-werror --disable-user + --target-list-exclude=3D"${MAIN_SOFTMMU_TARGETS}" + - make -j"$JOBS" + artifacts: + paths: + - build + +check:system-debian-alt: + image: debian:buster-slim + stage: test + dependencies: + - build:system-debian-alt + <<: *before_script_apt + script: + - cd build + - make check + +acceptance:system-debian-alt: + image: debian:buster-slim + stage: test + dependencies: + - build:system-debian-alt + <<: *before_script_apt + script: + - DEBIAN_FRONTEND=3Dnoninteractive apt-get install -y -qq + python3-pil python3-pip python3-numpy python3-opencv python3-venv + rpm2cpio tesseract-ocr tesseract-ocr-eng + - cd build + - make check-acceptance + <<: *post_acceptance + +build:system-fedora-misc: image: fedora:latest + stage: build <<: *before_script_dnf script: - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel @@ -43,7 +126,32 @@ build-system2: microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-so= ftmmu sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-sof= tmmu" - make -j"$JOBS" - - make -j"$JOBS" check + artifacts: + paths: + - build + +check:system-fedora-misc: + image: fedora:latest + stage: test + dependencies: + - build:system-fedora-misc + <<: *before_script_dnf + script: + - cd build + - make check + +acceptance:system-fedora-misc: + image: fedora:latest + stage: test + dependencies: + - build:system-fedora-misc + <<: *before_script_dnf + script: + - yum install -y python3-pillow python3-pip python3-numpy python3-opencv + python3-virtualenv tesseract tesseract-langpack-eng + - cd build + - make check-acceptance + <<: *post_acceptance =20 build-disabled: image: fedora:latest diff --git a/.travis.yml b/.travis.yml index 74158f741b1..c24dfbe377f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -289,29 +289,6 @@ jobs: python: 3.6 =20 =20 - # Acceptance (Functional) tests - - name: "GCC check-acceptance" - dist: bionic - env: - - CONFIG=3D"--enable-tools --target-list=3Daarch64-softmmu,alpha-s= oftmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-so= ftmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh= 4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu" - - TEST_CMD=3D"make check-acceptance" - - CACHE_NAME=3D"${TRAVIS_BRANCH}-linux-gcc-acceptance" - after_script: - - python3 -c 'import json; r =3D json.load(open("tests/results/lat= est/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"= ] not in ("PASS", "SKIP")]' | xargs cat - - du -chs $HOME/avocado/data/cache - addons: - apt: - packages: - - python3-pil - - python3-pip - - python3-numpy - - python3-opencv - - python3-venv - - rpm2cpio - - tesseract-ocr - - tesseract-ocr-eng - - # Using newer GCC with sanitizers - name: "GCC9 with sanitizers (softmmu)" addons: --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592836864; cv=none; d=zohomail.com; s=zohoarc; b=GRwDpLFw7UawFkPRKdaTciYxVhiEBFxg4GmmBLjZQmhNDyFH6wInxBsZV/zD/mD7fssFNMmu8/RZwNpwLbySzrHbHsg6BdZQTjOP12bXuZeTtFlrjfkdp64DX9ldHSYe0XBlFBuWPgQTz0koErp/q59/vjnqvTLu157Cox+ywbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592836864; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r4zwLgzQI1wdPNBnB1IfLtnWJ7YheiR6CeL9tVns6/w=; b=aOFA4cCKQFSHhD4zTqbJ7f6ZnuY0KdPCEHBUqvd12H3Blj5g1fg5KqdG7rrvL2WqfHGjjU7dFyQFBLtNouLr9T1JE4/LH+MkJoMRcp6rpM+UeQi3nXJExT0PZOqveB7vnfaBLq6Cbjf2gOtW9YtsvfRFOaF4icQ3Z/K4MNFNbHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592836864189937.650591229654; Mon, 22 Jun 2020 07:41:04 -0700 (PDT) Received: from localhost ([::1]:47728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNd8-0003Lm-NC for importer@patchew.org; Mon, 22 Jun 2020 10:41:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZi-0005xY-C3 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:30 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:38430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZg-0006Zz-Lv for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:30 -0400 Received: by mail-wr1-x441.google.com with SMTP id z13so5177439wrw.5 for ; Mon, 22 Jun 2020 07:37:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 104sm18688389wrl.25.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4BF441FF9F; Mon, 22 Jun 2020 15:32:06 +0100 (BST) 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=r4zwLgzQI1wdPNBnB1IfLtnWJ7YheiR6CeL9tVns6/w=; b=TTGg/oHughCIbCBUy0ldQCAts8eXYCCTMrFM0zSPCYsW3XqYia57ITz/uM02j5gZ5g nUnWLThkc6sOTAcAUeRpFJjMo3/25+FY284/7m42dj+uLDz3FxEX3RpGs3ZSNd8WZFqf RSYX30whXPYz3e6mAcMATtqZo9CrOXIGivXu76Q1J8QZ53mACmIyUNBrJaXv37ALMob4 mLFY5koHCCl3qyAdqSyJE1sDl1wAxl3PQwbHAzh2euzd+/0BW1sNEufwcrQVVkpvaHIA BU7Y1Xawg+9IeqiOFk0eB577fUu8E2Ps8tKKgGVUPSWcLJ1kvHYKKoSVzGzdzqGG+GD1 Pt1Q== 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=r4zwLgzQI1wdPNBnB1IfLtnWJ7YheiR6CeL9tVns6/w=; b=sSM+alH6G7fCyuHsuFkQLQzeQIQc0YYL4sGopMEgdTdMmdMxwySoVyJS8TRjA+i9XC g0dBkFg/60rpyJB1GJR6//fr/T3Ez4wd3HFLbxOzPKNRgp7kNNqsS3WAfCLHf4eQAfjq 50h/87xZVuiADiuX6M0UHfGFP6SeMLip8IA4oHrGo47SMR31i5osy45UNC9/nzLVAyEU oDPeH5Hp7JYREEwCuPS8IK7YcyuduBp/ZG3ebYYquPLT6V1FuqEkskMA1WtbC/eXC7CE lT6MzF9Yq+hBISY/l6+TOAjLKWcNGpcRr3rsNqZCpDeYN/HgvxMQ4Ik9HzXr9sQkL1Hg RDkg== X-Gm-Message-State: AOAM532wiYEmI8HfZxgQER69xtktHaEQtx9BRzBYmopXNryDYerTIOUq ZzXpydYOnImOxkyQhje+z6fWNA== X-Google-Smtp-Source: ABdhPJw/bU/1mGmYHKZvFb6aRExCiy3FF0xjpSOB2Ej02TAdBMc8glIH6VnBnc+mfixGyeiG0abHqg== X-Received: by 2002:a5d:4f09:: with SMTP id c9mr19019698wru.3.1592836646931; Mon, 22 Jun 2020 07:37:26 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 16/18] .gitlab: split fedora-misc-disabled Date: Mon, 22 Jun 2020 15:32:02 +0100 Message-Id: <20200622143204.12921-17-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.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 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, Thomas Huth , berrange@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) As we run check-qtest in "SLOW" mode this can timeout so split into two jobs. Signed-off-by: Alex Benn=C3=A9e --- .gitlab-ci.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc3a561d9bc..5c863562913 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,8 +153,9 @@ acceptance:system-fedora-misc: - make check-acceptance <<: *post_acceptance =20 -build-disabled: +build:system-fedora-misc-disabled: image: fedora:latest + stage: build <<: *before_script_dnf script: - mkdir build @@ -167,7 +168,19 @@ build-disabled: --disable-vhost-net --disable-vhost-crypto --disable-vhost-user --target-list=3D"i386-softmmu ppc64-softmmu mips64-softmmu i386-linu= x-user" - make -j"$JOBS" - - make -j"$JOBS" check-qtest SPEED=3Dslow + artifacts: + paths: + - build + +qtest:system-fedora-misc-disabled: + image: fedora:latest + stage: test + dependencies: + - build:system-fedora-misc-disabled + <<: *before_script_dnf + script: + - cd build + - make check-qtest SPEED=3Dslow =20 build-tcg-disabled: image: centos:8 --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837006; cv=none; d=zohomail.com; s=zohoarc; b=kCDgwdEvBWIRzg5Fz0yve9UTKk+Pk78hKMh3FMax3PFznnN9x/6L5YIIDKkTZSXhcv5eNwlFxOx0+d5XgfbMojl+DUJ3l6qf6+XbMFp7wh4TZAu2CL7thJ9M2I/PtsMCKKvYgcGUYvooOY6fkrihgS347lfg/diRGA3ZbqDCPiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837006; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PKCEcn+mdLK6k8p8iASrc3bnXSABtH0c5K5N75Qwt4o=; b=UeU6+C6uPJBA6+krN9WKFQ43sFQRcZRkZjvwuxBus8w8z/uouUMYCtlxHFTxbMnuSAzF1f8xObAPyeMi+KFlaNmrvPz89ccJfuPnjKSvwB5F48hDwnGlu4D2DUy7jlu8OQXmEBDhno3aM2Tue/yTu9iWNUW86KeE2FUrLDa07bs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592837006074304.3635232526259; Mon, 22 Jun 2020 07:43:26 -0700 (PDT) Received: from localhost ([::1]:55826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNfN-0006lm-VJ for importer@patchew.org; Mon, 22 Jun 2020 10:43:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZj-0005zx-K9 for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:31 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:53324) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZh-0006a3-3Q for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:31 -0400 Received: by mail-wm1-x344.google.com with SMTP id j18so1567841wmi.3 for ; Mon, 22 Jun 2020 07:37:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t188sm17525834wmt.27.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 631D01FFA5; Mon, 22 Jun 2020 15:32:06 +0100 (BST) 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=PKCEcn+mdLK6k8p8iASrc3bnXSABtH0c5K5N75Qwt4o=; b=Xt3wuFU9VYYO57XBATug7KkGFR2WUZkBywG9zvvfEhAbdAKGYWym2KV5aH4mzB8ei1 V2MuzC0FxrXxRoq5uMTT32cW+67JzEFFym4GssWW/r9ec199qvy7y82nU4TbKI+AdYaQ pqFcpLGCf+Y3pAQRMGw2giREW/xodO/dHGtkHjCKn9LDLrARQB5rXUb36L5DA8zNGVXu jS1FG40A0VskJ8dnrkaPDg/zpGYq0g1JhBsRsnl8UvcKdi72PNHERxiQ6aP51juR8p7m M3ids8X9geaMb9+fukRlaJTURLOxF5ZhF0MvKJxkYv4+TelvLrG4Vb3jy3co3HcXd6Or x0Gw== 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=PKCEcn+mdLK6k8p8iASrc3bnXSABtH0c5K5N75Qwt4o=; b=WRntHPWz/b3CuJNPdZ0g6lXZ72VMf2OKcYq5I7kylWzpLhUbpU1t8sUl9yVh/WcXmo ENkeIHTomB3dUOB4JUlkcCPnn2DbBNSEuwBvU6AlqQ9+l10tQnJDtbsnKsJgbSToxFxL MiYPgn8B56jJuYMOgkwXU1qwKoL+gxYaywGT8UnmOx6lJMMtTpQIy3j9giAxbiVWuWZM 2WP1Uh2Kr+pgR0DTywkKTbD3NsTluzSsUaeHh8ac2i+RV7w2IaFeMQG3f0NAgRVouYYN 7kz9czlnTVVh35hf0AoaeG2TClBletuhAXr0q4lVevaWFoaMldpw0NIkeKY8UkGO9orI eWkw== X-Gm-Message-State: AOAM532czPE/d+2OCFALhtNWTAfs3GnnjSOdz6nwABXMRbAqp8qgqmyd JOeVkxJDyW2J40d9uj+kzcUkNg== X-Google-Smtp-Source: ABdhPJzU4NLJ/C6C/+biU97nKod1xEXRe4AZiVo7LTtqoU5rTSXptnYR8ElvjQ6oOwbBK++GjRG7+Q== X-Received: by 2002:a05:600c:2294:: with SMTP id 20mr19658763wmf.51.1592836647516; Mon, 22 Jun 2020 07:37:27 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 17/18] .gitlab: tag remaining jobs as builds Date: Mon, 22 Jun 2020 15:32:03 +0100 Message-Id: <20200622143204.12921-18-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.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 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, Thomas Huth , berrange@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Technically these are build and test but there is no reason they need to wait for other builds to finish to get going. They might get split latter if the job ever gets too long. Signed-off-by: Alex Benn=C3=A9e --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c863562913..7816f1434c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -184,6 +184,7 @@ qtest:system-fedora-misc-disabled: =20 build-tcg-disabled: image: centos:8 + stage: build <<: *before_script_dnf script: - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel @@ -203,6 +204,7 @@ build-tcg-disabled: 260 261 262 263 264 270 272 273 277 279 =20 build-user: + stage: build <<: *before_script_apt script: - mkdir build @@ -214,6 +216,7 @@ build-user: =20 build-clang: image: fedora:latest + stage: build <<: *before_script_dnf script: - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-= devel @@ -228,6 +231,7 @@ build-clang: =20 build-tci: image: centos:8 + stage: build <<: *before_script_dnf script: - TARGETS=3D"aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86= _64" --=20 2.20.1 From nobody Fri May 3 22:36:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592837175; cv=none; d=zohomail.com; s=zohoarc; b=C/bqAFaZJnOF4oZwgfcchetYqbVE2LUg2Jzlr4bt6Ui6tAJbyaFPhWfMRYQylCA/pqOr5R8ieB0YlIKOJklw7DFluwr7Fg1oMDL4p1EcJbG/Hwd6RZrrCiD8jr8RgfV1VTjcSs9ctRSC/8nLWCAARzkG0coHfJ2/n3TXOzOUdWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592837175; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dpnea5tgBr5eCnz0xsYvFDQLPTuuc6m9Mmvt4C1s0eA=; b=RLYSptEvdn9Xom7B+0fRNJRJ3lG2hW0FHMOpB67+B7+9iYIAGLFWB7AjWidhf7Ao7I9w1frtM2TjUPP1U5iTqeb1nnFdnBoCZEfim9hQx5+MJwUp+wN79eykwrF3yzW2EMgl6u4D/vJlmzTfKzzSjtju7It3ScTvK/ZqdQLPlaE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159283717555283.58411776284913; Mon, 22 Jun 2020 07:46:15 -0700 (PDT) Received: from localhost ([::1]:35386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnNiA-00020K-8z for importer@patchew.org; Mon, 22 Jun 2020 10:46:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnNZk-00061t-Fy for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:32 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:54949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnNZi-0006aE-QY for qemu-devel@nongnu.org; Mon, 22 Jun 2020 10:37:32 -0400 Received: by mail-wm1-x342.google.com with SMTP id g10so15103237wmh.4 for ; Mon, 22 Jun 2020 07:37:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n8sm15088881wrj.44.2020.06.22.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:37:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7939D1FFA6; Mon, 22 Jun 2020 15:32:06 +0100 (BST) 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=dpnea5tgBr5eCnz0xsYvFDQLPTuuc6m9Mmvt4C1s0eA=; b=ZolPyyYC8yN8buNdSKVSPpCvndq4fcDi/bkkH/ySGqrvTH6Ji5bNgJfoaCKt/RAlym s5ZAO+uDpKG7X3oWldfHi9WVN9eedlxqTDsCN4RgiBV3SV7nWoMLbkAkbHf3XAib7EnM Dgqo4qNAinkcxuifhFOsENeZQzIIwWsQVDMyNYQjQyoP1bL/3XhGRFxn/B/fZCzwctA4 fG2d5/LeKRUJzlmXn+URue0XBSpqKjGPVXJeQlY7KXRoRJKuEA1ESnIYJxx7xVLlbc1i JvqbHaREqLUYBDyCXsrNpxnkkVSGcdIa6MJzdKFqvpoh7EHh718QrhO2bBczzzsRlu1N LVeQ== 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=dpnea5tgBr5eCnz0xsYvFDQLPTuuc6m9Mmvt4C1s0eA=; b=Lmxsd7VDA3fUB0Ga2iVnxcC13nh/nHU6XVteI5dT/MagVB99e+FndWId81UtfywlGS LyKBbdhWQtnW0oygiNi6AdE+IoaYb40zOB8VvCOLma3gU+yv/XVzfQ3aC6ndUOrAChhz dfZuHvHz5Kv4VgPEfgX2t+OdGeKMJezqijXbPgG9kfnYaxZ7bkTxKN9Dov87Msibm3o/ M0a8uO8ccZ09wYttNaWjkUcSf5XXlIJyf7iNpbowUCb87OKOmCIBYlohhSqblp6SmOa8 TD7/lWwOrl7NR3j8epux1Qw80SXdcoa+A7ZiN4iEzvTlI1WqkZP/LLNc45gBpsOFA7dD LjVw== X-Gm-Message-State: AOAM533p0UxUl5cYQ/oYcu0aRAmn2DUFHlUcDwFpHGMR0hIj7yXnI3A9 wtQ3poaFMJgBqyU54R+Bo6qWlw== X-Google-Smtp-Source: ABdhPJyb3G3YQ4eyt0CIfSnlIr+KeD9cC2jyPa0pkUfhDoikcIAayIfii+fO9iXk50dZwPUHaGyPkQ== X-Received: by 2002:a05:600c:2307:: with SMTP id 7mr5775371wmo.115.1592836649483; Mon, 22 Jun 2020 07:37:29 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 18/18] .gitlab: add avocado asset caching Date: Mon, 22 Jun 2020 15:32:04 +0100 Message-Id: <20200622143204.12921-19-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.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 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, Thomas Huth , berrange@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Wainer dos Santos Moschetta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) These can be quite big so lets cache them. I couldn't find any nots on ccache in the gitlab docs so I've just ignored it for now. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7816f1434c3..693ecad770f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,12 @@ include: - local: '/.gitlab-ci.d/edk2.yml' - local: '/.gitlab-ci.d/opensbi.yml' =20 +# We assume GitLab has it's own caching set up for RPM/APT repositories so= we +# just take care of avocado assets here. +cache: + paths: + - $HOME/avocado/data/cache + .update_apt_template: &before_script_apt before_script: - apt-get update -qq --=20 2.20.1