From patchwork Wed Dec 21 18:22:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13079062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFAB5C4167B for ; Wed, 21 Dec 2022 18:24:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p83kX-00084i-2G; Wed, 21 Dec 2022 13:23:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p83kO-0007zL-TB for qemu-devel@nongnu.org; Wed, 21 Dec 2022 13:23:20 -0500 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p83kM-0007pB-PZ for qemu-devel@nongnu.org; Wed, 21 Dec 2022 13:23:20 -0500 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1433ef3b61fso20093556fac.10 for ; Wed, 21 Dec 2022 10:23:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wAX2+OwNFeeUZjBeEsjIZKrfL1qZu8pl6CTdHwneZDo=; b=lmVNY9jigG2n8XdPsnYOei82O3CSSAvM2aMj7tMAkdRR7JOc2FFEfdRu/zzzzZKe4y Opzq05q+1qYOM1ZfAIzrF2V0+fCPvpNJqVQTLsDJBuOemf4iAjOud/f/xAeOzJ3QTPLZ GbY3AEfePHJgrMCz5rmALLeakfUml9j9ik/0GfP8cBOE9Ew23UduZkskz82ZH4w/eNoe v0fLfzWuLfiBxpPiC4tt1EYzD2SJ5NWrbvBn8IPBfgsXZ+gohXi4NvZXafh1Ykd2Hybr nviipxGuNRn8CjdNfpFkcsCQVrEi8QM+ZvPnaAQIY7Ns1w/TjdXJuyqRAwLmLYcnXZ/r 0ceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wAX2+OwNFeeUZjBeEsjIZKrfL1qZu8pl6CTdHwneZDo=; b=qyRzggLb0BY948otcdEIYCgLXJm4thy7ZhiO1Hi66WT2wNqgaR8E991PMH0c5oV/2l /Fnj2NX7cXvh/NCbZVRtVcYvDDJWZovKnYuZWoVr3DwWblqxbf/v8cKl1Oj0mpX1b3N6 MqBTu8lS8Hm8XgJxro6nJWK0f7qntmWNa0e6oFZ3YazG2C5Kcb+j6lMnHk5Kysxh4CM7 98hF7EjOR9rCUdMKY3vCFjauk9S9vaM6/PM4/3a0C2VXV7IP78Iqo6M4go5tKghtAW9y +pFIFelzZn8hRJ50ObYxEeaPfPUipH0YFv5WHRSVEO2HWbu1qW9SrotYCTSPP0BY4PHn RQ/Q== X-Gm-Message-State: AFqh2komcyXWcO+m1PCCiAm4IsK1NmXbT0DRqNIdN+03VjbYFyypGmWq ZqAniBFvyG1kxuidyHjF0TV6TlQenlBnpbYs X-Google-Smtp-Source: AMrXdXuuPWUhrqpbC+EXNpi+uFRSkHTzvkEu/xrt7R5ehmNG8jOVZlj8Yb4OQSj2fdANxSOM3wGPVA== X-Received: by 2002:a05:6870:238f:b0:144:9783:54dd with SMTP id e15-20020a056870238f00b00144978354ddmr1462648oap.11.1671646996592; Wed, 21 Dec 2022 10:23:16 -0800 (PST) Received: from fedora.. (201-43-103-101.dsl.telesp.net.br. [201.43.103.101]) by smtp.gmail.com with ESMTPSA id w8-20020a056871060800b0014c8685f229sm514577oan.10.2022.12.21.10.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 10:23:16 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, Daniel Henrique Barboza , Bin Meng , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PATCH 01/15] tests/avocado: add RISC-V opensbi boot test Date: Wed, 21 Dec 2022 15:22:46 -0300 Message-Id: <20221221182300.307900-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221221182300.307900-1-dbarboza@ventanamicro.com> References: <20221221182300.307900-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=dbarboza@ventanamicro.com; helo=mail-oa1-x36.google.com 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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This test is used to do a quick sanity check to ensure that we're able to run the existing QEMU FW image. 'sifive_u', 'spike' and 'virt' riscv64 machines, and 'sifive_u' and 'virt' 32 bit machines are able to run the default RISCV64_BIOS_BIN | RISCV32_BIOS_BIN firmware with minimal options. Cc: Cleber Rosa Cc: Philippe Mathieu-Daudé Cc: Wainer dos Santos Moschetta Cc: Beraldo Leal Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Reviewed-by: Wainer dos Santos Moschetta --- tests/avocado/riscv_opensbi.py | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/avocado/riscv_opensbi.py diff --git a/tests/avocado/riscv_opensbi.py b/tests/avocado/riscv_opensbi.py new file mode 100644 index 0000000000..abc99ced30 --- /dev/null +++ b/tests/avocado/riscv_opensbi.py @@ -0,0 +1,65 @@ +# opensbi boot test for RISC-V machines +# +# Copyright (c) 2022, Ventana Micro +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from avocado_qemu import QemuSystemTest +from avocado_qemu import wait_for_console_pattern + +class RiscvOpensbi(QemuSystemTest): + """ + :avocado: tags=accel:tcg + """ + timeout = 5 + + def test_riscv64_virt(self): + """ + :avocado: tags=arch:riscv64 + :avocado: tags=machine:virt + """ + self.vm.set_console() + self.vm.launch() + wait_for_console_pattern(self, 'Platform Name') + wait_for_console_pattern(self, 'Boot HART MEDELEG') + + def test_riscv64_spike(self): + """ + :avocado: tags=arch:riscv64 + :avocado: tags=machine:spike + """ + self.vm.set_console() + self.vm.launch() + wait_for_console_pattern(self, 'Platform Name') + wait_for_console_pattern(self, 'Boot HART MEDELEG') + + def test_riscv64_sifive_u(self): + """ + :avocado: tags=arch:riscv64 + :avocado: tags=machine:sifive_u + """ + self.vm.set_console() + self.vm.launch() + wait_for_console_pattern(self, 'Platform Name') + wait_for_console_pattern(self, 'Boot HART MEDELEG') + + def test_riscv32_virt(self): + """ + :avocado: tags=arch:riscv32 + :avocado: tags=machine:virt + """ + self.vm.set_console() + self.vm.launch() + wait_for_console_pattern(self, 'Platform Name') + wait_for_console_pattern(self, 'Boot HART MEDELEG') + + def test_riscv32_sifive_u(self): + """ + :avocado: tags=arch:riscv32 + :avocado: tags=machine:sifive_u + """ + self.vm.set_console() + self.vm.launch() + wait_for_console_pattern(self, 'Platform Name') + wait_for_console_pattern(self, 'Boot HART MEDELEG')