From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@amazon.com>,
Marcel Apfelbaum <marcel.a@redhat.com>
Subject: [Qemu-devel] [PULL 12/12] acpi-test: issue errors instead of warnings when possible
Date: Tue, 4 Mar 2014 15:03:32 +0200 [thread overview]
Message-ID: <1393937889-14553-13-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1393937889-14553-1-git-send-email-mst@redhat.com>
From: Marcel Apfelbaum <marcel.a@redhat.com>
If the expected (offline) acpi tables loaded correctly,
it is safe to assume the iasl installation is OK and
issue an error if the actual tables failed to load.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/acpi-test.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/tests/acpi-test.c b/tests/acpi-test.c
index 2ce8c18..185309a 100644
--- a/tests/acpi-test.c
+++ b/tests/acpi-test.c
@@ -411,7 +411,7 @@ static bool compare_signature(AcpiSdtTable *sdt, uint32_t signature)
return sdt->header.signature == signature;
}
-static void load_asl(GArray *sdts, AcpiSdtTable *sdt)
+static bool load_asl(GArray *sdts, AcpiSdtTable *sdt)
{
AcpiSdtTable *temp;
GError *error = NULL;
@@ -440,18 +440,22 @@ static void load_asl(GArray *sdts, AcpiSdtTable *sdt)
g_string_append_printf(command_line, "-d %s", sdt->aml_file);
/* pass 'out' and 'out_err' in order to be redirected */
- g_spawn_command_line_sync(command_line->str, &out, &out_err, NULL, &error);
+ ret = g_spawn_command_line_sync(command_line->str, &out, &out_err, NULL, &error);
g_assert_no_error(error);
- ret = g_file_get_contents(sdt->asl_file, (gchar **)&sdt->asl,
- &sdt->asl_len, &error);
- g_assert(ret);
- g_assert_no_error(error);
- g_assert(sdt->asl_len);
+ if (ret) {
+ ret = g_file_get_contents(sdt->asl_file, (gchar **)&sdt->asl,
+ &sdt->asl_len, &error);
+ g_assert(ret);
+ g_assert_no_error(error);
+ g_assert(sdt->asl_len);
+ }
g_free(out);
g_free(out_err);
g_string_free(command_line, true);
+
+ return !ret;
}
#define COMMENT_END "*/"
@@ -518,6 +522,7 @@ static void test_acpi_asl(test_data *data)
int i;
AcpiSdtTable *sdt, *exp_sdt;
test_data exp_data;
+ gboolean exp_err, err;
memset(&exp_data, 0, sizeof(exp_data));
exp_data.tables = load_expected_aml(data);
@@ -528,12 +533,15 @@ static void test_acpi_asl(test_data *data)
sdt = &g_array_index(data->tables, AcpiSdtTable, i);
exp_sdt = &g_array_index(exp_data.tables, AcpiSdtTable, i);
- load_asl(data->tables, sdt);
+ err = load_asl(data->tables, sdt);
asl = normalize_asl(sdt->asl);
- load_asl(exp_data.tables, exp_sdt);
+ exp_err = load_asl(exp_data.tables, exp_sdt);
exp_asl = normalize_asl(exp_sdt->asl);
+ /* TODO: check for warnings */
+ g_assert(!err || exp_err);
+
if (g_strcmp0(asl->str, exp_asl->str)) {
sdt->tmp_files_retain = true;
exp_sdt->tmp_files_retain = true;
--
MST
next prev parent reply other threads:[~2014-03-04 13:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 13:03 [Qemu-devel] [PULL 00/12] acpi,pc,pci,virtio,memory bug fixes Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 01/12] acpi-build: append description for non-hotplug Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 02/12] acpi-test-data: update expected files Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 03/12] virtio-net: remove function calls from assert Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 04/12] memory_region_present: return false if address is not found in child MemoryRegion Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 05/12] PCIE: fix regression with coldplugged multifunction device Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 06/12] Rework --name to use QemuOpts Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 07/12] Add 'debug-threads' suboption to --name Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 08/12] Add a 'name' parameter to qemu_thread_create Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 09/12] MAINTAINERS: drop an out of date address Michael S. Tsirkin
2014-03-04 16:05 ` Andreas Färber
2014-03-04 16:13 ` Paolo Bonzini
2014-03-04 13:03 ` [Qemu-devel] [PULL 10/12] acpi-build: partially revert dac1e93093f9306c114f410785c99aa5261539b4 Michael S. Tsirkin
2014-03-04 13:03 ` [Qemu-devel] [PULL 11/12] acpi-test: retain both asl and aml files on failure Michael S. Tsirkin
2014-03-04 13:03 ` Michael S. Tsirkin [this message]
2014-03-04 13:07 ` [Qemu-devel] [PULL 00/12] acpi,pc,pci,virtio,memory bug fixes Peter Maydell
2014-03-04 13:11 ` Michael S. Tsirkin
2014-03-06 21:43 ` Michael S. Tsirkin
2014-03-06 21:56 ` 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=1393937889-14553-13-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@amazon.com \
--cc=marcel.a@redhat.com \
--cc=peter.maydell@linaro.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).