From nobody Mon Feb 9 01:22:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569246194; cv=none; d=zoho.com; s=zohoarc; b=W+PUQMJTiFC36ZYaS5YiLWZiGcwKKgDARrOmlhMPzxpTrPUci/ZLnnrr6cgG+ZVhqgl4u+nhiL5+D4xkgWF7g9lnvKve5q22qQ7XlVy5bYZw9g3zXwTZGZKTHS7xQGAKRlsz2eRn1SyZ6o4siKrnPQcmBfmeYmZwmhBDHmBcGV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569246194; 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:ARC-Authentication-Results; bh=z+OLYuhuwSBkKMYWDPjdPxzsnhNEyqq41gXno/9autg=; b=gp+VT/GAtHdzn8a+nFRKN8DqF7WH8QoxdH9/isXoPdBlTZcRoY3pIBIpd9jaWEB8dCWWhcg3rgHSdHDZvmqvkZUdVA622l8LUPjyY39irJrDJxeAkAmc5mphJxjdbPY0GL4ef7zlDAE1KYqbU+2Y5MnmwqnE5sSVFBbaibPJ2CA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569246194400315.36785121493267; Mon, 23 Sep 2019 06:43:14 -0700 (PDT) Received: from localhost ([::1]:56742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCOcS-0000oi-Md for importer@patchew.org; Mon, 23 Sep 2019 09:43:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59485) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCOZy-0007OK-6g for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCOZw-0007Z7-Ug for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:40:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24076) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCOZw-0007Ys-Mz for qemu-devel@nongnu.org; Mon, 23 Sep 2019 09:40:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EFE621196E60; Mon, 23 Sep 2019 13:40:35 +0000 (UTC) Received: from dhcp-17-179.bos.redhat.com (dhcp-17-179.bos.redhat.com [10.18.17.179]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0DAE19C78; Mon, 23 Sep 2019 13:40:34 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org, Eduardo Habkost Subject: [PULL 5/7] tests/acceptance: Refactor and improve reporting in linux_ssh_mips_malta.py Date: Mon, 23 Sep 2019 09:40:17 -0400 Message-Id: <20190923134019.8548-6-crosa@redhat.com> In-Reply-To: <20190923134019.8548-1-crosa@redhat.com> References: <20190923134019.8548-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Mon, 23 Sep 2019 13:40:36 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 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 Zheng , Aleksandar Markovic , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic This patch restructures code organization around the test case executions. At the same time, rather than outputing a cryptic message: FAIL: True not found in [False], the following will be reported too, if the command output does not meet specified expectations: 'lspci -d 11ab:4620' output doesn't contain the word 'GT-64120' Signed-off-by: Aleksandar Markovic Message-Id: <1564760158-27536-2-git-send-email-aleksandar.markovic@rt-rk.co= m> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Eduardo Habkost --- tests/acceptance/linux_ssh_mips_malta.py | 36 ++++++++++++++---------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index 7200507a3a..7fc44f43d1 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -145,27 +145,33 @@ class LinuxSSH(Test): self.ssh_disconnect_vm() self.wait_for_console_pattern('Power down') =20 + def ssh_command_output_contains(self, cmd, exp): + stdout, _ =3D self.ssh_command(cmd) + for line in stdout: + if exp in line: + break + else: + self.fail('"%s" output does not contain "%s"' % (cmd, exp)) + def run_common_commands(self): - stdout, stderr =3D self.ssh_command('lspci -d 11ab:4620') - self.assertIn(True, ["GT-64120" in line for line in stdout]) - - stdout, stderr =3D self.ssh_command('cat /sys/bus/i2c/devices/i2c-= 0/name') - self.assertIn(True, ["SMBus PIIX4 adapter" in line - for line in stdout]) - - stdout, stderr =3D self.ssh_command('cat /proc/mtd') - self.assertIn(True, ["YAMON" in line - for line in stdout]) - + self.ssh_command_output_contains( + 'lspci -d 11ab:4620', + 'GT-64120') + self.ssh_command_output_contains( + 'cat /sys/bus/i2c/devices/i2c-0/name', + 'SMBus PIIX4 adapter') + self.ssh_command_output_contains( + 'cat /proc/mtd', + 'YAMON') # Empty 'Board Config' - stdout, stderr =3D self.ssh_command('md5sum /dev/mtd2ro') - self.assertIn(True, ["0dfbe8aa4c20b52e1b8bf3cb6cbdf193" in line - for line in stdout]) + self.ssh_command_output_contains( + 'md5sum /dev/mtd2ro', + '0dfbe8aa4c20b52e1b8bf3cb6cbdf193') =20 def check_mips_malta(self, endianess, kernel_path, uname_m): self.boot_debian_wheezy_image_and_ssh_login(endianess, kernel_path) =20 - stdout, stderr =3D self.ssh_command('uname -a') + stdout, _ =3D self.ssh_command('uname -a') self.assertIn(True, [uname_m + " GNU/Linux" in line for line in st= dout]) =20 self.run_common_commands() --=20 2.21.0