From patchwork Mon Jan 20 23:51:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Tnf1IWH0; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pPw55Qjz9sPK for ; Tue, 21 Jan 2020 10:52:51 +1100 (AEDT) Received: from localhost ([::1]:45920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgqd-0000nB-TZ for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:52:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35707) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgpy-0000my-RN for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgpx-0007Wg-Ed for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:06 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:45202) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgpx-0007WR-8X; Mon, 20 Jan 2020 18:52:05 -0500 Received: by mail-wr1-x443.google.com with SMTP id j42so1262906wrj.12; Mon, 20 Jan 2020 15:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s1igqKfCso4sFnyZZ3LURygk4ICU58gQAal/3CWVEAU=; b=Tnf1IWH0vEnqN+foKGOhpWul2mMrZGPXm+xrATws3uESCw3hBk8aUaSkAwrF1/DE3/ ofOm6Q9QhSjkobenwWkGO5ZY2zF8u+a+lVsVv08fWWhgiaM38XSDzoNTm+EQHv9lBJVG HNKbmCZ/8OX94sBHY/tF0G1gy0mRgjjKgUJnPh8VCRULTpIkPUIvsFYXKtBERwjbwT01 Qj0WJoi9ZZXXhrCK7VP0+dThzOtPjtEm769LKJmWY7R1UtaTIY6Ys47ONBexVsiwVXPr IxQ3zRiCbOiWpiwdJZ38nEyvET6QEycbvpyoR2UdyI0O08Xd/oKhBRM/4K9yMVCXRr9k wvlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=s1igqKfCso4sFnyZZ3LURygk4ICU58gQAal/3CWVEAU=; b=kS9Qv6PihO2oTkLx9K8knItip6SLupU+lP6GzYJec7pPxyVI5zvFxZwkwl+Y9Ro+cZ +SpkM487f3I37jcr54wWWWtvHZ9bdzcT8Ej+gpUQrpuKmdQI7JChghXrjf09bwnhR7W/ Ri8IYayZzFZOgglI1hTUWMgd9sCKX4hC7tCH8zkgWDRk4P4DMSy2ZPTMiuVAgZYZGSOI piCOIbMBIJzmGkRNiP2BTaSzpHnhoZa+gFrklcLG6nr6geBMlcrrB3f/7kXUW/6tSzls l6DfXHvBKSClqXZceQbC/g6xujm/rtGq2tPevWXA4pr76rHUtNrcoz425oHXiZoqeq9d uLoQ== X-Gm-Message-State: APjAAAUDr+Cgnk7AfQW8JI9Wt5BSgSYYDSgAXwKkGn2r0pnQeqH1L19X nupDK1ZgUIf7U+GkUAX3yp3fRgmk X-Google-Smtp-Source: APXvYqw9JyDJc4GbeC6oCGMjB22taeNI2Xms40fwXS0CF5oAoXKRO8RpAOFjeNgk9HIICMLC2/VOUw== X-Received: by 2002:adf:f64b:: with SMTP id x11mr1806117wrp.355.1579564323829; Mon, 20 Jan 2020 15:52:03 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 1/7] hw/arm/raspi: Remove obsolete use of -smp to set the soc 'enabled-cpus' Date: Tue, 21 Jan 2020 00:51:53 +0100 Message-Id: <20200120235159.18510-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 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: Peter Maydell , Eduardo Habkost , Alistair Francis , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, "Emilio G . Cota" , Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since we enabled parallel TCG code generation for softmmu (see commit 3468b59 "tcg: enable multiple TCG contexts in softmmu") and its subsequent fix (commit 72649619 "add .min_cpus and .default_cpus fields to machine_class"), the raspi machines are restricted to always use their 4 cores: See in hw/arm/raspi2 (with BCM283X_NCPUS set to 4): 222 static void raspi2_machine_init(MachineClass *mc) 223 { 224 mc->desc = "Raspberry Pi 2"; 230 mc->max_cpus = BCM283X_NCPUS; 231 mc->min_cpus = BCM283X_NCPUS; 232 mc->default_cpus = BCM283X_NCPUS; 235 }; 236 DEFINE_MACHINE("raspi2", raspi2_machine_init) We can no longer use the -smp option, as we get: $ qemu-system-arm -M raspi2 -smp 1 qemu-system-arm: Invalid SMP CPUs 1. The min CPUs supported by machine 'raspi2' is 4 Since we can not set the TYPE_BCM283x SOC "enabled-cpus" with -smp, remove the unuseful code. We can achieve the same by using the '-global bcm2836.enabled-cpus=1' option. Reported-by: Laurent Bonnans Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- Cc: Emilio G. Cota Cc: Richard Henderson Cc: Andrew Baumann Cc: Eduardo Habkost --- hw/arm/raspi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 6a510aafc1..3996f6c63a 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -192,8 +192,6 @@ static void raspi_init(MachineState *machine, int version) /* Setup the SOC */ object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram), &error_abort); - object_property_set_int(OBJECT(&s->soc), machine->smp.cpus, "enabled-cpus", - &error_abort); int board_rev = version == 3 ? 0xa02082 : 0xa21041; object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev", &error_abort); From patchwork Mon Jan 20 23:51:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TJNplbe2; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pSx36VPz9sPK for ; Tue, 21 Jan 2020 10:55:29 +1100 (AEDT) Received: from localhost ([::1]:45946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgtC-0004dV-CX for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:55:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35725) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgq0-0000n5-Cj for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgpz-0007X5-7y for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:08 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:40815) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgpz-0007Wo-0t; Mon, 20 Jan 2020 18:52:07 -0500 Received: by mail-wm1-x336.google.com with SMTP id t14so1130336wmi.5; Mon, 20 Jan 2020 15:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mHOBTTcVp9EP98oXfsYEhgEPBD3nh+UXg7LeIFUoJ4Q=; b=TJNplbe2btvc0+SuQm0uMKluglrZPDz6clmgWyWIp/0bj2pml6R1qYMYimlABEC8vu bpUC3OBQO/Q75PBKmo61h9fxw5fh394PQKFJZqiMt7khYTAEYuzaFMJsZTuGo4cVHUxB +nXTQm3RciCbTdUDE8E0UQVstb2xpcnsD1XWyQUuIZYda4Mi9i0ZhS/DuJJ3iTKryt5U LN/8Qtck4j7/Cld47VdJkLPsrE8WgvNU3P1h6F0cfD19/n8YNKy1Mm6sIgPeV/XnJwZE NSW5JMugdg2Jn9LIA+NBXRpiPk3YlRTn9rM1d4S7mvhD+9WDIC/6ieaTcYCercEB3aSk 5HmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mHOBTTcVp9EP98oXfsYEhgEPBD3nh+UXg7LeIFUoJ4Q=; b=Bw1jX+dmIWEeq1PYGPVToyHIlMN4ZXm/1XLpj9AiWl9h+Gl6xTHE907Bz60sFfAyt9 PG+q2Vco5Ibqu4Rxm7zqSpqmL7LQNPo3MD9OF7phggw04SlTZaRt2uTWFraXsC7RY/rM taDwOKjPbfuVkgGbf6Lq3VAvhgyqVKN9kYXdmGfQe0iqL+NjiTiFPS7Rguq+NrqgHnPx AuWujcVWuHtip4STsfKCC4vC9l1tfsSG3ljIzYXTwP/9YqJxJ6TOltLZnRJ7rFea+g1f IU1mC6jeEQwxnM/iZBxrot6XsvG91uJmUrdi/6gNKlocfMLjEaSw94CyF5xm3Th1gqQB eP+A== X-Gm-Message-State: APjAAAX2c57bHnXxM/k4KU6smJ8YbHRBWoicQWCQL7sOTAH0B51hhdQT H5jRD6Sa8rr0XriiDnv2cBlumot9 X-Google-Smtp-Source: APXvYqyGsLNH2wfr8Mk4tnXUJV/4J72Bnw9ZmIo3LHUvtoRV3y+zge5jwgIKbS1+mujuWyTRvkmYyw== X-Received: by 2002:a1c:5419:: with SMTP id i25mr1229047wmb.150.1579564325471; Mon, 20 Jan 2020 15:52:05 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 2/7] Acceptance tests: Extract _console_interaction() Date: Tue, 21 Jan 2020 00:51:54 +0100 Message-Id: <20200120235159.18510-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 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: Peter Maydell , Eduardo Habkost , Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Andrew Baumann , Niek Linnenbank , qemu-arm@nongnu.org, Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since we are going to re-use the code shared between wait_for_console_pattern() and exec_command_and_wait_for_pattern(), extract the common part into a local function. Tested-by: Niek Linnenbank Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick Tested-by: Liam Merwick Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/avocado_qemu/__init__.py | 31 +++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 6618ea67c1..0a50fcf2be 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -55,19 +55,14 @@ def pick_default_qemu_bin(arch=None): return qemu_bin_from_src_dir_path -def wait_for_console_pattern(test, success_message, failure_message=None): - """ - Waits for messages to appear on the console, while logging the content - - :param test: an Avocado test containing a VM that will have its console - read and probed for a success or failure message - :type test: :class:`avocado_qemu.Test` - :param success_message: if this message appears, test succeeds - :param failure_message: if this message appears, test fails - """ +def _console_interaction(test, success_message, failure_message, + send_string): console = test.vm.console_socket.makefile() console_logger = logging.getLogger('console') while True: + if send_string: + test.vm.console_socket.sendall(send_string.encode()) + send_string = None # send only once msg = console.readline().strip() if not msg: continue @@ -79,6 +74,17 @@ def wait_for_console_pattern(test, success_message, failure_message=None): fail = 'Failure message found in console: %s' % failure_message test.fail(fail) +def wait_for_console_pattern(test, success_message, failure_message=None): + """ + Waits for messages to appear on the console, while logging the content + + :param test: an Avocado test containing a VM that will have its console + read and probed for a success or failure message + :type test: :class:`avocado_qemu.Test` + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + """ + _console_interaction(test, success_message, failure_message, None) def exec_command_and_wait_for_pattern(test, command, success_message, failure_message=None): @@ -94,10 +100,7 @@ def exec_command_and_wait_for_pattern(test, command, :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails """ - command += '\r' - test.vm.console_socket.sendall(command.encode()) - wait_for_console_pattern(test, success_message, failure_message) - + _console_interaction(test, success_message, failure_message, command + '\r') class Test(avocado.Test): def _get_unique_tag_val(self, tag_name): From patchwork Mon Jan 20 23:51:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=kxuo5rVW; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pQ63ZqVz9sR4 for ; Tue, 21 Jan 2020 10:53:02 +1100 (AEDT) Received: from localhost ([::1]:45924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgqp-0000tq-Tt for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:52:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35746) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgq1-0000o4-IL for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgq0-0007Xe-Fs for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:09 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgq0-0007XJ-AA; Mon, 20 Jan 2020 18:52:08 -0500 Received: by mail-wr1-x435.google.com with SMTP id b6so1356224wrq.0; Mon, 20 Jan 2020 15:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=crNrzD0/605/2sD0Sp9He00HXeVMYerdORad4uvVDcE=; b=kxuo5rVWjDTffz4ytyrVJ/q30CW+2GTdviPsZYa2NvkcoNJd3VZUtS7E4b0ZQFhuwg QOj1MWlVc9Lg3xu9BHHQPw/s2YFRcTpnjQ/z6jvnkegS86XMVsX80SN86AOaHDs/MLGm Ba+b5Yl96YsykrBVuOC5VqMXvlEJrgL9o3R6A7R/qJTMYEjlup/Wb+Tgfm4q5r7Otsrn hM3EH/ns763E2JYr/e/LlENz54eieHe0PY89dNEskJ97UnwZ4Wvh9NfyKe7ETG34m85t jtxP8NeTgtqbm+8iJ3SeBVCpGPI0ikINCoXs8MsajD59ksGhY6V+JIn+cDfO0rILs7gV GN9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=crNrzD0/605/2sD0Sp9He00HXeVMYerdORad4uvVDcE=; b=AJUTyZiT2UNphcTu+Dd0wOTZGJlX81Vqql2ZEugbv9vioM/r+aXNaZ5vN4CrO4T1Zw aB4yZJFyZ9HVldzcIpJJhRV/tiUde1KDSpZhIQ/ETT/aO3jEp4JO7rYbvmMuQ/2LFaXn 0Bgxy85GsE4Nymy/saRJQUvIL1SwTK3mho+Twe84AAFb6MxK/S8rGVe/4N8sS9QZQyjq o7Lls1MrgFiqFGQa37gvu2jM9W7ztrFIXjQTG6+XxeTEBSsg+dZbRnFR1jk/ddSNiDYc CmZ1HlnVxnFtxeCEVsmRJhy4Z7jyUikdd3CYgahp+M4smItC05Jz9Kk2nfVOPeoinOXz wAgw== X-Gm-Message-State: APjAAAUx9lvuLVUKI0jXlbmKb/WH4wmQHomFmtrwGpjdbg5jB9vfSuOE vwfiXnyrPc9zBmmSpCjvsei5BWWg X-Google-Smtp-Source: APXvYqwYNLlmZM097nqk+YcYCBWtQA94HNSiH+j21tF7RlbBe77pze6scg1TfFhVvlavc+pg9ju7BA== X-Received: by 2002:adf:e609:: with SMTP id p9mr1809278wrm.397.1579564326972; Mon, 20 Jan 2020 15:52:06 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 3/7] Acceptance tests: Add interrupt_interactive_console_until_pattern() Date: Tue, 21 Jan 2020 00:51:55 +0100 Message-Id: <20200120235159.18510-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 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: Peter Maydell , Eduardo Habkost , Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Andrew Baumann , Niek Linnenbank , qemu-arm@nongnu.org, Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We need a function to interrupt interactive consoles. Example: Interrupt U-Boot to set different environment values. Tested-by: Niek Linnenbank Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick Tested-by: Liam Merwick Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/avocado_qemu/__init__.py | 32 +++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 0a50fcf2be..d4358eb431 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -56,13 +56,15 @@ def pick_default_qemu_bin(arch=None): def _console_interaction(test, success_message, failure_message, - send_string): + send_string, keep_sending=False): + assert not keep_sending or send_string console = test.vm.console_socket.makefile() console_logger = logging.getLogger('console') while True: if send_string: test.vm.console_socket.sendall(send_string.encode()) - send_string = None # send only once + if not keep_sending: + send_string = None # send only once msg = console.readline().strip() if not msg: continue @@ -74,6 +76,32 @@ def _console_interaction(test, success_message, failure_message, fail = 'Failure message found in console: %s' % failure_message test.fail(fail) +def interrupt_interactive_console_until_pattern(test, success_message, + failure_message=None, + interrupt_string='\r'): + """ + Keep sending a string to interrupt a console prompt, while logging the + console output. Typical use case is to break a boot loader prompt, such: + + Press a key within 5 seconds to interrupt boot process. + 5 + 4 + 3 + 2 + 1 + Booting default image... + + :param test: an Avocado test containing a VM that will have its console + read and probed for a success or failure message + :type test: :class:`avocado_qemu.Test` + :param success_message: if this message appears, test succeeds + :param failure_message: if this message appears, test fails + :param interrupt_string: a string to send to the console before trying + to read a new line + """ + _console_interaction(test, success_message, failure_message, + interrupt_string, True) + def wait_for_console_pattern(test, success_message, failure_message=None): """ Waits for messages to appear on the console, while logging the content From patchwork Mon Jan 20 23:51:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OuN8sqJ+; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pQ62ztBz9sR1 for ; Tue, 21 Jan 2020 10:53:02 +1100 (AEDT) Received: from localhost ([::1]:45926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgqp-0000ub-Rx for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:52:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35775) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgq2-0000qE-PC for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgq1-0007YI-Nv for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:10 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:41970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgq1-0007Xo-IB; Mon, 20 Jan 2020 18:52:09 -0500 Received: by mail-wr1-x444.google.com with SMTP id c9so1294990wrw.8; Mon, 20 Jan 2020 15:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aEBTxw5dxXldbptfzGuLoP7HN5dwcK1pAxxrXdVbFGw=; b=OuN8sqJ+46BNhueMqUgdhNwS/oJkcMc26d3FfPIFiyRrnMULh8G7eaw9Ezmy8/SshI ERSBy1vobYxZ3Ml/SWqtktCS89ohJYXVBqzN482s07O/eysvi6+fLBQf2FPVVcvA0yTT SfptKQ64HlTt7pjaD3NksuZMkBjtVbPulxMOzBgjUEyT0D/xQ4C4d9PwYBt1yrORHulo Ui86+/89SVfMQ6EX0WI1cAY3MdRNwCqyYkALYRmpxstF7p6A1tv/iQmnOTFn0tXMDfNL gUPiIaSlK+m2LnXwzw2x/2DiL/XLok1F4EqimE0Xeh/aPtipRGVtBvALi0mlm4DGIflE 0yNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aEBTxw5dxXldbptfzGuLoP7HN5dwcK1pAxxrXdVbFGw=; b=UouEf+nlH49zXmRvYEzzspgHyxSQaVubctX5hmx+hL6CKkRpm5Av9pgdrk4F8B1R4d O2hD1mseD8zIG24OnXJTaxb3npylNpXZlVngiD99VIMzYC4u7zdbmrWk3AzaNikndmVk H4IiTw9FlC+1e5EufbYP9DN2BdHh2OkUzn0UrAdIbCMpuy1cUKiRSggsC+i7SuNjXl0s d3/00qLjwJUe+BBld63feutmtIQPXw2ZR9ChENP4475bXskuVnmMvgquPVuhLJwCV243 y8OqbhNgYpncYGYrNKtRrQHZUn9wFCtjennezc1xHghHum5rbhruhGVOhJB1Ho8tq82i O0nA== X-Gm-Message-State: APjAAAWtNSwEOT/8Rra9qT8nVPJnLcp9VAisuf340ZDxiKRdva/myXYV R3LdoPsm9SjTxD41fgWlV8KiI8hU X-Google-Smtp-Source: APXvYqwtefE8PNG3BRbUSqN8OO4ScMbKzke5alBM/L4uH03Vz/GJZgPBIyroxlU2BAzLGaU2kTmNKw== X-Received: by 2002:a5d:53d1:: with SMTP id a17mr1735996wrw.327.1579564328329; Mon, 20 Jan 2020 15:52:08 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 4/7] python/qemu/machine: Allow to use other serial consoles than default Date: Tue, 21 Jan 2020 00:51:56 +0100 Message-Id: <20200120235159.18510-5-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 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: Peter Maydell , Eduardo Habkost , Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Currently the QEMU Python module limits the QEMUMachine class to use the first serial console. Some machines/guest might use another console than the first one as the 'boot console'. For example the Raspberry Pi uses the second (AUX) console. To be able to use the Nth console as default, we simply need to connect all the N - 1 consoles to the null chardev. Add an index argument, so we can use a specific serial console as default. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Liam Merwick Tested-by: Liam Merwick Reviewed-by: Wainer dos Santos Moschetta --- v2: - renamed 'console_index', added docstring (Cleber) - reworded description (pm215) --- python/qemu/machine.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 734efd8536..ef9f5b213f 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -241,6 +241,8 @@ class QEMUMachine(object): 'chardev=mon,mode=control']) if self._machine is not None: args.extend(['-machine', self._machine]) + for i in range(self._console_index): + args.extend(['-serial', 'null']) if self._console_set: self._console_address = os.path.join(self._sock_dir, self._name + "-console.sock") @@ -527,7 +529,7 @@ class QEMUMachine(object): """ self._machine = machine_type - def set_console(self, device_type=None): + def set_console(self, device_type=None, console_index=0): """ Sets the device type for a console device @@ -548,9 +550,14 @@ class QEMUMachine(object): chardev:console" command line argument will be used instead, resorting to the machine's default device type. + @param console_index: the index of the console device to use. + If not zero, the command line will create + 'index - 1' consoles and connect them to + the 'null' backing character device. """ self._console_set = True self._console_device_type = device_type + self._console_index = console_index @property def console_socket(self): From patchwork Mon Jan 20 23:51:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=mlUzk62W; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pWg6xK0z9sR4 for ; Tue, 21 Jan 2020 10:57:51 +1100 (AEDT) Received: from localhost ([::1]:46016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgvT-0007wC-HY for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:57:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35804) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgq4-0000tX-Js for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgq3-0007Yt-8J for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:12 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:52653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgq3-0007YW-2G; Mon, 20 Jan 2020 18:52:11 -0500 Received: by mail-wm1-x341.google.com with SMTP id p9so1122398wmc.2; Mon, 20 Jan 2020 15:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HmU95xX8aiHgv582n9n1gFgP0RnyUSIOGgAammjQwq4=; b=mlUzk62WQoMQEbBYRE/ABkDc5CQXIEkYrOaWG4g8743z0u/9C6YQGlQEcHBvIBLvGa ctWfebxGlSn2s1qs+SQrzxhyLWMP/yyGUc3nxO28IWc1TQCU/ypHEs6WZlZ91Q/SVIIk BLmOsCOuF5HuIg+YiB9PH3JtILgKNabEltxaYKJZfF9DB3TMImb0dQ6HJwtKh0EnKQu2 9hHK3J86JMPenrtJ2269jwERK28sE3ay7UB35Kvtp0sJ5spQM66A1ITuCV8KQ/CJOc0y cdv/qeyfrxO4VG+bIc5WbVRNfCNrPm01+MK2+kBP1/ujyUswgJ7wClfATCvjb3Flw22w K0SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HmU95xX8aiHgv582n9n1gFgP0RnyUSIOGgAammjQwq4=; b=Z6ej/JuB6KjlnlGC/valabA1HgGz732pkWnZozwF49kroAZ9WfnUibxsSi8TaRg6hH YSeTS6DyzN6+3gS0O+WkrrIpnEse6eaijWBSW3ozkjvo88cwEI8tT4yB7FxkNaagXSLk Eoj11VJ4hbuKeDgZ79RdqttoICK3cDmfzGWVlW6rf2CP7ecEvoz4gSJXTBmTWuk/L+B3 dJ3nLkFRBPZbXycFaooQw5NLEilTnETtYN7dIOq/XoXOwx/wzN2767cWsOhr1zkVAuOQ ESXcd6Zb681SEYKxnU6AoJjazD2qksOyHxeliLsraYz11Xvg1NK/nweF/Qmw+GIgM0Sg Ts/w== X-Gm-Message-State: APjAAAX7Ieh912coLqYmArVKBZQrsUwQHv1UKnx3i3mfNVifr+skvYBx dNLhdUgRbcDVFOU7BmlF+vhpsKV+ X-Google-Smtp-Source: APXvYqwnFzclMaLm13lPJ3Aaimid5Vi0wZtLRoWaO9ia65KfWufKz6fm7/JH+4tbW23v1tK9pO3Vfg== X-Received: by 2002:a7b:c74c:: with SMTP id w12mr1155175wmk.1.1579564329908; Mon, 20 Jan 2020 15:52:09 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 5/7] tests/boot_linux_console: Test booting U-Boot on the Raspberry Pi 2 Date: Tue, 21 Jan 2020 00:51:57 +0100 Message-Id: <20200120235159.18510-6-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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: Peter Maydell , Eduardo Habkost , Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This test runs U-Boot on the Raspberry Pi 2. It is very simple and fast: $ avocado --show=app,console run -t raspi2 -t u-boot tests/acceptance/ JOB LOG : avocado/job-results/job-2020-01-20T23.40-2424777/job.log (1/1) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_uboot: console: MMC: sdhci@7e300000: 0 console: Loading Environment from FAT... Card did not respond to voltage select! console: In: serial console: Out: vidconsole console: Err: vidconsole console: Net: No ethernet found. console: starting USB... console: USB0: Port not available. console: Hit any key to stop autoboot: 0 console: U-Boot> console: U-Boot> bdinfo console: arch_number = 0x00000000 console: boot_params = 0x00000100 console: DRAM bank = 0x00000000 console: -> start = 0x00000000 console: -> size = 0x3c000000 console: baudrate = 115200 bps console: TLB addr = 0x3bff0000 console: relocaddr = 0x3bf64000 console: reloc off = 0x3bf5c000 console: irq_sp = 0x3bb5fec0 console: sp start = 0x3bb5feb0 console: Early malloc usage: 2a4 / 400 console: fdt_blob = 0x3bfbdfb0 console: U-Boot> version console: U-Boot 2019.01+dfsg-7 (May 14 2019 - 02:07:44 +0000) console: gcc (Debian 8.3.0-7) 8.3.0 console: GNU ld (GNU Binutils for Debian) 2.31.1 console: U-Boot> reset console: resetting ... PASS (0.46 s) U-Boot is built by the Debian project, see: https://wiki.debian.org/InstallingDebianOn/Allwinner#Creating_a_bootable_SD_Card_with_u-boot Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/boot_linux_console.py | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index e40b84651b..682b801b4f 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -16,6 +16,7 @@ import shutil from avocado import skipUnless from avocado_qemu import Test from avocado_qemu import exec_command_and_wait_for_pattern +from avocado_qemu import interrupt_interactive_console_until_pattern from avocado_qemu import wait_for_console_pattern from avocado.utils import process from avocado.utils import archive @@ -485,6 +486,33 @@ class BootLinuxConsole(Test): exec_command_and_wait_for_pattern(self, 'reboot', 'reboot: Restarting system') + def test_arm_raspi2_uboot(self): + """ + :avocado: tags=arch:arm + :avocado: tags=machine:raspi2 + :avocado: tags=u-boot + """ + deb_url = ('https://snapshot.debian.org/archive/debian/' + '20190514T084354Z/pool/main/u/u-boot/' + 'u-boot-rpi_2019.01%2Bdfsg-7_armhf.deb') + deb_hash = 'ad858cf3afe623b6c3fa2e20dcdd1768fcb9ae83' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) + uboot_path = '/usr/lib/u-boot/rpi_2/uboot.elf' + uboot_path = self.extract_from_deb(deb_path, uboot_path) + + self.vm.set_console() + self.vm.add_args('-kernel', uboot_path, + # VideoCore starts CPU with only 1 core enabled + '-global', 'bcm2836.enabled-cpus=1', + '-no-reboot') + self.vm.launch() + interrupt_interactive_console_until_pattern(self, + 'Hit any key to stop autoboot:', + 'Config file not found') + exec_command_and_wait_for_pattern(self, 'bdinfo', 'U-Boot') + exec_command_and_wait_for_pattern(self, 'version', 'U-Boot') + exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...') + def test_s390x_s390_ccw_virtio(self): """ :avocado: tags=arch:s390x From patchwork Mon Jan 20 23:51:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FNIcu8P9; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pTT2m7rz9sPK for ; Tue, 21 Jan 2020 10:55:57 +1100 (AEDT) Received: from localhost ([::1]:45986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgte-0005jw-Sj for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:55:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35824) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgq6-0000wO-0W for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgq4-0007ZV-Kl for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:13 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:54522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgq4-0007ZD-Em; Mon, 20 Jan 2020 18:52:12 -0500 Received: by mail-wm1-x343.google.com with SMTP id b19so1111185wmj.4; Mon, 20 Jan 2020 15:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cHS3FjXLbTLzmIwcw2Unra+V5Z15Z+SL0w/UZTVUHm8=; b=FNIcu8P9iBjUhFWj29G0rbmPu/hCc1pIPoxFZtaVmyv9fp5QVMXcKeBxwCHHJLniWL IH4fT/ysmcIwg8Un3JyijcT7GsW05ACRvAdhTPL2EHezewsybgxsbXAgTnHgEvgZY8Hv qQWQT3K8bmwuAkxxjRmQv8+AhC0+cS///qWB+x9mPcb5WuUSgNhlGK7qInC0RaiSThiI u0WB8VdGa8kfO7mixea6Ty3DY5EtxuOzjXkXRhvd0MnlPAIuq7GY7O5slqqWkwz8nkbC CerL0+6KeykQmHupV1EPLvsf+/BAD6w/CELRkJhcDcgcfRWkNzx33PLlWfTYsuDBh0fM Ljig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cHS3FjXLbTLzmIwcw2Unra+V5Z15Z+SL0w/UZTVUHm8=; b=te2O9Z6FLkZPpa1nN0Um0bzTxNRKYjcIQPNqsBBoYPS4kMcSctlksPuoocEFrYSgKW ZbbBvT+66QIAUnB4+pPbONPIlsRUBmEh07sEN6Yy+wPY8pJl3BQhIMlu/yj5ZglbAHsF KA5rMJpJKYXV19HW555xdGEmD5mURYL00EaTh6hK+GSX7DSeQXrf7vKEUd21ieJiJXqC GxMQDx9ubaU+lPQhy2MrlIQVYvoOqIaGgCMi3ezoy1ZPBZEEVxPUU6W6UQXSGzK9dn1v lny/lLtByH7vIyw/JF7Am1jHCs0SDK1wDZjFgeFLuT9GfrL6uKcrwdoH5hwbWY9RQieA y0AA== X-Gm-Message-State: APjAAAUz6VgnhFXWdXRHrCOXhJexsF9GyiN1YmKcamaDtH0uwzVp76Gp MndkV+nYRl0L2sMuYZk++C0EkRhm X-Google-Smtp-Source: APXvYqyjPaUtMXUHy+zIWqESIdWFZZAXZFOJ/uotc5qrK1/gUZLBDebTYbthC2MnqA+dQVLRg9thVQ== X-Received: by 2002:a05:600c:118a:: with SMTP id i10mr1240269wmf.142.1579564331275; Mon, 20 Jan 2020 15:52:11 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 6/7] tests/boot_linux_console: Test booting U-Boot on the Raspberry Pi 3 Date: Tue, 21 Jan 2020 00:51:58 +0100 Message-Id: <20200120235159.18510-7-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 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: Peter Maydell , Eduardo Habkost , Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This test runs U-Boot on the Raspberry Pi 3. It is very simple and fast: $ avocado --show=app,console run -t raspi3 -t u-boot tests/acceptance/ JOB LOG : avocado/job-results/job-2020-01-20T23.40-2424777/job.log (1/1) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_aarch64_raspi3_uboot: console: MMC: mmc@7e202000: 0, sdhci@7e300000: 1 console: Loading Environment from FAT... WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()! console: WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()! console: Card did not respond to voltage select! console: In: serial console: Out: vidconsole console: Err: vidconsole console: Net: No ethernet found. console: starting USB... console: Bus usb@7e980000: Port not available. console: Hit any key to stop autoboot: 0 console: U-Boot> console: U-Boot> console: U-Boot> bdinfo console: arch_number = 0x0000000000000000 console: boot_params = 0x0000000000000100 console: DRAM bank = 0x0000000000000000 console: -> start = 0x0000000000000000 console: -> size = 0x000000003c000000 console: baudrate = 115200 bps console: TLB addr = 0x000000003bff0000 console: relocaddr = 0x000000003bf57000 console: reloc off = 0x000000003bed7000 console: irq_sp = 0x000000003bb52dd0 console: sp start = 0x000000003bb52dd0 console: FB base = 0x0000000000000000 console: Early malloc usage: 7b0 / 2000 console: fdt_blob = 0x000000003bfbf200 console: U-Boot> version console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +0000) console: gcc (Debian 9.2.1-22) 9.2.1 20200104 console: GNU ld (GNU Binutils for Debian) 2.33.1 console: U-Boot> reset console: resetting ... PASS (1.79 s) U-Boot is built by the Debian project, see: https://wiki.debian.org/InstallingDebianOn/Allwinner#Creating_a_bootable_SD_Card_with_u-boot Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/boot_linux_console.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 682b801b4f..22b360118d 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -513,6 +513,31 @@ class BootLinuxConsole(Test): exec_command_and_wait_for_pattern(self, 'version', 'U-Boot') exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...') + def test_aarch64_raspi3_uboot(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=machine:raspi3 + :avocado: tags=u-boot + """ + deb_url = ('https://snapshot.debian.org/archive/debian/' + '20200108T145233Z/pool/main/u/u-boot/' + 'u-boot-rpi_2020.01%2Bdfsg-1_arm64.deb') + deb_hash = 'f394386e02469d52f2eb3c07a2325b1c95aeb00b' + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) + uboot_path = '/usr/lib/u-boot/rpi_3/u-boot.bin' + uboot_path = self.extract_from_deb(deb_path, uboot_path) + + self.vm.set_console(console_index=1) + self.vm.add_args('-kernel', uboot_path, + '-no-reboot') + self.vm.launch() + interrupt_interactive_console_until_pattern(self, + 'Hit any key to stop autoboot:', + 'Config file not found') + exec_command_and_wait_for_pattern(self, 'bdinfo', 'U-Boot') + exec_command_and_wait_for_pattern(self, 'version', 'U-Boot') + exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...') + def test_s390x_s390_ccw_virtio(self): """ :avocado: tags=arch:s390x From patchwork Mon Jan 20 23:51:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1226186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=n77fPCT7; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 481pXQ2n1Pz9sPK for ; Tue, 21 Jan 2020 10:58:29 +1100 (AEDT) Received: from localhost ([::1]:46026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgw5-0008Sw-Pe for incoming@patchwork.ozlabs.org; Mon, 20 Jan 2020 18:58:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35839) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itgq7-0000yC-3a for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itgq5-0007a2-QX for qemu-devel@nongnu.org; Mon, 20 Jan 2020 18:52:14 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:42847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itgq5-0007Zl-Kc; Mon, 20 Jan 2020 18:52:13 -0500 Received: by mail-wr1-x444.google.com with SMTP id q6so1277424wro.9; Mon, 20 Jan 2020 15:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5pr6W5RFhMmV9VGbpJaWwEgOlR2uCM7o5V9+FQdTDQg=; b=n77fPCT76au2bt4wgItA9oPwh8goAaRwjz/XWNjzSHPgFgiqeCUbZs/Gwk75ICiiWU CkB1YJc3piup8Lo5nMa4JSqP4drqOhyH4aVmpncPwOdZhyBko2myFSYQSzAfomWbNr0M GY9zwk1oww8+1qQxsZD3kr8rkDIKKlun3D4rwT5TAvTxQFHiJO73+KvSeYbakPdRetuC BViRVTA3I6Dj3A/3M/UAKFKJ6GnuryuFmmX0vC+E5C1nWNf6skl7S8ieTYwy/IUHFsig LiwVQBuZdFDzQy11W3OsZfmKpV5wlVGTDYI5Aq3J2oeOsC+ZOeOS8LdaLng20u29rJFw wiRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5pr6W5RFhMmV9VGbpJaWwEgOlR2uCM7o5V9+FQdTDQg=; b=tFkiadY+oTUDRmGxJ8lqdkIOz7gSUY5HvEAJXV+MyxUUcxZaH6kyqwJf/ZVpAE1Ifu +BhR2JBla7ZaVXmixu1sSkHYpoZhwc7ef5ELwwp/AiX9mYLlvbLBPJH3zpq6KkRUnwsa R5LSnoCAKcSYtlrAAZWwCbtP/FvfJw/t6kPIbu/p0iSPFBqLoxBNjTWvTe9O547OCZYv /9bjci90kiUo8tGwzlz9MKtfSxkOol2ApIEzEeKglasbuKJ6OClBiBmQ+I737HoWBvi/ jpzAL54+d4eukSNNpaTMaUAFI18/7sEHq/OsVT8S1dwVNXnrJy3/6q+qvALssYzHrSna aV6Q== X-Gm-Message-State: APjAAAXU2/CrU9r4W3SQWO01OaJAqWuEQbUTyRzL3GOwcZjwmDMDl1nU qVwWWjFtKbMRsSeb2mlDzwpQr1cY X-Google-Smtp-Source: APXvYqzRCs2EPTAbghMVhHr+LbAI2QMePPm+oDeRbPaYPGkBzeEuaEa1KgBWPMmLy6tTnoDCRasX3A== X-Received: by 2002:a5d:4651:: with SMTP id j17mr1848778wrs.237.1579564332549; Mon, 20 Jan 2020 15:52:12 -0800 (PST) Received: from x1w.redhat.com (113.red-83-57-172.dynamicip.rima-tde.net. [83.57.172.113]) by smtp.gmail.com with ESMTPSA id d8sm48655269wrx.71.2020.01.20.15.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 15:52:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 7/7] tests/boot_linux_console: Tag Emcraft Smartfusion2 as running 'u-boot' Date: Tue, 21 Jan 2020 00:51:59 +0100 Message-Id: <20200120235159.18510-8-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200120235159.18510-1-f4bug@amsat.org> References: <20200120235159.18510-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 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: Peter Maydell , Eduardo Habkost , Alistair Francis , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Cleber Rosa , Laurent Bonnans , Cheng Xiang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Avocado tags are handy to automatically select tests matching the tags. Since this test also runs U-Boot, tag it. We can run all the tests using U-Boot as once with: $ avocado --show=app run -t u-boot tests/acceptance/ JOB LOG : avocado/job-results/job-2020-01-21T00.16-ee9344e/job.log (1/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_emcraft_sf2: PASS (16.59 s) (2/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_uboot: PASS (0.47 s) (3/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_aarch64_raspi3_uboot: PASS (2.43 s) RESULTS : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 19.78 s Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/boot_linux_console.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 22b360118d..4a4cf9d0ea 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -305,6 +305,7 @@ class BootLinuxConsole(Test): :avocado: tags=arch:arm :avocado: tags=machine:emcraft-sf2 :avocado: tags=endian:little + :avocado: tags=u-boot """ uboot_url = ('https://raw.githubusercontent.com/' 'Subbaraya-Sundeep/qemu-test-binaries/'