From nobody Tue Feb 10 05:14:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) client-ip=209.85.128.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1624566495; cv=none; d=zohomail.com; s=zohoarc; b=htHiiVpYF6C9oJFoZ/91f9kEll1biatg3SO83i9GVt7Us0c/NEJKtIHwtsjUqrQ0J4yqWDygpoVZAyHRj5d700gA7va7x0ECIoL2o97BdYHHWO0Wto6+xI+j06VXLqtoNxcWhfnCMdXd5WUC1EXPB1bv1U3AQgmUIl3SQoH/g1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624566495; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UCi9zS+WOU642oVpvfnDDUDAscPjtG7ffJ6K2lD9Qwg=; b=Pg+Ta/g1sXeFZMhGTLrJ9fTtTj2IzTqYVgMPbWreQWC+AAqKrmAX2HVYS7zvYJF6lJ3hYIMxzNx6vTaMfJ1Qvh9NOSeNE7V7FQL2qo2Nhj6QC3jBo/AmczM5s6CV0lGveYb6J7bSgXJL55wvl4ZmM9vWS3m+C41jSo7pluDSXJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.zohomail.com with SMTPS id 1624566495291308.0555097308461; Thu, 24 Jun 2021 13:28:15 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id v20-20020a05600c2154b02901dcefb16af0so4426462wml.5 for ; Thu, 24 Jun 2021 13:28:14 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (93.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.93]) by smtp.gmail.com with ESMTPSA id r2sm4251734wrv.39.2021.06.24.13.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 13:28:13 -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=UCi9zS+WOU642oVpvfnDDUDAscPjtG7ffJ6K2lD9Qwg=; b=TLPuGl1TMUEq/UOZeZ6u3CFhQSinB3sAxHRWZm2TYVRVun6FDuTD8CHJcTkfU7qxHl Or3v4oBH0vVJ5IepZbfLh0S/19N7qC5wYqHp9pJgly9y5PTisb0U35SUsAt+GX6dv+MO VDA5A/u9qRwfYQsofjaUnS57yKo7NaYcqspk0VBqMInXnFoQ/knNA5RO0T9iEQpFCVgQ qgtyDgwz+tYu5ejw0GQmPVQDL/4eNXCI0EWpsw6tVukpOTaM/uWugp6Nb+gne/y5tfsF XT1h/s9j7p7dRTmNVSwgDVi1bCth6642rf4oChVvub0k+KQKkgHOdtx+stQjDwFjm1wS KIRg== 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=UCi9zS+WOU642oVpvfnDDUDAscPjtG7ffJ6K2lD9Qwg=; b=U15i0/M5KYFQyTaBadp9NnAvlnRhWIFgN5d0SuhHUuLomVh6di0C+jnwyqa0me2ETB A+Yuyxdoj1ort7xOGCAKU0BX3UJltQRb5HlDfvaI66C3Rsppr83OQTfzxMWTJTg3TAQn mHUGWAhFZUDAzSNf2j9iTFLFNOfYMadnDfHd0yp7lQ/X+V60H6LLVhFQsrgnf6hdXn3f AMOWUHey4UJV6dt5+9J0oIB1No+kOfekfZuSZhK0jU5JsuhpzsLVnof95HOchCeQ5CuL zQnnqZpyAlIB6ln2CdLFjBwbxxhLfB2DL3lj4ogpr1C+RX/9Js51qaW51QZopXZhRQRn 4aXA== X-Gm-Message-State: AOAM532twxU4YZBxwN2wJQ5lRbrxrl/HlKxTbKEqr+Owt/rNgcbPSw6L ZDtxn5AIY5lYxGjsweNft1I= X-Google-Smtp-Source: ABdhPJyNwhoGvLwqSjI1MJdyRpZOdiVSjBwwhSGw96BiAU/d1vThocBAYzWzRBFNCiEWvdUPUTjl/Q== X-Received: by 2002:a05:600c:291:: with SMTP id 17mr6399367wmk.52.1624566493521; Thu, 24 Jun 2021 13:28:13 -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: Wainer dos Santos Moschetta , BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Aurelien Jarno , Cleber Rosa , Huacai Chen , Jiaxun Yang Subject: [PATCH 5/5] tests/acceptance: Test PMON on the Fuloong 2E machine Date: Thu, 24 Jun 2021 22:27:47 +0200 Message-Id: <20210624202747.1433023-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210624202747.1433023-1-f4bug@amsat.org> References: <20210624202747.1433023-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: $ PMON2E_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 Reviewed-by: Wainer dos Santos Moschetta --- tests/acceptance/machine_mips_fuloong2e.py | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/tests/acceptance/machine_mips_fuloong2e.py b/tests/acceptance/= machine_mips_fuloong2e.py index 0ac285e2af1..4854ba98560 100644 --- a/tests/acceptance/machine_mips_fuloong2e.py +++ b/tests/acceptance/machine_mips_fuloong2e.py @@ -8,15 +8,77 @@ # 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('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('PMON2E_BIN_PATH'), 'PMON2E_BIN_PATH not availab= le') + def test_pmon_serial_console(self): + """ + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:fuloong2e + :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('PMON2E_BIN_P= ATH'), + 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') + + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + # 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('PMON2E_BIN_PATH'), 'PMON2E_BIN_PATH not availab= le') + def test_pmon_framebuffer_console(self): + """ + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:fuloong2e + :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('PMON2E_BIN_P= ATH'), + asset_hash=3Dpmon_hash, algorithm=3D'= md5') + + self.vm.set_console() + self.vm.add_args('-bios', pmon_path, + '-vga', 'std', + '-device', 'ati-vga,model=3Drv100') + 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= ') @skipUnless(os.getenv('RESCUE_YL_PATH'), 'RESCUE_YL_PATH not available= ') def test_linux_kernel_isa_serial(self): --=20 2.31.1