qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Niek Linnenbank <nieklinnenbank@gmail.com>
To: qianfanguijin@163.com
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v2 11/12] tests: avocado: boot_linux_console: Add test case for bpim2u
Date: Thu, 6 Apr 2023 22:21:34 +0200	[thread overview]
Message-ID: <CAPan3WpDB-Zhck8TQO_6Tu4Et11qKL=Vyro=fCbnTwDDhEha6Q@mail.gmail.com> (raw)
In-Reply-To: <20230328054832.18790-2-qianfanguijin@163.com>

[-- Attachment #1: Type: text/plain, Size: 11170 bytes --]

Hi Qianfan,

The tests look good to me and are working OK:

ARMBIAN_ARTIFACTS_CACHED=yes AVOCADO_ALLOW_LARGE_STORAGE=yes
./build/tests/venv/bin/avocado --show=app,console run -t machine:bpim2u
tests/avocado/boot_linux_console.py
 (1/4)
tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_bpim2u:
/console: [    0.000000] Booting Linux on physical CPU 0x0
console: [    0.000000] Linux version 5.10.16-sunxi (root@beast)
(arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture
8.3-2019.03 (arm-rel-8.36)) 8.3.0, GNU ld (GNU Toolchain for the A-profile
Architecture 8.3-2019.03 (arm-rel-8.36)) 2.32.0.20190321) #21.02.2 SMP Sun
Feb 14 21:12:17 CET 2021
console: [    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7),
cr=50c5387d
...
PASS (15.77 s)
RESULTS    : PASS 4 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
CANCEL 0
JOB TIME   : 62.90 s

So for me:

Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com>


On Tue, Mar 28, 2023 at 7:49 AM <qianfanguijin@163.com> wrote:

