From nobody Tue Feb 10 23:54:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=163.com ARC-Seal: i=1; a=rsa-sha256; t=1681817055; cv=none; d=zohomail.com; s=zohoarc; b=lWuVQEAVKufp7ZwN8/8SpOTMi0mLry6NjhhgLfis7+u8kHH4O1E/4DNye0nHSecsk+8j/PhsMUriwRDKH4j9lNqif8upli9ABJ2d0wRrXvWU5dR+SI7fIY+F7LXJkUyP4Lt57vAc1AJuIx8wCwl41nz9Kbfii4hotg1ij+9ngYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681817055; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Weu6nKau+D9s9+IvOxYdKyovTLJRNQwEMLTYbLqzJo4=; b=kTLp87YGmtw3B8qZAdsuZUhvwv21wfsu/x0VyKR5eCWBhoLQLF7RXFjx/mDEC18cjIRIlBu7Po5VDd+pdPh7KshaQampuRtq1NBwwdHZM6r8p/u9cD4ehdnPWWP1qICXnVcJfFMHyCuXUseCloVm0sFcjpbwjjwrc51HA1yYNHo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681817055464294.78483268976595; Tue, 18 Apr 2023 04:24:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pojOQ-0006UG-Dm; Tue, 18 Apr 2023 07:21:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pojOO-0006S8-Rg; Tue, 18 Apr 2023 07:21:00 -0400 Received: from m12.mail.163.com ([220.181.12.217]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pojOI-0006jg-LC; Tue, 18 Apr 2023 07:21:00 -0400 Received: from DESKTOP-B1R4FVG.localdomain (unknown [218.201.129.19]) by zwqz-smtp-mta-g4-0 (Coremail) with SMTP id _____wDXy2EIfT5k6AUwBw--.24225S12; Tue, 18 Apr 2023 19:20:45 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Weu6n Kau+D9s9+IvOxYdKyovTLJRNQwEMLTYbLqzJo4=; b=Z+bMEPjgb00tzA3r0ln1B Qqh2nTh0JKcDQKQvABoAkbo6hIG7ugKCSXgnFtCQ8z42jcpAzXPv+nBFHnqGL35p qm4g76CNoRhKIgK17229KOWPgzfx56mW2WNYCiygbj9mK36Bm5rGccOgC1+idtCW PiweD/btNmSJj42fAKW470= From: qianfanguijin@163.com To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Strahinja Jankovic , Peter Maydell , Beniamino Galvani , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Niek Linnenbank , qianfan Zhao Subject: [PATCH v3 10/11] tests: avocado: boot_linux_console: Add test case for bpim2u Date: Tue, 18 Apr 2023 19:20:39 +0800 Message-Id: <20230418112040.12460-11-qianfanguijin@163.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230418112040.12460-1-qianfanguijin@163.com> References: <20230418112040.12460-1-qianfanguijin@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDXy2EIfT5k6AUwBw--.24225S12 X-Coremail-Antispam: 1Uf129KBjvJXoW3JrW3uw1UJw47Jw18WF18AFb_yoW3Cr4fpr WDJr13Gr18JFs8Jr4IkrWUu34UJw4vkay7JasrGrZ3WFsFk3yvgFyakr109rZ8Xa9av3sx Cayqya1xWryUJFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zR6by_UUUUU= X-Originating-IP: [218.201.129.19] X-CM-SenderInfo: htld0w5dqj3xxmlqqiywtou0bp/1tbiXQ9V7VWBpR1-UQAAso Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=220.181.12.217; envelope-from=qianfanguijin@163.com; helo=m12.mail.163.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @163.com) X-ZM-MESSAGEID: 1681817056888100003 Content-Type: text/plain; charset="utf-8" From: qianfan Zhao Add test case for booting from initrd and sd card. Signed-off-by: qianfan Zhao --- tests/avocado/boot_linux_console.py | 176 ++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux= _console.py index 574609bf43..d17417828c 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -760,6 +760,182 @@ def test_arm_quanta_gsj_initrd(self): self.wait_for_console_pattern( 'Give root password for system maintenance') =20 + def test_arm_bpim2u(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dmachine:bpim2u + :avocado: tags=3Daccel:tcg + """ + deb_url =3D ('https://apt.armbian.com/pool/main/l/linux-5.10.16-su= nxi/' + 'linux-image-current-sunxi_21.02.2_armhf.deb') + deb_hash =3D '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinuz-5.10.16-sunxi') + dtb_path =3D ('/usr/lib/linux-image-current-sunxi/' + 'sun8i-r40-bananapi-m2-ultra.dtb') + dtb_path =3D self.extract_from_deb(deb_path, dtb_path) + + self.vm.set_console() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0,115200n8 ' + 'earlycon=3Duart,mmio32,0x1c28000') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern =3D 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) + + def test_arm_bpim2u_initrd(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Daccel:tcg + :avocado: tags=3Dmachine:bpim2u + """ + deb_url =3D ('https://apt.armbian.com/pool/main/l/linux-5.10.16-su= nxi/' + 'linux-image-current-sunxi_21.02.2_armhf.deb') + deb_hash =3D '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinuz-5.10.16-sunxi') + dtb_path =3D ('/usr/lib/linux-image-current-sunxi/' + 'sun8i-r40-bananapi-m2-ultra.dtb') + dtb_path =3D self.extract_from_deb(deb_path, dtb_path) + initrd_url =3D ('https://github.com/groeck/linux-build-test/raw/' + '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/' + 'arm/rootfs-armv7a.cpio.gz') + initrd_hash =3D '604b2e45cdf35045846b8bbfbf2129b1891bdc9c' + initrd_path_gz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) + initrd_path =3D os.path.join(self.workdir, 'rootfs.cpio') + archive.gzip_uncompress(initrd_path_gz, initrd_path) + + self.vm.set_console() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0,115200 ' + 'panic=3D-1 noreboot') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + self.vm.launch() + self.wait_for_console_pattern('Boot successful.') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'Allwinner sun8i Family') + exec_command_and_wait_for_pattern(self, 'cat /proc/iomem', + 'system-control@1c00000') + exec_command_and_wait_for_pattern(self, 'reboot', + 'reboot: Restarting system= ') + # Wait for VM to shut down gracefully + self.vm.wait() + + def test_arm_bpim2u_gmac(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Daccel:tcg + :avocado: tags=3Dmachine:bpim2u + :avocado: tags=3Ddevice:sd + """ + self.require_netdev('user') + + deb_url =3D ('https://apt.armbian.com/pool/main/l/linux-5.10.16-su= nxi/' + 'linux-image-current-sunxi_21.02.2_armhf.deb') + deb_hash =3D '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0' + deb_path =3D self.fetch_asset(deb_url, asset_hash=3Ddeb_hash) + kernel_path =3D self.extract_from_deb(deb_path, + '/boot/vmlinuz-5.10.16-sunxi') + dtb_path =3D ('/usr/lib/linux-image-current-sunxi/' + 'sun8i-r40-bananapi-m2-ultra.dtb') + dtb_path =3D self.extract_from_deb(deb_path, dtb_path) + rootfs_url =3D ('http://storage.kernelci.org/images/rootfs/buildro= ot/' + 'buildroot-baseline/20221116.0/armel/rootfs.ext2.xz') + rootfs_hash =3D 'fae32f337c7b87547b10f42599acf109da8b6d9a' + rootfs_path_xz =3D self.fetch_asset(rootfs_url, asset_hash=3Drootf= s_hash) + rootfs_path =3D os.path.join(self.workdir, 'rootfs.cpio') + archive.lzma_uncompress(rootfs_path_xz, rootfs_path) + image_pow2ceil_expand(rootfs_path) + + self.vm.set_console() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyS0,115200 ' + 'root=3D/dev/mmcblk0 rootwait rw ' + 'panic=3D-1 noreboot') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-drive', 'file=3D' + rootfs_path + ',if=3Dsd,for= mat=3Draw', + '-net', 'nic,model=3Dgmac,netdev=3Dhost_gmac', + '-netdev', 'user,id=3Dhost_gmac', + '-append', kernel_command_line, + '-no-reboot') + self.vm.launch() + shell_ready =3D "/bin/sh: can't access tty; job control turned off" + self.wait_for_console_pattern(shell_ready) + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'Allwinner sun8i Family') + exec_command_and_wait_for_pattern(self, 'cat /proc/partitions', + 'mmcblk0') + exec_command_and_wait_for_pattern(self, 'ifconfig eth0 up', + 'eth0: Link is Up') + exec_command_and_wait_for_pattern(self, 'udhcpc eth0', + 'udhcpc: lease of 10.0.2.15 obtained') + exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2', + '3 packets transmitted, 3 packets received, 0% packet loss') + exec_command_and_wait_for_pattern(self, 'reboot', + 'reboot: Restarting system= ') + # Wait for VM to shut down gracefully + self.vm.wait() + + @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited= ') + def test_arm_bpim2u_openwrt_22_03_3(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dmachine:bpim2u + :avocado: tags=3Ddevice:sd + """ + + # This test download a 8.9 MiB compressed image and expand it + # to 127 MiB. + image_url =3D ('https://downloads.openwrt.org/releases/22.03.3/tar= gets/' + 'sunxi/cortexa7/openwrt-22.03.3-sunxi-cortexa7-' + 'sinovoip_bananapi-m2-ultra-ext4-sdcard.img.gz') + image_hash =3D ('5b41b4e11423e562c6011640f9a7cd3b' + 'dd0a3d42b83430f7caa70a432e6cd82c') + image_path_gz =3D self.fetch_asset(image_url, asset_hash=3Dimage_h= ash, + algorithm=3D'sha256') + image_path =3D archive.extract(image_path_gz, self.workdir) + image_pow2ceil_expand(image_path) + + self.vm.set_console() + self.vm.add_args('-drive', 'file=3D' + image_path + ',if=3Dsd,form= at=3Draw', + '-nic', 'user', + '-no-reboot') + self.vm.launch() + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'usbcore.nousb ' + 'noreboot') + + self.wait_for_console_pattern('U-Boot SPL') + + interrupt_interactive_console_until_pattern( + self, 'Hit any key to stop autoboot:', '=3D>') + exec_command_and_wait_for_pattern(self, "setenv extraargs '" + + kernel_command_line + "'",= '=3D>') + exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel .= ..'); + + self.wait_for_console_pattern( + 'Please press Enter to activate this console.') + + exec_command_and_wait_for_pattern(self, ' ', 'root@') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'Allwinner sun8i Family') + exec_command_and_wait_for_pattern(self, 'cat /proc/iomem', + 'system-control@1c00000') + def test_arm_orangepi(self): """ :avocado: tags=3Darch:arm --=20 2.25.1