From: Wainer dos Santos Moschetta <wainersm@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Nolan Leake" <nolan@sigbus.net>,
qemu-arm@nongnu.org, "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
"Cleber Rosa" <crosa@redhat.com>
Subject: Re: [PATCH] tests: Boot and halt a Linux guest on the Raspberry Pi 2 machine
Date: Mon, 31 May 2021 16:26:07 -0300 [thread overview]
Message-ID: <eb40c42b-72aa-39dd-784c-d31dbdbdfc8a@redhat.com> (raw)
In-Reply-To: <20210531113837.1689775-1-f4bug@amsat.org>
On 5/31/21 8:38 AM, Philippe Mathieu-Daudé wrote:
> Add a test booting and quickly shutdown a raspi2 machine,
> to test the power management model:
>
> (1/1) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_initrd:
> console: [ 0.000000] Booting Linux on physical CPU 0xf00
> console: [ 0.000000] Linux version 4.14.98-v7+ (dom@dom-XPS-13-9370) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1200 SMP Tue Feb 12 20:27:48 GMT 2019
> console: [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
> console: [ 0.000000] CPU: div instructions available: patching division code
> console: [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
> console: [ 0.000000] OF: fdt: Machine model: Raspberry Pi 2 Model B
> ...
> console: Boot successful.
> console: cat /proc/cpuinfo
> console: / # cat /proc/cpuinfo
> ...
> console: processor : 3
> console: model name : ARMv7 Processor rev 5 (v7l)
> console: BogoMIPS : 125.00
> console: Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
> console: CPU implementer : 0x41
> console: CPU architecture: 7
> console: CPU variant : 0x0
> console: CPU part : 0xc07
> console: CPU revision : 5
> console: Hardware : BCM2835
> console: Revision : 0000
> console: Serial : 0000000000000000
> console: cat /proc/iomem
> console: / # cat /proc/iomem
> console: 00000000-3bffffff : System RAM
> console: 00008000-00afffff : Kernel code
> console: 00c00000-00d468ef : Kernel data
> console: 3f006000-3f006fff : dwc_otg
> console: 3f007000-3f007eff : /soc/dma@7e007000
> console: 3f00b880-3f00b8bf : /soc/mailbox@7e00b880
> console: 3f100000-3f100027 : /soc/watchdog@7e100000
> console: 3f101000-3f102fff : /soc/cprman@7e101000
> console: 3f200000-3f2000b3 : /soc/gpio@7e200000
> PASS (24.59 s)
> RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
> JOB TIME : 25.02 s
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Based-on: <162137039825.30884.2445825798240809194-0@git.sr.ht>
> ---
> tests/acceptance/boot_linux_console.py | 43 ++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
Even though I did not patch my sources with the fix, I ran the test and
it failed on the VM's shutdown (as expected, I suppose). The test code
looks good to me, so:
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
>
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 276a53f1464..19d328203c7 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -16,6 +16,7 @@
> from avocado import skip
> from avocado import skipUnless
> from avocado_qemu import Test
> +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
> @@ -467,6 +468,48 @@ def test_arm_raspi2_uart0(self):
> """
> self.do_test_arm_raspi2(0)
>
> + def test_arm_raspi2_initrd(self):
> + """
> + :avocado: tags=arch:arm
> + :avocado: tags=machine:raspi2
> + """
> + deb_url = ('http://archive.raspberrypi.org/debian/'
> + 'pool/main/r/raspberrypi-firmware/'
> + 'raspberrypi-kernel_1.20190215-1_armhf.deb')
> + deb_hash = 'cd284220b32128c5084037553db3c482426f3972'
> + deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> + kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
> + dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
> +
> + 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 +
> + 'earlycon=pl011,0x3f201000 console=ttyAMA0 '
> + 'panic=-1 noreboot ' +
> + 'dwc_otg.fiq_fsm_enable=0')
> + 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',
> + 'BCM2835')
> + exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
> + '/soc/cprman@7e101000')
> + exec_command(self, 'halt')
> + # Wait for VM to shut down gracefully
> + self.vm.wait()
> +
> def test_arm_exynos4210_initrd(self):
> """
> :avocado: tags=arch:arm
next prev parent reply other threads:[~2021-05-31 19:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 11:38 [PATCH] tests: Boot and halt a Linux guest on the Raspberry Pi 2 machine Philippe Mathieu-Daudé
2021-05-31 19:26 ` Wainer dos Santos Moschetta [this message]
2021-06-28 17:39 ` Peter Maydell
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=eb40c42b-72aa-39dd-784c-d31dbdbdfc8a@redhat.com \
--to=wainersm@redhat.com \
--cc=Andrew.Baumann@microsoft.com \
--cc=crosa@redhat.com \
--cc=f4bug@amsat.org \
--cc=nolan@sigbus.net \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).