From nobody Tue Feb 10 04:16:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) client-ip=209.85.128.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1637341950; cv=none; d=zohomail.com; s=zohoarc; b=TQzMs70V3xoKb5iYbTq8IrHp9widFZm3wSllfLJn8JKZgY6c5bnJ1Suih7yBm1NeWZa4D7fQdk6B3csZdWQjYUgtpE5qFacvzvlZLEvR2X+xkvwJCs9Eb0KtnB7jeOxwJYX1tFob0+tpKGIrTJfHHUGOg2zNZIfihhHbYle4e2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637341950; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yKHiWsNR0W++K0Ck4B1IBleMBkNdeLmDWfP2xP1p/hE=; b=cCXnE7uj42gEipEWdQsLsRj0vrhpXzRwD7NdW4d24iLuhpStJ+OZ19YFQPljrEzKvttHUzhFQzKt7irZCLqbH5NktOPRTI6xxaReNsE5qP8qTB52ujtZHNNkI3OhX73FUVf+ABFjWtbaUctp5NPxZvg86MCZjnFElpacYQ5YaBg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.zohomail.com with SMTPS id 1637341950701444.54524212529975; Fri, 19 Nov 2021 09:12:30 -0800 (PST) Received: by mail-wm1-f49.google.com with SMTP id p18so9134500wmq.5 for ; Fri, 19 Nov 2021 09:12:30 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id a12sm303368wrm.62.2021.11.19.09.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 09:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yKHiWsNR0W++K0Ck4B1IBleMBkNdeLmDWfP2xP1p/hE=; b=PetEfr7DyTFftf2v4UA+fEQWvLKUzirQcNZ+TehjAomflof6vQIRsEQfqohrHwLmYd rrt/jvC8FfABvv4X5l3/XqmcSvcyWjVD+Fqm3idPNjqGE7vFi0nvQ6j8tjzL65csfAEi SoUyZmD+xRI5tAEVfVPaXvHb9aW71pnbzwaHKon1PLQmsv/2ZmxrBXj8vwtXyykhMQhF Y4tc/0FQteeVI4CqSfoKuT0djSbTCM1sVDJKerHiJ3JwxMG9G4649sh18iNBjoA64jUi FhJJzmYwlZf8x7ahsKfqRWlF3P7ZzjXl/IqlNFogLsZF6Bukdo6mZBp5MtmxtVCxKfuD j3dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yKHiWsNR0W++K0Ck4B1IBleMBkNdeLmDWfP2xP1p/hE=; b=HqpmvkRnf0sO59QtGvxnU5/CCdGFolH8rjL1B/GqjYTIzN3Sl1ROj4vfeR35hHPHgO 5VcizCaszal4E+OOTowsUi2OEO6w6GdZ4NEFn2xbE7kQD6CZJilhh4esSf0lY6egRxVC GpBj8jbG8HMdw9ruro8oWsslX1k8erZi3SyjOugT2hzS7/tHSLOlKzlU0Agx/YNCb4Fx Mh6XXbLK5k3CIHEJgotbiuFR/LYl6td7xvjimH0dX7oaTqk98lGuhifkUv9i1s2rCNpE 0Bqb5NmaFQCt4N9ObTwE+cIfDWwMMGpKZQlU3UZ/PF4VCBU+CrRhXDUTBfGWfM1CyaiB o/eQ== X-Gm-Message-State: AOAM532T2/rD4pyZQoaQ+tZhCfdmEO/e+wNtBJSisComz3DZKDThnO02 aaO1JfwmT7CEO8C7l0vOnYt2ySTv7pw= X-Google-Smtp-Source: ABdhPJx7ak6zBMYzt3QvOzUzjRs1kRST8o1Kt33RKaZVKSLnPNzyDIaGdTyGdJrE5pUKeJkxnp0rXw== X-Received: by 2002:a1c:7910:: with SMTP id l16mr1588737wme.36.1637341948803; Fri, 19 Nov 2021 09:12:28 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Finn Thain , Mark Cave-Ayland Subject: [NOTFORMERGE PATCH 5/5] tests/avocado: Test NetBSD 9.2 on the Jazz Magnum machine Date: Fri, 19 Nov 2021 18:12:02 +0100 Message-Id: <20211119171202.458919-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211119171202.458919-1-f4bug@amsat.org> References: <20211119171202.458919-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) X-ZM-MESSAGEID: 1637341952821100001 Test NetBSD 9.2 on the Jazz Magnum machine. As the firmware is not redistributable, it has to be extracted from the floppy configuration disk coming with a Mips Magnum 4000 system, then the NTPROM_BIN_PATH environment variable has to be set. For convenience a NVRAM pre- initialized to boot NetBSD is included. The test can be run as: $ NTPROM_BIN_PATH=3D/path/to/ntprom.bin \ avocado --show=3Dapp,console \ run -t machine:magnum tests/avocado/ Fetching asset from tests/avocado/machine_mips_jazz.py:MipsJazz.test_magn= um_netbsd_9_2 (1/1) tests/avocado/machine_mips_jazz.py:MipsJazz.test_magnum_netbsd_9_2: console: EISA Bus 0 Initialization In Progress... Direct Memory Access (D= MA) System Control Port B Timer 1 OK. console: ARC Multiboot Version 174 (SGI Version 2.6) console: Copyright (c) 1991,1992 Microsoft Corporation console: Actions: console: Start Windows NT console: Run a program console: Run setup console: Use the arrow keys to select. console: Press Enter to choose. console: Program to run: console: scsi(0)cdrom(2)fdisk(0)boot scsi(0)cdrom(2)fdisk(0)netbsd console: NetBSD/arc Bootstrap, Revision 1.1 (Wed May 12 13:15:55 UTC 2021) console: devopen: scsi(0)cdrom(2)fdisk(0) type disk file netbsd console: NetBSD 9.2 (RAMDISK) #0: Wed May 12 13:15:55 UTC 2021 console: MIPS Magnum console: total memory =3D 128 MB console: avail memory =3D 117 MB console: mainbus0 (root) console: cpu0 at mainbus0: MIPS R4000 CPU (0x400) Rev. 0.0 with MIPS R401= 0 FPC Rev. 0.0 console: cpu0: 8KB/16B direct-mapped L1 Instruction cache, 48 TLB entries console: cpu0: 8KB/16B direct-mapped write-back L1 Data cache console: jazzio0 at mainbus0 console: timer0 at jazzio0 addr 0xe0000228 console: mcclock0 at jazzio0 addr 0xe0004000: mc146818 compatible time-of= -day clock console: LPT1 at jazzio0 addr 0xe0008000 intr 0 not configured console: fdc0 at jazzio0 addr 0xe0003000 intr 1 console: fd0 at fdc0 drive 1: 1.44MB, 80 cyl, 2 head, 18 sec console: MAGNUM at jazzio0 addr 0xe000c000 intr 2 not configured console: VXL at jazzio0 addr 0xe0800000 intr 3 not configured console: sn0 at jazzio0 addr 0xe0001000 intr 4: SONIC Ethernet console: sn0: Ethernet address 00:00:00:00:00:00 console: asc0 at jazzio0 addr 0xe0002000 intr 5: NCR53C94, 25MHz, SCSI ID= 7 console: scsibus0 at asc0: 8 targets, 8 luns per target console: pckbc0 at jazzio0 addr 0xe0005000 intr 6 console: pckbd0 at pckbc0 (kbd slot) console: wskbd0 at pckbd0 (mux ignored) console: pms at jazzio0 addr 0xe0005000 intr 7 not configured console: com0 at jazzio0 addr 0xe0006000 intr 8: ns16550a, working fifo console: com0: txfifo disabled console: com0: console console: com1 at jazzio0 addr 0xe0007000 intr 9: ns16550a, working fifo console: com1: txfifo disabled console: jazzisabr0 at mainbus0 console: isa0 at jazzisabr0 console: isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support console: scsibus0: waiting 2 seconds for devices to settle... console: cd0 at scsibus0 target 2 lun 0: cdrom = removable console: boot device: console: root on md0a dumps on md0b console: root file system type: ffs console: WARNING: preposterous TOD clock time console: WARNING: using filesystem time console: WARNING: CHECK AND RESET THE DATE! console: erase ^H, werase ^W, kill ^U, intr ^C, status ^T console: Terminal type? [vt100] console: Erase is backspace. console: S console: (I)nstall, (S)hell or (H)alt ? console: # console: # ifconfig console: sn0: flags=3D0x8802 mtu 1500 console: ec_capabilities=3D1 console: ec_enabled=3D0 console: address: 00:00:00:02:03:04 console: lo0: flags=3D0x8048 mtu 33160 console: # console: # ifconfig sn0 10.0.2.3/24 console: # console: # ping -c 3 10.0.2.2 console: PING 10.0.2.2 (10.0.2.2): 56 data bytes console: 64 bytes from 10.0.2.2: icmp_seq=3D0 ttl=3D255 time=3D12.526 ms console: 64 bytes from 10.0.2.2: icmp_seq=3D1 ttl=3D255 time=3D2.324 ms console: 64 bytes from 10.0.2.2: icmp_seq=3D2 ttl=3D255 time=3D0.608 ms console: ----10.0.2.2 PING Statistics---- console: 3 packets transmitted, 3 packets received, 0.0% packet loss console: # shutdown -r now console: round-trip min/avg/max/stddev =3D 0.608/5.153/12.526/6.443 ms console: # Shutdown NOW! console: shutdown: [pid 14] console: # sh: /usr/bin/wall: not found console: reboot by root: console: System shutdown time has arrived console: About to run shutdown hooks... console: .: Can't open /etc/rc.shutdown console: Done running shutdown hooks. console: syncing disks... done console: unmounting file systems... done console: rebooting... PASS (49.27 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | = CANCEL 0 JOB TIME : 49.70 s Inspired-by: Herv=C3=A9 Poussineau Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- v2: - Test NetBSD 9.2 (Finn, Mark) - Drop '-global ds1225y.size=3D8200' (Mark) - Mention "Run a program" option (Mark) - Check ARP (Finn) Not for merge until nvram.bin is generated. Cc: Finn Thain Cc: Mark Cave-Ayland --- .../avocado/machine_mips_jazz.d/nvram.bin.xz | Bin 0 -> 700 bytes tests/avocado/machine_mips_jazz.py | 99 ++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 tests/avocado/machine_mips_jazz.d/nvram.bin.xz create mode 100644 tests/avocado/machine_mips_jazz.py diff --git a/tests/avocado/machine_mips_jazz.d/nvram.bin.xz b/tests/avocado= /machine_mips_jazz.d/nvram.bin.xz new file mode 100644 index 0000000000000000000000000000000000000000..4648bb31a75bd1a6ee06818a1bf= 0f2109203ced3 GIT binary patch literal 700 zcmV;t0z>`%H+ooF000E$*0e?f03iV!0000G&sfah5B~ysT>t=3DTewJhU2JbgNgw@93 z9ne@Of$dv11>H(&qfaP~{?QVNDD*)y9o<}llIpWo;zi4K%|O3oZX7;e0I%^w=3D#ho% zm*3>5KcVeDb)hM{s=3D^@xl3*6CLiEr>=3Do;i$-UTTwy=3D`4vF_aQ@AM-}hS_gfV?dXL~ zr6}Ck7jr0Pd6X49Gycxm@5wylC8aWC%NAZ^DQmjk9v0R)a7u1hsY5)le9~S_G;wnI zNEhT-#4+m{FhwCCTK#>itkJ+zGLq(>iH&;ourQ75=3D5X0GCmKgT34hXv`!lNS@Vv~9 z#dTZb1?DkCrj z^?l-ksd=3D`Q%7w&-3CkM)A-1nkM@y=3D-6N=3DHiA4b +# +# 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 +import lzma +import shutil + +from avocado import skipUnless +from avocado_qemu import QemuSystemTest +from avocado_qemu import exec_command +from avocado_qemu import exec_command_and_wait_for_pattern +from avocado_qemu import interrupt_interactive_console_until_pattern +from avocado_qemu import wait_for_console_pattern + +from tesseract_utils import tesseract_available, tesseract_ocr + +class MipsJazz(QemuSystemTest): + + timeout =3D 60 + + @skipUnless(os.getenv('NTPROM_BIN_PATH'), 'NTPROM_BIN_PATH not availab= le') + def test_magnum_netbsd_9_2(self): + """ + :avocado: tags=3Darch:mips64el + :avocado: tags=3Dmachine:magnum + :avocado: tags=3Dos:netbsd + :avocado: tags=3Ddevice:sonic + :avocado: tags=3Ddevice:esp + """ + drive_url =3D ('http://cdn.netbsd.org/pub/NetBSD/' + 'NetBSD-9.2/images/NetBSD-9.2-arc.iso') + drive_hash =3D '409c61aee5459e762cdb120d2591ed2e' + drive_path =3D self.fetch_asset(drive_url, asset_hash=3Ddrive_hash, + algorithm=3D'md5') + ntprom_hash =3D '316de17820192c89b8ee6d9936ab8364a739ca53' + ntprom_path =3D self.fetch_asset('file://' + os.getenv('NTPROM_BIN= _PATH'), + asset_hash=3Dntprom_hash, algorithm= =3D'sha1') + nvram_size =3D 8200 + nvram_path =3D 'nvram.bin' + nvram_xz_hash =3D '3d4565124ff2369706b97e1d0ef127a68c23d418' + nvram_xz_path =3D os.path.dirname(os.path.abspath(__file__)) \ + + '/machine_mips_jazz.d/nvram.bin.xz' + nvram_xz_path =3D self.fetch_asset('file://' + nvram_xz_path, + asset_hash=3Dnvram_xz_hash, + algorithm=3D'sha1') + mac =3D '00:00:00:02:03:04' + + with lzma.open(nvram_xz_path, 'rb') as f_in: + with open(nvram_path, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + f_out.seek(nvram_size) + f_out.write(b'\0') + + self.vm.set_console() + self.vm.add_args('-bios', ntprom_path, + '-drive', 'if=3Dscsi,unit=3D2,media=3Dcdrom,forma= t=3Draw,file=3D' + + drive_path, + '-global', 'ds1225y.filename=3D' + nvram_path, + '-nic', 'user,model=3Ddp83932,mac=3D' + mac) + self.vm.launch() + + console_pattern =3D 'ARC Multiboot Version 174 (SGI Version 2.6)' + wait_for_console_pattern(self, console_pattern) + + wait_for_console_pattern(self, 'Use the arrow keys to select.') + + # Press cursor control 'Down' to select the "Run a program" menu + exec_command(self, '\x1b[B') + + program =3D 'scsi(0)cdrom(2)fdisk(0)boot scsi(0)cdrom(2)fdisk(0)ne= tbsd' + exec_command(self, program) + wait_for_console_pattern(self, 'NetBSD/arc Bootstrap, Revision 1.1= ') + + # Terminal type? [vt100] + console_pattern =3D 'erase ^H, werase ^W, kill ^U, intr ^C, status= ^T' + wait_for_console_pattern(self, console_pattern) + + # (I)nstall, (S)hell or (H)alt + exec_command_and_wait_for_pattern(self, '', 'Erase is backspace.') + exec_command(self, 'S') + interrupt_interactive_console_until_pattern(self, '#') + + exec_command_and_wait_for_pattern(self, 'ifconfig', 'address: ' + = mac) + interrupt_interactive_console_until_pattern(self, '#') + + exec_command(self, 'ifconfig sn0 10.0.2.3/24') + interrupt_interactive_console_until_pattern(self, '#') + + exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2', + '3 packets transmitted, 3 packets received, 0.0% packet lo= ss') + + exec_command_and_wait_for_pattern(self, 'shutdown -r now', + 'rebooting...') --=20 2.31.1