qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cleber Rosa <crosa@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Frédéric Basse" <contact@fredericb.info>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Evgeny Voevodin" <e.voevodin@samsung.com>,
	"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>,
	"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	qemu-devel@nongnu.org, "Krzysztof Kozlowski" <krzk@kernel.org>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	qemu-arm@nongnu.org, "Dmitry Solodkiy" <d.solodkiy@samsung.com>,
	"Maksim Kozlov" <m.kozlov@samsung.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Guenter Roeck" <linux@roeck-us.net>
Subject: Re: [PATCH 5/5] tests/boot_linux_console: Add sdcard test for the Exynos4210
Date: Tue, 8 Oct 2019 19:12:26 -0400	[thread overview]
Message-ID: <20191008231226.GC11091@localhost.localdomain> (raw)
In-Reply-To: <20191005154748.21718-6-f4bug@amsat.org>

On Sat, Oct 05, 2019 at 05:47:48PM +0200, Philippe Mathieu-Daudé wrote:
> This test boots a Linux kernel on a smdkc210 board and verify
> the serial output is working.
> 
> The cpio image used comes from the linux-build-test project:
> https://github.com/groeck/linux-build-test
> 
> Since this test is not reliable due to clock timing issues,
> it is disabled with the 'skip' property.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/acceptance/boot_linux_console.py | 47 ++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
> index 197358a69c..2d0d82b013 100644
> --- a/tests/acceptance/boot_linux_console.py
> +++ b/tests/acceptance/boot_linux_console.py
> @@ -14,6 +14,7 @@ import lzma
>  import gzip
>  import shutil
>  
> +from avocado import skip
>  from avocado_qemu import Test
>  from avocado.utils import process
>  from avocado.utils import archive
> @@ -359,6 +360,52 @@ class BootLinuxConsole(Test):
>          self.wait_for_console_pattern('Boot successful.')
>          # TODO user command, for now the uart is stuck
>  
> +    @skip("unstable clock timings")

On the topic of skipping unstable tests, don't you think this is
something that should check for some type of flag?

Just for the sake of brainstorming, other possiblity is to build on
Avocado's "WARN" test status, and instead of failing a test (and
affecting the overall job execution), simply warn the user.  A
decorator such as "@warn_on" could be implemented similar to the
existing "@fail_on" and "@cancel_on".

> +    def test_arm_exynos4210_sdcard(self):
> +        """
> +        :avocado: tags=arch:arm
> +        :avocado: tags=machine:smdkc210
> +        """
> +        deb_url = ('https://snapshot.debian.org/archive/debian/'
> +                   '20190928T224601Z/pool/main/l/linux/'
> +                   'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
> +        deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
> +        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
> +        kernel_path = self.extract_from_deb(deb_path,
> +                                            '/boot/vmlinuz-4.19.0-6-armmp')
> +        dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
> +        dtb_path = self.extract_from_deb(deb_path, dtb_path)
> +
> +        rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
> +                      '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
> +                      'arm/rootfs-armv5.ext2.gz')
> +        rootfs_hash = '093e89d2b4d982234bf528bc9fb2f2f17a9d1f93'
> +        rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
> +        rootfs_path = os.path.join(self.workdir, 'rootfs.ext2')
> +        gunzip(rootfs_path_gz, rootfs_path)

I was going to suggest the same thing as the previous patch, but this
turned out to be quite interesting.  Basically, both compressed and
uncompressed verions of this file seems to disguise themselves pretty
well as a tar file:

 $ tar vtf rootfs-armv5.ext2.gz
 $ gzip -dc rootfs-armv5.ext2.gz | tar vtf -
 $ python3 -m tarfile -l rootfs-armv5.ext2.gz
 $ python3 -m tarfile -l rootfs-armv5.ext2

Even though it is not.  This affects how "avocado.utils.uncompress"
detects the file, and consequently how it tries to uncompress it.
So, here, you could instead use:

  archive.gzip_uncompress(rootfs_path_gz, rootfs_path)

