From patchwork Thu Apr 27 15:45:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 677529 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp415903wrs; Thu, 27 Apr 2023 08:49:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UEFY8G114Jhnv0YPxN15eL7xs8t3auPWK9MeUgKQaD/8jmNRcwCMV509BVnLFLF30XhAL X-Received: by 2002:a05:622a:109:b0:3e9:2f1b:c85b with SMTP id u9-20020a05622a010900b003e92f1bc85bmr2964805qtw.51.1682610545039; Thu, 27 Apr 2023 08:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682610545; cv=none; d=google.com; s=arc-20160816; b=v/Pkn4fUE12dcE3mS9PW7Kiwomp/+7v69p+G9HJM0gMGWwo9mshll2aiSj4VT0+IiU vUz4q2VUNgF4K3j22nHxZxKjn6KQbVigTXOMC1CH0134+cf4aabWpDPRgs8NROB1VS/Y E6191fBrPetgvgaXmCpAs4i9cVfCSFtag3Exb7ldmRnLkxCPbxmFpno0uO0ef6rH6Ea/ RFbOA+nmGuzE48sbv2jUiRsYwXeYcWx1NzscKlvO1rUlzAf8HTBJb8aj9ba4qsCn21e+ euSFFkpZAxvSq5X2+asxM4qjxEwSPZ4ZyjObNQuzHWAB9ca4+rsjmJeT4KsBFHWqmlGO WG6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5NIko2Gkapa67pYfAhG5iuG1fjGYEcV1kfLWbhJ/29M=; b=DnEB7KTtZ8wUAHwRA9C/CseFhfKfIGpEJGiAksXVRlaIuXdcmvtakfFIod93Ru0KAN BR2uWYJv8KrLgZ02+cAx/TbEiFuB16q6Fy82SkMh9Qk9UGBCo1YvnOIVE9lAwqfnYUv3 sC8hXRkT5OKNqx4xmCl1FxwPu0dLDrwkaJk2QnPPemw17yfxSeiYhGgtEy6lAks44tOi TX6osZQpYDxJo+k47tQba/qsR5lRAY2KeGRdTvKdgXOAgdM3vFSzFrwI/8hfDJm/Qn+y zWRBM1t5RC8NYh+SQ4ciVNbqzjVR49FC9uiMCLg568uquOoEmTdozx0k1QKKD/eY1/gD Jy7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R/YfWNF7"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g2-20020a05620a40c200b0074c600f92f6si12682072qko.577.2023.04.27.08.49.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Apr 2023 08:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R/YfWNF7"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ps3of-0002Eu-G0; Thu, 27 Apr 2023 11:45:53 -0400 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 1ps3o8-0001qC-0x for qemu-devel@nongnu.org; Thu, 27 Apr 2023 11:45:20 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ps3o5-0004ko-Dr for qemu-devel@nongnu.org; Thu, 27 Apr 2023 11:45:19 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f1950f5676so75277875e9.3 for ; Thu, 27 Apr 2023 08:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682610314; x=1685202314; 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=5NIko2Gkapa67pYfAhG5iuG1fjGYEcV1kfLWbhJ/29M=; b=R/YfWNF7TxvKeV1Jam9mUpdUzX5F/j8f3yUjjo5v1YTiKoGQLZzgqNO+J5bMlzdgaX KNYx6dzjxxWNl/Vx15ZP4YACRo7lUxJlKyOBlWnmgLlA0QgV1e1E/ivQAgo35chPEcBD 83qMLNRouxUx+uX6+bq0G1HsEIsNXNJiu2mqJY24SawKiUE7eQFX2JHZdibyA3PiW+XP lKEACrJBlGT/zl37JyjtW5TKTtCJN0zwrt+1hnJ8P/24TGdxYANRqaYmbM+AJFbiGSCB kmT2M/QdLlKMWJOagyXLAPHV4KejDecex24vvujwUuPX/bYjsr4Zp0x9Q+rtl6qsZRzs kUxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682610314; x=1685202314; 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=5NIko2Gkapa67pYfAhG5iuG1fjGYEcV1kfLWbhJ/29M=; b=V6/2MFLALYQOVJ8wdD18WPTvUb7GGXPcZyKMnBTW7QXkCR8fManufw+YwrT2vicUy7 RC8NUfG5BmUC+62Dw/PvNue4/Xe9oR1qzhomitnplw5aGQby+Xsa/U5NutBODa9OEPo9 sQ1mZFa9WGg6wb75mKG5hkblGy/1txSRciHag4shs2D8jwhuY3ru5qN3yIBF96j0gH4T L9UuuJ2RA9Vg0B5DxMNKr7nwe80t2rOR7g8ZqcZBpaWbxDl0m9yP6nsUYDLklMFRhbhy z0+ICYElGW63IGhr9Tv2e22CiLtfk+WNvLMyiyRT064VhHkxbp1AlLjJBBmzvM/nM1QZ MDlg== X-Gm-Message-State: AC+VfDypWkfX75mT6ZH49JD3lBuQkbK1WuBJ7PPs6Gnd0I4Ue2ej+6+l EuFmADEIHlQ0A2UrnclXsdwA7Q== X-Received: by 2002:a7b:c4da:0:b0:3f1:8aaa:c212 with SMTP id g26-20020a7bc4da000000b003f18aaac212mr1920110wmk.33.1682610313955; Thu, 27 Apr 2023 08:45:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c10-20020a7bc2aa000000b003f080b2f9f4sm24820201wmk.27.2023.04.27.08.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 08:45:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9696D1FFB8; Thu, 27 Apr 2023 16:45:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Thomas Huth , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Peter Maydell , Andrew Jeffery , Joel Stanley , Cleber Rosa , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal , qemu-arm@nongnu.org (open list:ASPEED BMCs) Subject: [PULL 09/18] tests/avocado/machine_aspeed: Fix the broken ast2[56]00_evb_sdk tests Date: Thu, 27 Apr 2023 16:45:01 +0100 Message-Id: <20230427154510.1791273-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230427154510.1791273-1-alex.bennee@linaro.org> References: <20230427154510.1791273-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth test_arm_ast2500_evb_sdk and test_arm_ast2600_evb_sdk are currently failing. The problem is that they are trying to look for the login prompt that does not have a newline at the end - but the logic in _console_interaction() only handles full lines. It used to work by accident in the past since there were sometimes kernel (warning and error) messages popping up that finally provided a newline character in the output, but since the tests have been changed to run with the "quiet" kernel parameter, this is not working anymore. To make this work reliably, we must not look for the "login:" prompt, but have to use some text ending with a newline instead. And in the ast2600 test, switch to ssh instead of trying to log into the serial console - this works much more reliable and also has the benefit of excercising the network interface here a little bit, too. Signed-off-by: Thomas Huth Reviewed-by: Cédric Le Goater Message-Id: <20230421110345.1294131-3-thuth@redhat.com> [AJB: remove stray debug log] Signed-off-by: Alex Bennée Message-Id: <20230424092249.58552-10-alex.bennee@linaro.org> diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py index 2b532c4834..724ee72c02 100644 --- a/tests/avocado/machine_aspeed.py +++ b/tests/avocado/machine_aspeed.py @@ -10,6 +10,7 @@ import tempfile import subprocess +from avocado_qemu import LinuxSSHMixIn from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado_qemu import exec_command @@ -268,7 +269,7 @@ def test_arm_ast2600_evb_buildroot_tpm(self): self.do_test_arm_aspeed_buildroot_poweroff() -class AST2x00MachineSDK(QemuSystemTest): +class AST2x00MachineSDK(QemuSystemTest, LinuxSSHMixIn): EXTRA_BOOTARGS = ( 'quiet ' @@ -295,7 +296,7 @@ def do_test_arm_aspeed_sdk_start(self, image): self.require_netdev('user') self.vm.set_console() self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw', - '-net', 'nic', '-net', 'user') + '-net', 'nic', '-net', 'user,hostfwd=:127.0.0.1:0-:22') self.vm.launch() self.wait_for_console_pattern('U-Boot 2019.04') @@ -323,7 +324,7 @@ def test_arm_ast2500_evb_sdk(self): self.do_test_arm_aspeed_sdk_start( self.workdir + '/ast2500-default/image-bmc') - self.wait_for_console_pattern('ast2500-default login:') + self.wait_for_console_pattern('nodistro.0 ast2500-default ttyS4') @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') def test_arm_ast2600_evb_sdk(self): @@ -345,22 +346,25 @@ def test_arm_ast2600_evb_sdk(self): 'ds1338,bus=aspeed.i2c.bus.5,address=0x32'); self.do_test_arm_aspeed_sdk_start( self.workdir + '/ast2600-default/image-bmc') - self.wait_for_console_pattern('ast2600-default login:') - exec_command_and_wait_for_pattern(self, 'root', 'Password:') - exec_command_and_wait_for_pattern(self, '0penBmc', 'root@ast2600-default:~#') + self.wait_for_console_pattern('nodistro.0 ast2600-default ttyS4') - exec_command_and_wait_for_pattern(self, - 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-5/device/new_device', + self.ssh_connect('root', '0penBmc', False) + self.ssh_command('dmesg -c > /dev/null') + + self.ssh_command_output_contains( + 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-5/device/new_device ; ' + 'dmesg -c', 'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d'); - exec_command_and_wait_for_pattern(self, + self.ssh_command_output_contains( 'cat /sys/class/hwmon/hwmon19/temp1_input', '0') self.vm.command('qom-set', path='/machine/peripheral/tmp-test', property='temperature', value=18000); - exec_command_and_wait_for_pattern(self, + self.ssh_command_output_contains( 'cat /sys/class/hwmon/hwmon19/temp1_input', '18000') - exec_command_and_wait_for_pattern(self, - 'echo ds1307 0x32 > /sys/class/i2c-dev/i2c-5/device/new_device', + self.ssh_command_output_contains( + 'echo ds1307 0x32 > /sys/class/i2c-dev/i2c-5/device/new_device ; ' + 'dmesg -c', 'i2c i2c-5: new_device: Instantiated device ds1307 at 0x32'); year = time.strftime("%Y") - exec_command_and_wait_for_pattern(self, 'hwclock -f /dev/rtc1', year); + self.ssh_command_output_contains('/sbin/hwclock -f /dev/rtc1', year);