> From: qianfan Zhao <qianfanguijin@163.com>
>
> Add test case for booting from initrd and sd card.
>
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  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')
>
> +    def test_arm_bpim2u(self):
> +        """
> +        :avocado: tags=arch:arm
> +        :avocado: tags=machine:bpim2u
> +        :avocado: tags=accel:tcg
> +        """
> +        deb_url = ('
> https://apt.armbian.com/pool/main/l/linux-5.10.16-sunxi/'
> +                   'linux-image-current-sunxi_21.02.2_armhf.deb')
> +        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
> +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +        kernel_path = self.extract_from_deb(deb_path,
> +                                            '/boot/vmlinuz-5.10.16-sunxi')
> +        dtb_path = ('/usr/lib/linux-image-current-sunxi/'
> +                    'sun8i-r40-bananapi-m2-ultra.dtb')
> +        dtb_path = self.extract_from_deb(deb_path, dtb_path)
> +
> +        self.vm.set_console()
> +        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> +                               'console=ttyS0,115200n8 '
> +                               'earlycon=uart,mmio32,0x1c28000')
> +        self.vm.add_args('-kernel', kernel_path,
> +                         '-dtb', dtb_path,
> +                         '-append', kernel_command_line)
> +        self.vm.launch()
> +        console_pattern = 'Kernel command line: %s' % kernel_command_line
> +        self.wait_for_console_pattern(console_pattern)
> +
> +    def test_arm_bpim2u_initrd(self):
> +        """
> +        :avocado: tags=arch:arm
> +        :avocado: tags=accel:tcg
> +        :avocado: tags=machine:bpim2u
> +        """
> +        deb_url = ('
> https://apt.armbian.com/pool/main/l/linux-5.10.16-sunxi/'
> +                   'linux-image-current-sunxi_21.02.2_armhf.deb')
> +        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
> +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +        kernel_path = self.extract_from_deb(deb_path,
> +                                            '/boot/vmlinuz-5.10.16-sunxi')
> +        dtb_path = ('/usr/lib/linux-image-current-sunxi/'
> +                    'sun8i-r40-bananapi-m2-ultra.dtb')
> +        dtb_path = self.extract_from_deb(deb_path, dtb_path)
> +        initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
> +                      '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
> +                      'arm/rootfs-armv7a.cpio.gz')
> +        initrd_hash = '604b2e45cdf35045846b8bbfbf2129b1891bdc9c'
> +        initrd_path_gz = self.fetch_asset(initrd_url,
> asset_hash=initrd_hash)
> +        initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
> +        archive.gzip_uncompress(initrd_path_gz, initrd_path)
> +
> +        self.vm.set_console()
> +        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> +                               'console=ttyS0,115200 '
> +                               'panic=-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=arch:arm
> +        :avocado: tags=accel:tcg
> +        :avocado: tags=machine:bpim2u
> +        :avocado: tags=device:sd
> +        """
> +        self.require_netdev('user')
> +
> +        deb_url = ('
> https://apt.armbian.com/pool/main/l/linux-5.10.16-sunxi/'
> +                   'linux-image-current-sunxi_21.02.2_armhf.deb')
> +        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
> +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +        kernel_path = self.extract_from_deb(deb_path,
> +                                            '/boot/vmlinuz-5.10.16-sunxi')
> +        dtb_path = ('/usr/lib/linux-image-current-sunxi/'
> +                    'sun8i-r40-bananapi-m2-ultra.dtb')
> +        dtb_path = self.extract_from_deb(deb_path, dtb_path)
> +        rootfs_url = ('
> http://storage.kernelci.org/images/rootfs/buildroot/'
> +
> 'buildroot-baseline/20221116.0/armel/rootfs.ext2.xz')
> +        rootfs_hash = 'fae32f337c7b87547b10f42599acf109da8b6d9a'
> +        rootfs_path_xz = self.fetch_asset(rootfs_url,
> asset_hash=rootfs_hash)
> +        rootfs_path = 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 = (self.KERNEL_COMMON_COMMAND_LINE +
> +                               'console=ttyS0,115200 '
> +                               'root=/dev/mmcblk0 rootwait rw '
> +                               'panic=-1 noreboot')
> +        self.vm.add_args('-kernel', kernel_path,
> +                         '-dtb', dtb_path,
> +                         '-drive', 'file=' + rootfs_path +
> ',if=sd,format=raw',
> +                         '-net', 'nic,model=gmac,netdev=host_gmac',
> +                         '-netdev', 'user,id=host_gmac',
> +                         '-append', kernel_command_line,
> +                         '-no-reboot')
> +        self.vm.launch()
> +        shell_ready = "/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=arch:arm
> +        :avocado: tags=machine:bpim2u
> +        :avocado: tags=device:sd
> +        """
> +
> +        # This test download a 8.9 MiB compressed image and expand it
> +        # to 127 MiB.
> +        image_url = ('
> https://downloads.openwrt.org/releases/22.03.3/targets/'
> +                     'sunxi/cortexa7/openwrt-22.03.3-sunxi-cortexa7-'
> +                     'sinovoip_bananapi-m2-ultra-ext4-sdcard.img.gz')
> +        image_hash = ('5b41b4e11423e562c6011640f9a7cd3b'
> +                      'dd0a3d42b83430f7caa70a432e6cd82c')
> +        image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash,
> +                                         algorithm='sha256')
> +        image_path = archive.extract(image_path_gz, self.workdir)
> +        image_pow2ceil_expand(image_path)
> +
> +        self.vm.set_console()
> +        self.vm.add_args('-drive', 'file=' + image_path +
> ',if=sd,format=raw',
> +                         '-nic', 'user',
> +                         '-no-reboot')
> +        self.vm.launch()
> +
> +        kernel_command_line = (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:', '=>')
> +        exec_command_and_wait_for_pattern(self, "setenv extraargs '" +
> +                                                kernel_command_line +
> "'", '=>')
> +        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=arch:arm
> --
> 2.25.1
>
>

-- 
Niek Linnenbank

[-- Attachment #2: Type: text/html, Size: 15170 bytes --]

  reply	other threads:[~2023-04-06 20:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28  5:48 [PATCH v2 11/11] docs: system: arm: Introduce bananapi_m2u qianfanguijin
2023-03-28  5:48 ` [PATCH v2 11/12] tests: avocado: boot_linux_console: Add test case for bpim2u qianfanguijin
2023-04-06 20:21   ` Niek Linnenbank [this message]
2023-03-28  5:48 ` [PATCH v2 12/12] docs: system: arm: Introduce bananapi_m2u qianfanguijin
2023-04-06 19:26 ` [PATCH v2 11/11] " Niek Linnenbank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPan3WpDB-Zhck8TQO_6Tu4Et11qKL=Vyro=fCbnTwDDhEha6Q@mail.gmail.com' \
    --to=nieklinnenbank@gmail.com \
    --cc=b.galvani@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qianfanguijin@163.com \
    --cc=strahinja.p.jankovic@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).