From patchwork Wed Oct 21 10:50:30 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: 270798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDA0EC56202 for ; Wed, 21 Oct 2020 10:51:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 475E320795 for ; Wed, 21 Oct 2020 10:51:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ShXjz51L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 475E320795 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVBim-00069M-2b for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 06:51:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVBhh-0004u9-4k for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:50:49 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:38903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVBhd-0000bw-9y for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:50:48 -0400 Received: by mail-wr1-x42d.google.com with SMTP id n18so2530717wrs.5 for ; Wed, 21 Oct 2020 03:50:44 -0700 (PDT) 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=SenI/m4MVR8+NEEf8DYCWuc6xCFneoK33J1yat7CMnQ=; b=ShXjz51LTHeUnMo9Z93PYgblwftpUaBC/j4xroc7mvpmzWc2GAXbMBcCPni1SkOsMs 9KWoQ2TUawPOR9a/jQDWpuEk7h3dlgh6k4Ns2b5oO68YHu0464xnwY71MyQP+rMrtcXc ruQ3jsGIEeFPFxDiVPZXJb78/qv/5BXrkJCbd3Ac5wkCxFXAq+NSiv5sdjpEGLMIPnZA 611QuJz73yRGUvYznoKIL8KIqjPCYWiQNFU1nuqdE0ylSRsg9avsT+dYla056KKoMfy9 menkbXbaSM/eSygNX8e1VwbTQjpCW+8qaJNi7T6KolXNwsA7vyLvPP/lZz0IA3HaRjvW 0cVQ== 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=SenI/m4MVR8+NEEf8DYCWuc6xCFneoK33J1yat7CMnQ=; b=jEnOJPML1/EK5pRvb7VpQ8NaeHziszzf73QcvVWYf8c4kcV6Nv/5YxaP2CQ+/CWiK0 QQVCY5FMMnRurFIawYckm4/WKz9lbiSG85yhthLwYrsC6xcLHbz5/kjGa978sY21/Bcs wyo0/a93k82A2HKDZNblKK+LshxZtP7skZTC6CTBx6bA7dguWDq2iBcC+aiEfs9qs4oo SeJSBP9PYHcYMtWsduXjZQof5j4gRr36PzsMISRlloDNt7M5grgmCFqy/Yi/s1ah2+G9 TyRyGvJadGwO6lrjUMcMZXmAXA9y6NTvxCLZSt1WAwVMxzXiiUobQNI7sMYH6aUZQJKB fjyw== X-Gm-Message-State: AOAM531j4r4xMejHowaIa7FhMcW2C1/Dt5LZqa1sTIBhhW7pLdXn6VJu GyFlztFHcUZpX4FOoqS/a4t47dzA/dA= X-Google-Smtp-Source: ABdhPJzQASHdZneSo8xHkPK+4PCMLsJ7tmRs70aOHofxRuo8HOc8WbWzB7eED4dEA/gGy3O6E6J6xA== X-Received: by 2002:adf:e685:: with SMTP id r5mr4302071wrm.340.1603277442931; Wed, 21 Oct 2020 03:50:42 -0700 (PDT) Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id u195sm2910068wmu.18.2020.10.21.03.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 03:50:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/6] tests/acceptance: Remove unused import Date: Wed, 21 Oct 2020 12:50:30 +0200 Message-Id: <20201021105035.2477784-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021105035.2477784-1-f4bug@amsat.org> References: <20201021105035.2477784-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Huacai Chen , Thomas Huth , "Daniel P . Berrange" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Wainer dos Santos Moschetta , Jiaxun Yang , Cleber Rosa , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Tested-by: Thomas Huth --- tests/acceptance/machine_m68k_nextcube.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/acceptance/machine_m68k_nextcube.py b/tests/acceptance/machine_m68k_nextcube.py index 32cf571f948..9d289f2fab7 100644 --- a/tests/acceptance/machine_m68k_nextcube.py +++ b/tests/acceptance/machine_m68k_nextcube.py @@ -9,7 +9,6 @@ import re import time import logging -import distutils.spawn from avocado_qemu import Test from avocado import skipUnless From patchwork Wed Oct 21 10:50:31 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: 270797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22831C4363A for ; Wed, 21 Oct 2020 10:53:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7FE842098B for ; Wed, 21 Oct 2020 10:53:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jxw3uhmz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FE842098B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVBkF-0008Na-GH for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 06:53:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVBhk-0004ux-M1 for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:50:53 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:42665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVBhh-0000eu-Jq for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:50:50 -0400 Received: by mail-wr1-x442.google.com with SMTP id j7so2479223wrt.9 for ; Wed, 21 Oct 2020 03:50:48 -0700 (PDT) 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=TrWltPVKZu3fU5m7eJ+qSkFoeHPVQwlD70De7kBRthI=; b=Jxw3uhmzxtmX/xDddqhba3465aOVohWrpqzkJxfq5XIrMGrJ2rM6ZdGHy6jd+SViE+ kO5NYcQT2rIo/20h9eiSPsOI69HnqklJhSdK8KG0ueFHyo/a+eiBfDMTnBeoyDVnWzfI DqmNdGyM2Aj16Rf5kYuBovHeuwNPtjzummX15RZDlsr3ndnXTr3HV+Q8pB7QHhTFvmVo ijfGrPt628m71PlzceDW3OGixe0q1KP8jij/ojo/yu/OpJIgvOm2OL79MrLUx/3/Gub2 0KSYwl/LPECeudDCErKqe2T0zDeEdPcHwKHMamCPWYTCKaVmNiH2/I19njtB25ST6N2o pveg== 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=TrWltPVKZu3fU5m7eJ+qSkFoeHPVQwlD70De7kBRthI=; b=nV3F2fAmGyTDhzn7Q+8Tqtf8wnpaIpQjsvflMDm7fZ0cXBzrgazayCoMWEAH4dOHvH dqfDTwas0TmAthw7TJPRVLP0wzQ3zzxWYE5lX03dH1FKKVU62qVBrG5GK9gpl5NnGM+s 6dq4EmlA50mEgNNBy652sLLBQjigRn+kg0aDGABIcO9gqklyK2e6VZEqdSiDXeYUAgAF UPMLT1hNZkPano9oB5QAeP9BHnvGvBkgqD9ZP4QM+rxTUemy+yyodQuCnOBL7mgZ7Y04 SnIyzFX+7dRLjYKHINOQX7YpJQCHYXZfbSwDXtqX4XWvWb+KJHczb7Y0TOfRE46NpUlN 5/Kw== X-Gm-Message-State: AOAM531c7lqIPEG1lk/5A3c9IiCvhLTXH77Oab8IWapiU9R0IQ8KP0qF Ur/tFra7RIM4Egd+AkL54Bx6SL2IpNw= X-Google-Smtp-Source: ABdhPJxZLPxY0g4osL9oBzgd18iCn7IwfEu0pBwR2z1+TpCiKBdhjKLPLs4Ac0GdiyJzni01fnRqcg== X-Received: by 2002:adf:dd46:: with SMTP id u6mr4008117wrm.295.1603277447789; Wed, 21 Oct 2020 03:50:47 -0700 (PDT) Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id e12sm2798621wme.32.2020.10.21.03.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 03:50:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/6] tests/acceptance: Use .ppm extention for Portable PixMap files Date: Wed, 21 Oct 2020 12:50:31 +0200 Message-Id: <20201021105035.2477784-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021105035.2477784-1-f4bug@amsat.org> References: <20201021105035.2477784-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Huacai Chen , Thomas Huth , "Daniel P . Berrange" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Wainer dos Santos Moschetta , Jiaxun Yang , Cleber Rosa , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The HMP 'screendump' command generates Portable PixMap files. Make it obvious by using the .ppm file extention. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/acceptance/machine_m68k_nextcube.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/machine_m68k_nextcube.py b/tests/acceptance/machine_m68k_nextcube.py index 9d289f2fab7..2baba5fdc26 100644 --- a/tests/acceptance/machine_m68k_nextcube.py +++ b/tests/acceptance/machine_m68k_nextcube.py @@ -69,7 +69,7 @@ def check_bootrom_framebuffer(self, screenshot_path): @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') def test_bootrom_framebuffer_size(self): - screenshot_path = os.path.join(self.workdir, "dump.png") + screenshot_path = os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) width, height = Image.open(screenshot_path).size @@ -78,7 +78,7 @@ def test_bootrom_framebuffer_size(self): @skipUnless(tesseract_available(3), 'tesseract v3 OCR tool not available') def test_bootrom_framebuffer_ocr_with_tesseract_v3(self): - screenshot_path = os.path.join(self.workdir, "dump.png") + screenshot_path = os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) console_logger = logging.getLogger('console') @@ -94,7 +94,7 @@ def test_bootrom_framebuffer_ocr_with_tesseract_v3(self): # that it is still alpha-level software. @skipUnless(tesseract_available(4), 'tesseract v4 OCR tool not available') def test_bootrom_framebuffer_ocr_with_tesseract_v4(self): - screenshot_path = os.path.join(self.workdir, "dump.png") + screenshot_path = os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) console_logger = logging.getLogger('console') From patchwork Wed Oct 21 10:50:32 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: 302406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAABEC4363A for ; Wed, 21 Oct 2020 10:52:01 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0248A20795 for ; Wed, 21 Oct 2020 10:51:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bK5GYPDt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0248A20795 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVBio-0006DZ-0Y for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 06:51:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVBho-0004wP-Aq for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:50:56 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:54820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVBhm-0000hz-CM for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:50:55 -0400 Received: by mail-wm1-x32a.google.com with SMTP id c77so1373840wmd.4 for ; Wed, 21 Oct 2020 03:50:53 -0700 (PDT) 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=HDkuFBTSf9PfxMFUSQsII/3TQvG3KWBBsCKA4dEtXq0=; b=bK5GYPDt7cantE00Sw1249BE4KvqtYpbDr/Sxxt37k1cYqjeoedUB9/p/VtP/1D/KI m3E0hXW/+KVxc2P/tN97AlUpI6+1yTl8tLlF9+yOQQcisHdqhqAdi6QM4BVVaZixINIp jwTtaBGqKy970mkL+1ibPoNXAesw2opNEyqpazTtjET4JHgAFRViNRlyuP9nFbkz7Wik u7twqUTVs834DOPVD2MA5034WsZCG7105beHpA0ROkiIDfEVKBObR7kMTZTYPaE2W6Us uq/S1s+0Haoi+7YiCj9gOzI9Pt8ZAt7eewDcy6hdbiSb9QpLraHRSCcMw81493gXcZr/ 8DuA== 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=HDkuFBTSf9PfxMFUSQsII/3TQvG3KWBBsCKA4dEtXq0=; b=LFzxA63yP0uHEMDjhvd/5dYCb5cRByyTG5xkfxXeUEVqD63+OmCbozRwS2FB5zgKBx fyyaMPh4fu24th6sQpUfy0ruf7geAWr8z0l8NA3R9v2M7Twnn/GWD0Jc/4QQ9WG6UZtD WFMTiYEncdqvLCLlJAfRuZ/F5qFY+nSNLmM4ueCJPpmSgu4soMnye5WhIBfjZT+z0eI0 uOD3UhRomj7GNCUHa2WIkekesBsQKXMOMOOf+OSAGQsZdACazFWTLtRfle4tHws2yTtf GW0ZTlqLrQOaUhegWzPUOTMpybuJjB1IsGunkbbMx+iaWZwHTdD3upj4c7JdrakWDmrf D++Q== X-Gm-Message-State: AOAM530Ys9W2TVUHyadL+oB0Drajj78TdvZBgmBmCfwru3Q947peZKR3 vfEHE06GBSCld5XRvl8z6uOu3XSQNQA= X-Google-Smtp-Source: ABdhPJx5HxH9RBzULE6fqH/E7B8THu1Q/w0fZwryntr0toSwRMSG3bwXy1kqIBv6rjpDEHop8wuKjg== X-Received: by 2002:a1c:4856:: with SMTP id v83mr2948606wma.118.1603277452507; Wed, 21 Oct 2020 03:50:52 -0700 (PDT) Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id x65sm3079700wmg.1.2020.10.21.03.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 03:50:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/6] tests/acceptance: Extract tesseract_available() helper in new namespace Date: Wed, 21 Oct 2020 12:50:32 +0200 Message-Id: <20201021105035.2477784-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021105035.2477784-1-f4bug@amsat.org> References: <20201021105035.2477784-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Huacai Chen , Thomas Huth , "Daniel P . Berrange" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Wainer dos Santos Moschetta , Jiaxun Yang , Cleber Rosa , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We are going to reuse tesseract_available(). Extract it to a new 'tesseract_utils' namespace. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/acceptance/machine_m68k_nextcube.py | 25 +++----------------- tests/acceptance/tesseract_utils.py | 28 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 tests/acceptance/tesseract_utils.py diff --git a/tests/acceptance/machine_m68k_nextcube.py b/tests/acceptance/machine_m68k_nextcube.py index 2baba5fdc26..3c7400c43e4 100644 --- a/tests/acceptance/machine_m68k_nextcube.py +++ b/tests/acceptance/machine_m68k_nextcube.py @@ -1,19 +1,19 @@ # Functional test that boots a VM and run OCR on the framebuffer # -# Copyright (c) Philippe Mathieu-Daudé +# Copyright (c) 2019 Philippe Mathieu-Daudé # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. import os -import re import time import logging from avocado_qemu import Test from avocado import skipUnless from avocado.utils import process -from avocado.utils.path import find_command, CmdNotFoundError + +from tesseract_utils import tesseract_available PIL_AVAILABLE = True try: @@ -22,25 +22,6 @@ PIL_AVAILABLE = False -def tesseract_available(expected_version): - try: - find_command('tesseract') - except CmdNotFoundError: - return False - res = process.run('tesseract --version') - try: - version = res.stdout_text.split()[1] - except IndexError: - version = res.stderr_text.split()[1] - return int(version.split('.')[0]) == expected_version - - match = re.match(r'tesseract\s(\d)', res) - if match is None: - return False - # now this is guaranteed to be a digit - return int(match.groups()[0]) == expected_version - - class NextCubeMachine(Test): """ :avocado: tags=arch:m68k diff --git a/tests/acceptance/tesseract_utils.py b/tests/acceptance/tesseract_utils.py new file mode 100644 index 00000000000..acd6e8c2faa --- /dev/null +++ b/tests/acceptance/tesseract_utils.py @@ -0,0 +1,28 @@ +# ... +# +# Copyright (c) 2019 Philippe Mathieu-Daudé +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import re + +from avocado.utils.path import find_command, CmdNotFoundError + +def tesseract_available(expected_version): + try: + find_command('tesseract') + except CmdNotFoundError: + return False + res = process.run('tesseract --version') + try: + version = res.stdout_text.split()[1] + except IndexError: + version = res.stderr_text.split()[1] + return int(version.split('.')[0]) == expected_version + + match = re.match(r'tesseract\s(\d)', res) + if match is None: + return False + # now this is guaranteed to be a digit + return int(match.groups()[0]) == expected_version From patchwork Wed Oct 21 10:50:33 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: 302405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE15BC4363A for ; Wed, 21 Oct 2020 10:53:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 58A7E2098B for ; Wed, 21 Oct 2020 10:53:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fSoX3I/r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58A7E2098B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVBkG-0008M6-BA for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 06:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVBhs-000560-NS for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:51:00 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54251) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVBhr-0000iM-16 for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:51:00 -0400 Received: by mail-wm1-x32f.google.com with SMTP id d78so1374906wmd.3 for ; Wed, 21 Oct 2020 03:50:58 -0700 (PDT) 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=u8MIW0fZuo8s+yk9Tsr3op5QbGANqrFw34tCgPBF3cw=; b=fSoX3I/r74xELcpRZ3OdZaYY+ZfCUTskrMBMgjWVe4FbwR/txGkVTyawTWQQ+vHKNE sBU0L5sSs0pfSJ70pK4frMRhldqv2Z7tXM9WPaoM+mz/tfY6bcD0m1nVIq+YHckx1gNJ FP8Tzo8xvRYGx29Ih/bbYAsCTYvE5YGeFOzhaa0kSZjskFdcCmcsWKn32Z/X6jYIMhSc WTsXhgxyKPJkLsoL3Px3FdmLCeV8+DsyGvq0S/0DTEr0H6b6cvzq+mR4YMuUWDvxrwg5 5zEFwzEe4fiVCPkJPtEilvh2QOIx9tKo51DZ7BB04JQyyxSsqw4GoT+qAN2qPs7qWOoz 6LBQ== 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=u8MIW0fZuo8s+yk9Tsr3op5QbGANqrFw34tCgPBF3cw=; b=FstXIH7cQSiZGV8/RpSHssHx6U3TyN2noUedYxFYccEyiHotu5hO2NU6xx63LwqAmr LUfkf75apEeQ8Fn398Aox6oBAMzIBIdSz/xPhF4HkkT/q4YMEP4ZFBXeA/8NmQ8YAL/a Vm4NOJSLGLw5aZFCrfEeoDH0vuA0Pe9/IAM2WbfEzUy1ALgWN5tcBlAc71KMRNjLYcDK uZyojICkLqvHdIKUuRImXw/+5tHaXIW6tMTp24uPjZWC9w/Di+3Uxx9SwLqNa3pK2qDj jkmqqh29TIy5IWfg/8jwNxIQO+XcSGdrC6hTZCGepLB5unVhcDjtN1uGMl8umh6HwYwU zKMg== X-Gm-Message-State: AOAM530TKHeQvjOd7Qnyak5IAf6X/0RI/I6mzTbEgkD9dzSdnPAP1Wh5 GSHLtBFx8g+o3x+SC0DXJeYH+vxz7Wc= X-Google-Smtp-Source: ABdhPJw4WuLXr4fMv1GVowlFCqxkzdgn0xn2wi9PmCKKIJ7Wo0gIYde7vbK77YJLUEIvrk8XzROSRA== X-Received: by 2002:a7b:cb81:: with SMTP id m1mr3065574wmi.140.1603277457309; Wed, 21 Oct 2020 03:50:57 -0700 (PDT) Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id z6sm2781092wmi.28.2020.10.21.03.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 03:50:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/6] tests/acceptance: Introduce tesseract_ocr() helper Date: Wed, 21 Oct 2020 12:50:33 +0200 Message-Id: <20201021105035.2477784-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021105035.2477784-1-f4bug@amsat.org> References: <20201021105035.2477784-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Huacai Chen , Thomas Huth , "Daniel P . Berrange" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Wainer dos Santos Moschetta , Jiaxun Yang , Cleber Rosa , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We are going to reuse the tesseract OCR code. Create a new tesseract_ocr() helper and use it. Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/machine_m68k_nextcube.py | 21 +++++---------------- tests/acceptance/tesseract_utils.py | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/tests/acceptance/machine_m68k_nextcube.py b/tests/acceptance/machine_m68k_nextcube.py index 3c7400c43e4..09e2745cc52 100644 --- a/tests/acceptance/machine_m68k_nextcube.py +++ b/tests/acceptance/machine_m68k_nextcube.py @@ -7,13 +7,11 @@ import os import time -import logging from avocado_qemu import Test from avocado import skipUnless -from avocado.utils import process -from tesseract_utils import tesseract_available +from tesseract_utils import tesseract_available, tesseract_ocr PIL_AVAILABLE = True try: @@ -61,12 +59,8 @@ def test_bootrom_framebuffer_size(self): def test_bootrom_framebuffer_ocr_with_tesseract_v3(self): screenshot_path = os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) - - console_logger = logging.getLogger('console') - text = process.run("tesseract %s stdout" % screenshot_path).stdout_text - for line in text.split('\n'): - if len(line): - console_logger.debug(line) + lines = tesseract_ocr(screenshot_path, tesseract_version=3) + text = '\n'.join(lines) self.assertIn('Backplane', text) self.assertIn('Ethernet address', text) @@ -77,13 +71,8 @@ def test_bootrom_framebuffer_ocr_with_tesseract_v3(self): def test_bootrom_framebuffer_ocr_with_tesseract_v4(self): screenshot_path = os.path.join(self.workdir, "dump.ppm") self.check_bootrom_framebuffer(screenshot_path) - - console_logger = logging.getLogger('console') - proc = process.run("tesseract --oem 1 %s stdout" % screenshot_path) - text = proc.stdout_text - for line in text.split('\n'): - if len(line): - console_logger.debug(line) + lines = tesseract_ocr(screenshot_path, tesseract_version=4) + text = '\n'.join(lines) self.assertIn('Testing the FPU, SCC', text) self.assertIn('System test failed. Error code', text) self.assertIn('Boot command', text) diff --git a/tests/acceptance/tesseract_utils.py b/tests/acceptance/tesseract_utils.py index acd6e8c2faa..72cd9ab7989 100644 --- a/tests/acceptance/tesseract_utils.py +++ b/tests/acceptance/tesseract_utils.py @@ -6,7 +6,9 @@ # later. See the COPYING file in the top-level directory. import re +import logging +from avocado.utils import process from avocado.utils.path import find_command, CmdNotFoundError def tesseract_available(expected_version): @@ -26,3 +28,19 @@ def tesseract_available(expected_version): return False # now this is guaranteed to be a digit return int(match.groups()[0]) == expected_version + + +def tesseract_ocr(image_path, tesseract_args='', tesseract_version=3): + console_logger = logging.getLogger('tesseract') + console_logger.debug(image_path) + if tesseract_version == 4: + tesseract_args += ' --oem 1' + proc = process.run("tesseract {} {} stdout".format(tesseract_args, + image_path)) + lines = [] + for line in proc.stdout_text.split('\n'): + sline = line.strip() + if len(sline): + console_logger.debug(sline) + lines += [sline] + return lines From patchwork Wed Oct 21 10:50:34 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: 302404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 411B4C388F9 for ; Wed, 21 Oct 2020 10:55:34 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6D5E32098B for ; Wed, 21 Oct 2020 10:55:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KUM04qTD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D5E32098B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVBmE-0001kC-5d for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 06:55:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVBhx-0005Df-CR for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:51:06 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:38758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVBhv-0000im-Lj for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:51:05 -0400 Received: by mail-wr1-x444.google.com with SMTP id n18so2531772wrs.5 for ; Wed, 21 Oct 2020 03:51:03 -0700 (PDT) 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=quiicLeYyNWtIdMVLHoYPSS0nbnwlfIHdSBUJ8b+yp4=; b=KUM04qTDjwucoELmfnRqT+UP9GYd3ajKwUohOneavzzC9KKV6mPzv3kzuC7UWPArk3 e7+AsLP0PkjLKdxLHXEbtlHEwiWA0XInHvo31rm7afddWyNvT6pY8vVKbHt39aDp5rkm lLNp920aRYaQ7CQ80Nk0zGAbjKM0zq/scOdTpLEds//deJXhip7evbXwZw9kb2rlLTv5 486m5ueE+TBSdT80MU9MSpVXV8LE3vyusW7xqNYshY1pIp4htucztZMjqSlAolwVipTj DemWtYOJxEsp+J4GB4aFaEm/TUwt5ZzPgmhaMdiPHFQKTViJb0N5bjE6ynJEOhl12jBW iFNQ== 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=quiicLeYyNWtIdMVLHoYPSS0nbnwlfIHdSBUJ8b+yp4=; b=SO1V4hWOLfvc3APSSCQCvZ54o6o/jv/GtQdf4zJqeSm7Eio7GOeKqzUE7MmYlDU4bq VAop9H2WZSrt5nVRShe8dZ+LrbDYQxBr6o6j3GGyW95CWYAgYgqGomqwNM8lPzH8fNpX IjoxoNuDZ3PcDmjq+jEC5v2pL/z/YyJs25I64F4TKoMY4G6gcVPavVjpkKCWvlrCxL5i bT2VTgDAcusnp9aywz76FBoSPAQ0wWIjpQWadisf6hrj1Omp3K+r9geDK9dk1kPdx4kf FSGrv2HTwWvx1EKU4r1tDzs4CIxNjvG8i+VDJKrEVIyvu0pMQOXAsSu/0OXjV2qX9quL ulTg== X-Gm-Message-State: AOAM533Q0Y8IgAkFbfmYdjhaN7mUY2ElYoUv+P25pYK/TWun2NRXUa6h xQi0yjlF8/efeec1cIjmtdgmxmY8qhQ= X-Google-Smtp-Source: ABdhPJzeIBwrr+pkrOwqouBDUhBndtvACFR+6D611LA0RySwBS85XEQ1/cv/jWswj/Y9oj6kcXqJfw== X-Received: by 2002:adf:ed07:: with SMTP id a7mr4135266wro.326.1603277462131; Wed, 21 Oct 2020 03:51:02 -0700 (PDT) Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id s19sm7710935wmc.0.2020.10.21.03.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 03:51:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 5/6] tests/acceptance: Test Linux on the Fuloong 2E machine Date: Wed, 21 Oct 2020 12:50:34 +0200 Message-Id: <20201021105035.2477784-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021105035.2477784-1-f4bug@amsat.org> References: <20201021105035.2477784-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Huacai Chen , Thomas Huth , "Daniel P . Berrange" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Wainer dos Santos Moschetta , Jiaxun Yang , Cleber Rosa , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Trivial test booting the rescue image provided by Lemote: $ AVOCADO_ALLOW_UNTRUSTED_CODE=1 \ avocado --show=app,console run tests/acceptance/machine_mips_fuloong2e.py Fetching asset from tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linux_kernel_isa_serial (1/1) tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linux_kernel_isa_serial: console: Linux version 2.6.27.7lemote (root@debian) (gcc version 4.1.3 20080623 (prerelease) (Debian 4.1.2-23)) #6 Fri Dec 12 00:11:25 CST 2008 console: busclock=33000000, cpuclock=-2145008360,memsize=256,highmemsize=0 console: console [early0] enabled console: CPU revision is: 00006302 (ICT Loongson-2) PASS (0.16 s) JOB TIME : 0.51 s Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + tests/acceptance/machine_mips_fuloong2e.py | 42 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 tests/acceptance/machine_mips_fuloong2e.py diff --git a/MAINTAINERS b/MAINTAINERS index a7f0acf8663..1720a383e6f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1152,6 +1152,7 @@ F: hw/mips/fuloong2e.c F: hw/isa/vt82c686.c F: hw/pci-host/bonito.c F: include/hw/isa/vt82c686.h +F: tests/acceptance/machine_mips_fuloong2e.py Loongson-3 virtual platforms M: Huacai Chen diff --git a/tests/acceptance/machine_mips_fuloong2e.py b/tests/acceptance/machine_mips_fuloong2e.py new file mode 100644 index 00000000000..5fd3da09e7c --- /dev/null +++ b/tests/acceptance/machine_mips_fuloong2e.py @@ -0,0 +1,42 @@ +# Functional tests for the Lemote Fuloong-2E machine. +# +# Copyright (c) 2019 Philippe Mathieu-Daudé +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os + +from avocado import skipUnless +from avocado_qemu import Test +from avocado_qemu import wait_for_console_pattern + +class MipsFuloong2e(Test): + + timeout = 60 + + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + def test_linux_kernel_isa_serial(self): + """ + :avocado: tags=arch:mips64el + :avocado: tags=machine:fulong2e + :avocado: tags=endian:little + :avocado: tags=device:bonito64 + :avocado: tags=device:via686b + """ + # Recovery system for the Yeeloong laptop + # (enough to test the fuloong2e southbridge, accessing its ISA bus) + # http://dev.lemote.com/files/resource/download/rescue/rescue-yl + kernel_url = ('https://github.com/philmd/qemu-testing-blob/' + 'raw/f6b2e7e4/mips/yeeloong/mips64el/rescue-yl') + kernel_hash = 'ec4d1bd89a8439c41033ca63db60160cc6d6f09a' + kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + + self.vm.set_console() + self.vm.add_args('-kernel', kernel_path) + self.vm.launch() + wait_for_console_pattern(self, 'Linux version 2.6.27.7lemote') + cpu_revision = 'CPU revision is: 00006302 (ICT Loongson-2)' + wait_for_console_pattern(self, cpu_revision) From patchwork Wed Oct 21 10:50:35 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: 270796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F28AC4363A for ; Wed, 21 Oct 2020 10:55:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7548D21534 for ; Wed, 21 Oct 2020 10:55:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jMgHwLzR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7548D21534 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVBmD-0001iL-Vc for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 06:55:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVBi2-0005JQ-69 for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:51:10 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVBi0-0000kW-G3 for qemu-devel@nongnu.org; Wed, 21 Oct 2020 06:51:09 -0400 Received: by mail-wm1-x341.google.com with SMTP id c16so1603050wmd.2 for ; Wed, 21 Oct 2020 03:51:08 -0700 (PDT) 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=sya+QU41wlcVkPizrwatYGHt9fWrCDbWxbNEti7h2ho=; b=jMgHwLzRVp9leEB8s/kEGer0DyfE+AbxVEirZvYHl2E/yUqRez5R1+pmLEBZ3arsRr jHY62SfoDw+oRGI2VUqJUGxzQtP006ckJwhWEm7UPa22YurI9YAeWoTQcQsgg2NhPMT7 Dcslv7tBd+92iEseNfmLn+hH5m5y8dV3pzZBD2YYW5YfBUIUKifJEuhewhfIA0X98oin n+dCZPQVl4IqbCHTTRhNtIbxuxmrnzVVomCjEybPq/Fr0IR53ftznA8Ld1wnNKlCh96t ftDCroshCCoAPRWGXC4Ha0s/uv6sdL+wPdoeOQxq4n4w2Dhv6RPvxyDtoiB295/Un16i cGxg== 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=sya+QU41wlcVkPizrwatYGHt9fWrCDbWxbNEti7h2ho=; b=I6xH0X8syIG8iW7szcPxZ9c2FrsbazYXhiy5/dERr46mwAZH29DHdIL7UDXXrxFAdw 5FZGYQ8P1jBy2CRJohrl9UBfJSjllna5WaflYRY247+cY7TepkMcMvaPJcgDCfk/MmL+ /4ZUiXu3KoDoQyqHJCd+Zj/kEQBO/yaUePGdxIE5n4wh802Ghf0r/ABHQWTwTv9Gm4eI fFYgoDPxHzvdO0+wI1MLg+NBChCrKf+ScoFaQEaES4IPc5Yf6CHL2X04ZcLfwRO8g89I IQL94SKprOmtetClEbs287OUOiu8+cC9yMrT/npy6h2wzbBB/DqDYLBwdwoXNuVGpb+s 9Qsg== X-Gm-Message-State: AOAM533obRuv58ZTsMgEc0Ur1U0X9/0JdjAxSslbIZU7Sl+9eisJl9Xr TifP91uj8DFvsMJdO/uOCN5PWWeawKk= X-Google-Smtp-Source: ABdhPJzJycn5B1g7AsDVMp+34eLhwlUyclsIsr3EJMP7HBqA9/0L63lah8aQln9vPACzCp9XGHGK0g== X-Received: by 2002:a1c:e154:: with SMTP id y81mr2918494wmg.111.1603277466924; Wed, 21 Oct 2020 03:51:06 -0700 (PDT) Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id 24sm2665954wmf.44.2020.10.21.03.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 03:51:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 6/6] tests/acceptance: Test PMON on the Fuloong 2E machine Date: Wed, 21 Oct 2020 12:50:35 +0200 Message-Id: <20201021105035.2477784-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201021105035.2477784-1-f4bug@amsat.org> References: <20201021105035.2477784-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Huacai Chen , Thomas Huth , "Daniel P . Berrange" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Wainer dos Santos Moschetta , Jiaxun Yang , Cleber Rosa , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Test the PMON firmware. As the firmware is not redistributable, it has to be downloaded manually first. Then it can be used by providing its path via the PMON_BIN_PATH environment variable: $ PMON_BIN_PATH=~/images/fuloong2e/pmon_2e.bin \ AVOCADO_ALLOW_UNTRUSTED_CODE=1 \ avocado --show=app,console run tests/acceptance/machine_mips_fuloong2e.py Fetching asset from tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linux_kernel_isa_serial (1/3) tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_pmon_serial_console: console: PMON2000 MIPS Initializing. Standby... console: ERRORPC=00000000 CONFIG=00030932 console: PRID=00006302 console: Init SDRAM Done! console: Sizing caches... console: Init caches... console: godson2 caches found console: Init caches done, cfg = 00030932 console: Copy PMON to execute location... console: copy text section done. console: Copy PMON to execute location done. Uncompressing Bios........................OK,Booting Bios PASS (0.25 s) (2/3) tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_pmon_framebuffer_console: [...] Uncompressing Bios........................OK,Booting Bios console: FREQ console: FREI console: DONE console: TTYI console: TTYD console: ENVI console: MAPV console: Mfg 0, Id 60 console: STDV console: SBDD console: PPCIH console: PCIS console: PCIR console: PCIW console: NETI console: RTCL console: PCID console: VGAI console: Default MODE_ID 2 console: starting radeon init... console: radeon init done console: FRBI console: cfb_console init,fb=b4000000 console: Video: Drawing the logo ... console: CONSOLE_SIZE 450560HSTI PASS (4.10 s) (3/3) tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linux_kernel_isa_serial: console: Linux version 2.6.27.7lemote (root@debian) (gcc version 4.1.3 20080623 (prerelease) (Debian 4.1.2-23)) #6 Fri Dec 12 00:11:25 CST 2008 console: busclock=33000000, cpuclock=-2145008360,memsize=256,highmemsize=0 console: console [early0] enabled console: CPU revision is: 00006302 (ICT Loongson-2) PASS (0.19 s) RESULTS : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 5.10 s Signed-off-by: Philippe Mathieu-Daudé --- Cc: Huacai Chen Cc: Mark Cave-Ayland Cc: Daniel P. Berrange Cc: Alex Bennée --- tests/acceptance/machine_mips_fuloong2e.py | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tests/acceptance/machine_mips_fuloong2e.py b/tests/acceptance/machine_mips_fuloong2e.py index 5fd3da09e7c..807e38da74a 100644 --- a/tests/acceptance/machine_mips_fuloong2e.py +++ b/tests/acceptance/machine_mips_fuloong2e.py @@ -8,15 +8,74 @@ # SPDX-License-Identifier: GPL-2.0-or-later import os +import time from avocado import skipUnless from avocado_qemu import Test from avocado_qemu import wait_for_console_pattern +from tesseract_utils import tesseract_available, tesseract_ocr + class MipsFuloong2e(Test): timeout = 60 + @skipUnless(os.getenv('PMON_BIN_PATH'), 'PMON_BIN_PATH not available') + def test_pmon_serial_console(self): + """ + :avocado: tags=arch:mips64el + :avocado: tags=machine:fulong2e + :avocado: tags=endian:little + :avocado: tags=device:bonito64 + :avocado: tags=device:via686b + """ + pmon_hash = 'c812e1695d7b2320036f3ef494976969' # v1.1.2 + pmon_path = self.fetch_asset('file://' + os.getenv('PMON_BIN_PATH'), + asset_hash=pmon_hash, algorithm='md5') + + self.vm.set_console() + self.vm.add_args('-bios', pmon_path) + self.vm.launch() + wait_for_console_pattern(self, 'PMON2000 MIPS Initializing. Standby...') + wait_for_console_pattern(self, 'Booting Bios') + + # Tesseract 4 adds a new OCR engine based on LSTM neural networks. The + # new version is faster and more accurate than version 3. The drawback is + # that it is still alpha-level software. + @skipUnless(tesseract_available(4), 'tesseract v4 OCR tool not available') + @skipUnless(os.getenv('PMON_BIN_PATH'), 'PMON_BIN_PATH not available') + def test_pmon_framebuffer_console(self): + """ + :avocado: tags=arch:mips64el + :avocado: tags=machine:fulong2e + :avocado: tags=endian:little + :avocado: tags=device:bonito64 + :avocado: tags=device:ati-vga + """ + screenshot_path = os.path.join(self.workdir, 'dump.ppm') + + pmon_hash = 'c812e1695d7b2320036f3ef494976969' # v1.1.2 + pmon_path = self.fetch_asset('file://' + os.getenv('PMON_BIN_PATH'), + asset_hash=pmon_hash, algorithm='md5') + + self.vm.set_console() + self.vm.add_args('-bios', pmon_path, + '-vga', 'std') + self.vm.launch() + + wait_for_console_pattern(self, 'Video: Drawing the logo ...') + self.log.info('VM launched, waiting for logo on display') + time.sleep(2) + wait_for_console_pattern(self, 'CONSOLE_SIZE') + self.vm.command('human-monitor-command', command_line='stop') + self.vm.command('human-monitor-command', + command_line='screendump %s' % screenshot_path) + + lines = tesseract_ocr(screenshot_path, tesseract_version=4, + tesseract_args='--dpi 128') + pmon_version = 'PNON2000 for Loongson, Version 1.1.2' # PNON is enough + self.assertIn(pmon_version, lines) + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') def test_linux_kernel_isa_serial(self): """