From nobody Tue Feb 10 01:35:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) client-ip=209.85.128.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1603277468; cv=none; d=zohomail.com; s=zohoarc; b=TOWzjLbHe5rwK4ZkFb6x8uEnPjQbyq5LdHR6mHxpkrFgQtXdlW99FRhbDSQDM0cuza5sdJ9+eTdFrCUwHEqoR3E2V+A/g6kPueNEAaAuy9/B/SRhmdBj7fdocm4bEN4+YRmmryOpG+YFnxmw8L1O9eaMcMchFNSGT4E54OHY2Yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603277468; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sya+QU41wlcVkPizrwatYGHt9fWrCDbWxbNEti7h2ho=; b=Hj7O+rEaSbwc1rTHdbMoWTgVm3XfCBuJKhrnuLT9d267tcGZ96UlYiwUbNcjjJFko56g+hebpK7H8EimIk/XIpb65YqJ2pu/teIfcY6sVLXew4dBCslqDFy9T6PvnVRFnIcIs50d5wWdMYgek3N83oJj+mD4FQ7CNqRJ4HEDh40= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.zohomail.com with SMTPS id 1603277468405124.73872767504884; Wed, 21 Oct 2020 03:51:08 -0700 (PDT) Received: by mail-wm1-f65.google.com with SMTP id c16so1603020wmd.2 for ; Wed, 21 Oct 2020 03:51:07 -0700 (PDT) Return-Path: Return-Path: 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) 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=Lpoei6HgilK5cMrAJh6lrzRx3tCJZQvTNxeU11BV9HsI1dBd7knF8gwQ3VJIvoFqMX K+nTAMy7ysvcj2lcgYz1vg7ZBm1BrTkTguC8ohkuA1QvYLsaTz5PgeocGyUCxZdCtz6W ySTkV5ZEFYfHk3La92xTq5Z5uLx/bqsPUReiuxBkDeaC2w1bhliqCohHxb/vQ9B8rEM4 43omwfMfIcDzoWcJGV4SHDKorAdSqk43elTjuwBq+BacM9RqVL0WjU62DvOmTHIeOFh+ dA1g8UOwKq5dEjmo7BgGipjNbd43Cm6U5UNdCD+m5h9ETt8k1QW/0p94RhrkOpkNzv9R yq6A== X-Gm-Message-State: AOAM530KhtDQYM63xNbg4L/g4uqA8ucez8+g8TicFhBdQ5M9WwdgZ08o C0ncbIJh4fGPHJzAomamUvU= 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) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" , Thomas Huth , Wainer dos Santos Moschetta , Huacai Chen , Jiaxun Yang , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Mark Cave-Ayland , Cleber Rosa 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) 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=3D~/images/fuloong2e/pmon_2e.bin \ AVOCADO_ALLOW_UNTRUSTED_CODE=3D1 \ avocado --show=3Dapp,console run tests/acceptance/machine_mips_fuloong2= e.py Fetching asset from tests/acceptance/machine_mips_fuloong2e.py:MipsFuloon= g2e.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=3D00000000 CONFIG=3D00030932 console: PRID=3D00006302 console: Init SDRAM Done! console: Sizing caches... console: Init caches... console: godson2 caches found console: Init caches done, cfg =3D 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=3Db4000000 console: Video: Drawing the logo ... console: CONSOLE_SIZE 450560HSTI PASS (4.10 s) (3/3) tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linu= x_kernel_isa_serial: console: Linux version 2.6.27.7lemote (root@debian) (gcc version 4.1.3 20= 080623 (prerelease) (Debian 4.1.2-23)) #6 Fri Dec 12 00:11:25 CST 2008 console: busclock=3D33000000, cpuclock=3D-2145008360,memsize=3D256,highme= msize=3D0 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=C3=A9 --- Cc: Huacai Chen Cc: Mark Cave-Ayland Cc: Daniel P. Berrange Cc: Alex Benn=C3=A9e --- 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 =20 import os +import time =20 from avocado import skipUnless from avocado_qemu import Test from avocado_qemu import wait_for_console_pattern =20 +from tesseract_utils import tesseract_available, tesseract_ocr + class MipsFuloong2e(Test): =20 timeout =3D 60 =20 + @skipUnless(os.getenv('PMON_BIN_PATH'), 'PMON_BIN_PATH not available') + def test_pmon_serial_console(self): + """ + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:fulong2e + :avocado: tags=3Dendian:little + :avocado: tags=3Ddevice:bonito64 + :avocado: tags=3Ddevice:via686b + """ + pmon_hash =3D 'c812e1695d7b2320036f3ef494976969' # v1.1.2 + pmon_path =3D self.fetch_asset('file://' + os.getenv('PMON_BIN_PAT= H'), + asset_hash=3Dpmon_hash, algorithm=3D'= md5') + + self.vm.set_console() + self.vm.add_args('-bios', pmon_path) + self.vm.launch() + wait_for_console_pattern(self, 'PMON2000 MIPS Initializing. Standb= y...') + 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 availab= le') + @skipUnless(os.getenv('PMON_BIN_PATH'), 'PMON_BIN_PATH not available') + def test_pmon_framebuffer_console(self): + """ + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:fulong2e + :avocado: tags=3Dendian:little + :avocado: tags=3Ddevice:bonito64 + :avocado: tags=3Ddevice:ati-vga + """ + screenshot_path =3D os.path.join(self.workdir, 'dump.ppm') + + pmon_hash =3D 'c812e1695d7b2320036f3ef494976969' # v1.1.2 + pmon_path =3D self.fetch_asset('file://' + os.getenv('PMON_BIN_PAT= H'), + asset_hash=3Dpmon_hash, algorithm=3D'= 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=3D'stop') + self.vm.command('human-monitor-command', + command_line=3D'screendump %s' % screenshot_path) + + lines =3D tesseract_ocr(screenshot_path, tesseract_version=3D4, + tesseract_args=3D'--dpi 128') + pmon_version =3D '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): """ --=20 2.26.2