To avoid relying on the broken tar file detection.

- Cleber.

> +
> +        self.vm.set_machine('smdkc210')
> +        self.vm.set_console(console_id=1)
> +        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> +                               'earlycon=exynos4210,0x13810000 earlyprintk ' +
> +                               'console=ttySAC1,115200n8 ' +
> +                               'random.trust_cpu=off cryptomgr.notests ' +
> +                               'root=/dev/mmcblk0 rootwait rw ' +
> +                               'cpuidle.off=1 panic=-1 noreboot')
> +
> +        self.vm.add_args('-kernel', kernel_path,
> +                         '-dtb', dtb_path,
> +                         '-append', kernel_command_line,
> +                         # The external MMC is on the 3rd slot
> +                         '-drive', 'if=sd,driver=null-co',
> +                         '-drive', 'if=sd,driver=null-co',
> +                         '-drive', 'if=sd,file=' + rootfs_path + ',format=raw',
> +                         '-no-reboot')
> +        self.vm.launch()
> +
> +        self.wait_for_console_pattern('Boot successful.')
> +        # TODO user command, for now the uart is stuck
> +
>      def test_s390x_s390_ccw_virtio(self):
>          """
>          :avocado: tags=arch:s390x
> -- 
> 2.20.1
> 
> 


  reply	other threads:[~2019-10-08 23:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-05 15:47 [PATCH 0/5] hw/arm/exynos4210: Add acceptance tests to the SMDKC210 board Philippe Mathieu-Daudé
2019-10-05 15:47 ` [PATCH 1/5] tests/boot_linux_console: Add initrd test for the Exynos4210 Philippe Mathieu-Daudé
2019-10-07 16:28   ` Peter Maydell
2019-10-08 21:49     ` Cleber Rosa
2019-10-08 23:01       ` Guenter Roeck
2019-10-09 13:38       ` Peter Maydell
2019-10-09 19:07         ` Cleber Rosa
2019-10-10 13:43           ` Philippe Mathieu-Daudé
2019-10-21 12:11             ` Philippe Mathieu-Daudé
2019-10-08 21:35   ` Cleber Rosa
2019-10-05 15:47 ` [PATCH 2/5] hw/sd/sdhci: Add a comment to distinct the i.MX eSDHC functions Philippe Mathieu-Daudé
2019-10-08 21:58   ` Cleber Rosa
2019-10-05 15:47 ` [PATCH 3/5] hw/sd/sdhci: Add dummy Samsung SDHCI controller Philippe Mathieu-Daudé
2019-10-07  8:59   ` Krzysztof Kozlowski
2019-10-05 15:47 ` [PATCH 4/5] hw/arm/exynos4210: Use the Samsung s3c " Philippe Mathieu-Daudé
2019-10-07  9:00   ` Krzysztof Kozlowski
2019-10-05 15:47 ` [PATCH 5/5] tests/boot_linux_console: Add sdcard test for the Exynos4210 Philippe Mathieu-Daudé
2019-10-08 23:12   ` Cleber Rosa [this message]
2019-10-07  9:10 ` [PATCH 0/5] hw/arm/exynos4210: Add acceptance tests to the SMDKC210 board Krzysztof Kozlowski
2019-10-07 17:42   ` Krzysztof Kozlowski
2019-10-18 14:48 ` Philippe Mathieu-Daudé
2019-10-22 12:54   ` 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=20191008231226.GC11091@localhost.localdomain \
    --to=crosa@redhat.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=contact@fredericb.info \
    --cc=d.solodkiy@samsung.com \
    --cc=e.voevodin@samsung.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=i.mitsyanko@gmail.com \
    --cc=jcd@tribudubois.net \
    --cc=krzk@kernel.org \
    --cc=linux@roeck-us.net \
    --cc=m.kozlov@samsung.com \
    --cc=peter.maydell@linaro.org \
    --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).