From nobody Sun May 5 10:04:15 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1564760295; cv=none; d=zoho.com; s=zohoarc; b=EpykSToMz4ufRF4OCM9eCaumQCktNCliij6Cor3Ookw53cAH8tkxeDAV+LX7Gz/DpmhaKqTCfu4ZKV5veIfnxodVDyKMvCiP9x6BhuQNuDCtbUgfBwATRyFG6GaxsgviLOxZkrEaIqhsbyffOtOfoQBnTa0dT7Zgh3zhLaZ4fIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564760295; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OCXcEuLtjjXYEv/8VmpI6K98nsggzUBALjTsE6bwBzM=; b=QNVpXUGsz4wNrnnh72g6u/+ivarGbBdh1qHQhNGxdNsH7hrjHfopJI3jpU/6hncdPHA0w/MpJ95NuFCDrw7WoJgMnt/nP6e+rbo7nqj2iEPwpVES56Eq3sBaSTOzIT6xW6/VZ/dJjdgIYiVA7zBL5xV15tOpKqwX/sc2btCpmu0= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1564760295313223.56806233541954; Fri, 2 Aug 2019 08:38:15 -0700 (PDT) Received: from localhost ([::1]:35832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htZd6-0000dM-VN for importer@patchew.org; Fri, 02 Aug 2019 11:38:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53567) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htZcH-0008Cv-1n for qemu-devel@nongnu.org; Fri, 02 Aug 2019 11:37:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htZcF-0000R4-Te for qemu-devel@nongnu.org; Fri, 02 Aug 2019 11:37:12 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:58571 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1htZcF-0008QC-NK for qemu-devel@nongnu.org; Fri, 02 Aug 2019 11:37:11 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id D81A41A2205; Fri, 2 Aug 2019 17:36:08 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id BAD9C1A21F4; Fri, 2 Aug 2019 17:36:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 2 Aug 2019 17:35:57 +0200 Message-Id: <1564760158-27536-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564760158-27536-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564760158-27536-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH 1/2] tests/acceptance: Refactor and improve reporting in linux_ssh_mips_malta.py 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: ehabkost@redhat.com, cohuck@redhat.com, f4bug@amsat.org, crosa@redhat.com, amarkovic@wavecomp.com, ccarrara@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 aafb0c3..8368e1f 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 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]) + 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)) =20 + def run_common_commands(self): + 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 do_test_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.7.4 From nobody Sun May 5 10:04:15 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1564760328; cv=none; d=zoho.com; s=zohoarc; b=DHcRRzn4z6eHIuMU0b9hcc8EORdIJAl3lEIRyUq6IfKnjYqmGUH2YsLEodOVjyZBK3v05+td6ZtSuldXOa3qmUfAGKzubNDvhSedkrOBWMzKj1EjriwCdPokMD8xUVuwC3fk7lqmTcLvDNf3/C2iA6Yh6aNJ2ns4KBbHIltQ9io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564760328; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vyTdXUGlfcaYubEKYAZWeHvISlcZPfFU8xsNlrqMy4Y=; b=BZTwfPyNOmh/0YH4cFXYrkIxNTmedoT2p/gQMsx1SpClmilBHD1tKbgCB9s09SQqD9kfOHyXXvRz8IXSODGzpdjgwt5+LYaQPABY5IKHw9hJvG1EIPzxkgjkX+MN/3beNgOY5e7Yrje/qnSfJmj2Gssjateg/EbGdYusg8IDFiw= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1564760328590556.1250329044907; Fri, 2 Aug 2019 08:38:48 -0700 (PDT) Received: from localhost ([::1]:35842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htZdn-00024V-Mp for importer@patchew.org; Fri, 02 Aug 2019 11:38:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53563) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htZcG-0008Cu-Vy for qemu-devel@nongnu.org; Fri, 02 Aug 2019 11:37:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htZcG-0000RB-0E for qemu-devel@nongnu.org; Fri, 02 Aug 2019 11:37:12 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:58623 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1htZcF-0008QM-QF for qemu-devel@nongnu.org; Fri, 02 Aug 2019 11:37:11 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 249EF1A220C; Fri, 2 Aug 2019 17:36:09 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 0656A1A21F4; Fri, 2 Aug 2019 17:36:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Fri, 2 Aug 2019 17:35:58 +0200 Message-Id: <1564760158-27536-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564760158-27536-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1564760158-27536-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH 2/2] tests/acceptance: Add new test cases in linux_ssh_mips_malta.py 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: ehabkost@redhat.com, cohuck@redhat.com, f4bug@amsat.org, crosa@redhat.com, amarkovic@wavecomp.com, ccarrara@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Add 15 new tests cases. They all rely on simple commands used for detecting hardware configuration information. Signed-off-by: Aleksandar Markovic Reviewed-by: Cleber Rosa --- tests/acceptance/linux_ssh_mips_malta.py | 45 ++++++++++++++++++++++++++++= ++++ 1 file changed, 45 insertions(+) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index 8368e1f..c153c41 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -155,6 +155,51 @@ class LinuxSSH(Test): =20 def run_common_commands(self): self.ssh_command_output_contains( + 'cat /proc/cpuinfo', + '24Kc') + self.ssh_command_output_contains( + 'uname -m', + 'mips') + self.ssh_command_output_contains( + 'uname -r', + '3.2.0-4-4kc-malta') + self.ssh_command_output_contains( + 'cat /proc/interrupts', + 'timer') + self.ssh_command_output_contains( + 'cat /proc/interrupts', + 'i8042') + self.ssh_command_output_contains( + 'cat /proc/interrupts', + 'serial') + self.ssh_command_output_contains( + 'cat /proc/interrupts', + 'ata_piix') + self.ssh_command_output_contains( + 'cat /proc/interrupts', + 'eth0') + self.ssh_command_output_contains( + 'cat /proc/interrupts', + 'eth0') + self.ssh_command_output_contains( + 'cat /proc/devices', + 'input') + self.ssh_command_output_contains( + 'cat /proc/devices', + 'usb') + self.ssh_command_output_contains( + 'cat /proc/devices', + 'fb') + self.ssh_command_output_contains( + 'cat /proc/ioports', + 'serial') + self.ssh_command_output_contains( + 'cat /proc/ioports', + 'ata_piix') + self.ssh_command_output_contains( + 'cat /proc/ioports', + 'piix4_smbus') + self.ssh_command_output_contains( 'lspci -d 11ab:4620', 'GT-64120') self.ssh_command_output_contains( --=20 2.7.4