From: Cleber Rosa <crosa@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Lukáš Doktor" <ldoktor@redhat.com>,
"Amador Pahim" <apahim@redhat.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Zheng Xiang" <xiang.zheng@linaro.org>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Fam Zheng" <famz@redhat.com>,
"Alistair Francis" <alistair23@gmail.com>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [RFC PATCH 6/7] avocado: Add a test parsing Linux kernel booting console
Date: Tue, 1 May 2018 17:17:04 -0400 [thread overview]
Message-ID: <cc3dbc73-750b-cf8e-9df6-63ab6ab9fc44@redhat.com> (raw)
In-Reply-To: <20180419164642.9536-7-f4bug@amsat.org>
On 04/19/2018 12:46 PM, Philippe Mathieu-Daudé wrote:
> Booting an Alpha DP264 machine.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> tests/avocado/test_linux-boot-console.py | 88 +++++++++++++++++++
> .../parameters.yaml | 3 +
> 2 files changed, 91 insertions(+)
> create mode 100644 tests/avocado/test_linux-boot-console.py
> create mode 100644 tests/avocado/test_linux-boot-console.py.data/parameters.yaml
>
> diff --git a/tests/avocado/test_linux-boot-console.py b/tests/avocado/test_linux-boot-console.py
> new file mode 100644
> index 0000000000..f54d10dd79
> --- /dev/null
> +++ b/tests/avocado/test_linux-boot-console.py
> @@ -0,0 +1,88 @@
> +# -*- coding: utf-8 -*-
> +#
> +# Boot a Linux kernel on the Malta board and check the serial console output
> +#
> +# Copyright (C) 2018 Philippe Mathieu-Daudé
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Run with:
> +#
> +# avocado run test_linux-boot-console.py \
> +# --mux-yaml test_linux-boot-console.py.data/parameters.yaml
> +# [--filter-by-tags arch_alpha ...]
> +
> +import os
> +import tempfile
> +import hashlib
> +import urllib2
> +import gzip
> +import shutil
> +
> +from avocado import skipUnless
> +from avocado_qemu import test
> +
> +# XXX Use a cleaner CacheStorage or avocado.utils.[archive|kernel]?
> +def cachedfile(url, cachedir='/tmp/mycachedir', gzip_compressed=False):
> + if not os.path.isdir(cachedir):
> + os.mkdir(cachedir)
> + key = hashlib.md5(url).hexdigest()
> + fbin = cachedir + "/" + key + ".bin"
> + if not os.path.isfile(fbin):
> + with open(cachedir + "/" + key + ".url", "w") as f:
> + f.write(url + '\n')
> + with open(fbin, "wb") as f:
> + content = urllib2.urlopen(url).read()
> + f.write(content)
> + if gzip_compressed:
> + fgz = cachedir + "/" + key + ".gz"
> + shutil.move(fbin, fgz)
> + with gzip.open(fgz, 'rb') as f_in, open(fbin, 'wb') as f_out:
> + shutil.copyfileobj(f_in, f_out)
> + return fbin
> +
> +
As pointed on my reply to PATCH 0, Avocado has a downloading/caching
system, but the "uncompress if needed" does not exist yet. We're
tracking the implementation of such a utility function here:
https://trello.com/c/LQFOMPgV/1308-avocadoutilsarchive-add-uncompress-if-necessary
- Cleber.
next prev parent reply other threads:[~2018-05-01 21:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 16:46 [Qemu-devel] [RFC PATCH 0/7] avocado: Add acceptance tests parsing the Linux boot console Philippe Mathieu-Daudé
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 1/7] AVOCADO_QEMU: Snapshot commit Philippe Mathieu-Daudé
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 2/7] avocado: Update python scripts to upstream codebase Philippe Mathieu-Daudé
2018-05-01 0:56 ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 3/7] qemu.py: Check console arch is supported before calling mktemp() Philippe Mathieu-Daudé
2018-05-01 19:30 ` Cleber Rosa
2018-05-01 19:35 ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 4/7] qemu.py: Avoid deprecated tempfile.mktemp() Philippe Mathieu-Daudé
2018-05-01 19:33 ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 5/7] avocado: Add an optional flag 'login' to get_console() Philippe Mathieu-Daudé
2018-05-01 19:46 ` Cleber Rosa
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 6/7] avocado: Add a test parsing Linux kernel booting console Philippe Mathieu-Daudé
2018-04-19 19:38 ` Richard Henderson
2018-05-01 21:17 ` Cleber Rosa [this message]
2018-04-19 16:46 ` [Qemu-devel] [RFC PATCH 7/7] avocado: Add tests booting the Malta machine Philippe Mathieu-Daudé
2018-05-01 21:20 ` Cleber Rosa
2018-04-19 17:14 ` [Qemu-devel] [RFC PATCH 0/7] avocado: Add acceptance tests parsing the Linux boot console no-reply
2018-04-20 4:17 ` Philippe Mathieu-Daudé
2018-04-20 12:59 ` Philippe Mathieu-Daudé
2018-05-02 16:22 ` Cleber Rosa
2018-04-30 22:49 ` Cleber Rosa
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=cc3dbc73-750b-cf8e-9df6-63ab6ab9fc44@redhat.com \
--to=crosa@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=alistair23@gmail.com \
--cc=apahim@redhat.com \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=ldoktor@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@gmail.com \
--cc=xiang.zheng@linaro.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).