tests: acpi: improve tests reproducability
cover tests: acpi: improve tests reproducability
series should help to make tests more reproducable and not depend on IASL being installed. IASL will be required only is user needs to get textual diff of mismatching files.
Igor Mammedov (2):
tests: acpi: do not require IASL for dumping AML blobs
tests: acpi: do not skip tests when IASL is not installed
tests/bios-tables-test.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
Signature · 1 line
2.18.1
PATCH 1/2 tests: acpi: do not require IASL for dumping AML blobs
IASL isn't needed when dumping ACPI tables from guest for rebuild purposes. So move this part out from IASL branch.
Makes rebuild-expected-aml.sh work without IASL installed on host.
--- tests/bios-tables-test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
tests/bios-tables-test.c +4 -6
@@ -597,12 +597,10 @@ static void test_acpi_one(const char *params, test_data *data)test_acpi_rxsdt_table (data);test_acpi_fadt_table (data); -if (iasl) { -if (getenv (ACPI_REBUILD_EXPECTED_AML )) { -dump_aml_files (data, true); - }else { -test_acpi_asl (data); - } +if (getenv (ACPI_REBUILD_EXPECTED_AML )) { +dump_aml_files (data, true); + }else if (iasl) { +test_acpi_asl (data); }/*
Signature · 1 line
2.18.1
Re: [Qemu-devel] [PATCH 1/2] tests: acpi: do not require IASL for dumping AML blobs
Quoted 7 lines · Igor Mammedov
IASL isn't needed when dumping ACPI tables from guest for rebuild purposes. So move this part out from IASL branch.
Makes
rebuild-expected-aml.shwork without IASL installed on host.Signed-off-by Igor Mammedov <[email protected]>
Quoted 26 lines
--- tests/bios-tables-test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)tests/bios-tables-test.c +4
-6@@ -597,12 +597,10 @@ static void test_acpi_one(const char *params, test_data *data)test_acpi_rxsdt_table (data);test_acpi_fadt_table (data); -if (iasl) { -if (getenv (ACPI_REBUILD_EXPECTED_AML )) { -dump_aml_files (data, true); - }else { -test_acpi_asl (data); - } +if (getenv (ACPI_REBUILD_EXPECTED_AML )) { +dump_aml_files (data, true); + }else if (iasl) { +test_acpi_asl (data); }/*
Re: [Qemu-devel] [PATCH 1/2] tests: acpi: do not require IASL for dumping AML blobs
In reply to Igor MammedovHi Igor,
Quoted 23 lines · Igor Mammedov
IASL isn't needed when dumping ACPI tables from guest for rebuild purposes. So move this part out from IASL branch.
Makes
rebuild-expected-aml.shwork without IASL installed on host.Signed-off-by Igor Mammedov <[email protected]>--- tests/bios-tables-test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)tests/bios-tables-test.c +0
-3@@ -597,12 +597,10 @@ static void test_acpi_one(const char *params, test_data *data)test_acpi_rxsdt_table (data);test_acpi_fadt_table (data); -if (iasl) { -if (getenv (ACPI_REBUILD_EXPECTED_AML )) { -dump_aml_files (data, true);
tests/bios-tables-test.c static void test_acpi_one(const char *params, test_data *data) · line 606
Quoted 10 lines
tests/bios-tables-test.c +4
-3- }else { -test_acpi_asl (data); - } +if (getenv (ACPI_REBUILD_EXPECTED_AML )) { +dump_aml_files (data, true); + }else if (iasl) { +test_acpi_asl (data); }/*
Thanks
Eric
PATCH 2/2 tests: acpi: do not skip tests when IASL is not installed
In reply to Igor Mammedovtests do binary comparition so we can check tables without IASL. Move IASL condition right before decompilation step and skip it if IASL is not installed.
--- tests/bios-tables-test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
tests/bios-tables-test.c +14 -1
@@ -389,6 +389,14 @@ static void test_acpi_asl(test_data *data) all_tables_match = all_tables_match &&test_acpi_find_diff_allowed (exp_sdt); +/* +* don't try to decompile if IASL isn't present, in this case user +* will just 'get binary file mismatch' warnings and test failure +*/ +if (!iasl) { +continue ; + } + err =load_asl (data->tables, sdt); asl =normalize_asl (sdt->asl);
@@ -431,6 +439,11 @@ static void test_acpi_asl(test_data *data)g_string_free (asl, true);g_string_free (exp_asl, true); } +if (!iasl && !all_tables_match) { +fprintf (stderr,"to see ASL diff between mismatched files install IASL," +" rebuild QEMU from scratch and re-run tests with V=1" +" environment variable set" ); + }g_assert (all_tables_match);free_test_data (&exp_data);
@@ -599,7 +612,7 @@ static void test_acpi_one(const char *params, test_data *data)if (getenv (ACPI_REBUILD_EXPECTED_AML )) {dump_aml_files (data, true); - }else if (iasl) { + }else {test_acpi_asl (data); }
Signature · 1 line
2.18.1
Re: [Qemu-devel] [PATCH 2/2] tests: acpi: do not skip tests when IASL is not installed
Quoted 29 lines · Igor Mammedov
tests do binary comparition so we can check tables without IASL. Move IASL condition right before decompilation step and skip it if IASL is not installed.
Signed-off-by Igor Mammedov <[email protected]>--- tests/bios-tables-test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)tests/bios-tables-test.c +8
-0@@ -389,6 +389,14 @@ static void test_acpi_asl(test_data *data) all_tables_match = all_tables_match &&test_acpi_find_diff_allowed (exp_sdt); +/* +* don't try to decompile if IASL isn't present, in this case user +* will just 'get binary file mismatch' warnings and test failure +*/ +if (!iasl) { +continue ; + } + err =load_asl (data->tables, sdt); asl =normalize_asl (sdt->asl);
tests/bios-tables-test.c static void test_acpi_asl(test_data *data) · line 445
Quoted 7 lines
tests/bios-tables-test.c +4
-0@@ -431,6 +439,11 @@ static void test_acpi_asl(test_data *data)g_string_free (asl, true);g_string_free (exp_asl, true); } +if (!iasl && !all_tables_match) { +fprintf (stderr,"to see ASL diff between mismatched files install IASL," +" rebuild QEMU from scratch and re-run tests with V=1" +" environment variable set" );
I guess remember Thomas asked to use g_printerr() instead of fprintf() in tests/*.c.
Anyway,
Quoted 14 lines
tests/bios-tables-test.c +2
-1+ }g_assert (all_tables_match);free_test_data (&exp_data);@@ -599,7 +612,7 @@ static void test_acpi_one(const char *params, test_data *data)if (getenv (ACPI_REBUILD_EXPECTED_AML )) {dump_aml_files (data, true); - }else if (iasl) { + }else {test_acpi_asl (data); }
Re: [Qemu-devel] [PATCH 2/2] tests: acpi: do not skip tests when IASL is not installed
Quoted 29 lines · On Thu, 4 Jul 2019 11:33:19 +0200 Philippe Mathieu-Daudé <[email protected]>…
Quoted 28 lines · Igor Mammedov
tests do binary comparition so we can check tables without IASL. Move IASL condition right before decompilation step and skip it if IASL is not installed.
Signed-off-by Igor Mammedov <[email protected]>--- tests/bios-tables-test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)tests/bios-tables-test.c +8
-0@@ -389,6 +389,14 @@ static void test_acpi_asl(test_data *data) all_tables_match = all_tables_match &&test_acpi_find_diff_allowed (exp_sdt); +/* +* don't try to decompile if IASL isn't present, in this case user +* will just 'get binary file mismatch' warnings and test failure +*/ +if (!iasl) { +continue ; + } + err =load_asl (data->tables, sdt); asl =normalize_asl (sdt->asl);
Quoted 10 lines
tests/bios-tables-test.c static void test_acpi_asl(test_data *data) · line 445
Quoted 8 lines
tests/bios-tables-test.c +4
-0@@ -431,6 +439,11 @@ static void test_acpi_asl(test_data *data)g_string_free (asl, true);g_string_free (exp_asl, true); } +if (!iasl && !all_tables_match) { +fprintf (stderr,"to see ASL diff between mismatched files install IASL," +" rebuild QEMU from scratch and re-run tests with V=1" +" environment variable set" );I guess remember Thomas asked to use
g_printerr()instead offprintf()
whole file uses fprintf().
I'd rather send extra patch on top that consistently changes test to g_printerr()
Quoted 4 lines
in tests/*.c.
Anyway,
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Quoted 16 lines
Quoted 15 lines
tests/bios-tables-test.c +2
-1+ }g_assert (all_tables_match);free_test_data (&exp_data);@@ -599,7 +612,7 @@ static void test_acpi_one(const char *params, test_data *data)if (getenv (ACPI_REBUILD_EXPECTED_AML )) {dump_aml_files (data, true); - }else if (iasl) { + }else {test_acpi_asl (data); }
Re: [Qemu-devel] [PATCH 2/2] tests: acpi: do not skip tests when IASL is not installed
In reply to Igor MammedovHi,
Quoted 1 line · Igor Mammedov
tests do binary comparition so we can check tables without
comparison
Quoted 41 lines
IASL. Move IASL condition right before decompilation step and skip it if IASL is not installed.
Signed-off-by Igor Mammedov <[email protected]>--- tests/bios-tables-test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)tests/bios-tables-test.c +13
-0@@ -389,6 +389,14 @@ static void test_acpi_asl(test_data *data) all_tables_match = all_tables_match &&test_acpi_find_diff_allowed (exp_sdt); +/* +* don't try to decompile if IASL isn't present, in this case user +* will just 'get binary file mismatch' warnings and test failure +*/ +if (!iasl) { +continue ; + } + err =load_asl (data->tables, sdt); asl =normalize_asl (sdt->asl);@@ -431,6 +439,11 @@ static void test_acpi_asl(test_data *data)g_string_free (asl, true);g_string_free (exp_asl, true); } +if (!iasl && !all_tables_match) { +fprintf (stderr,"to see ASL diff between mismatched files install IASL," +" rebuild QEMU from scratch and re-run tests with V=1" +" environment variable set" ); + }g_assert (all_tables_match);free_test_data (&exp_data);
tests/bios-tables-test.c static void test_acpi_one(const char *params, test_data *data) · line 618
Quoted 8 lines
tests/bios-tables-test.c +1
-1@@ -599,7 +612,7 @@ static void test_acpi_one(const char *params, test_data *data)if (getenv (ACPI_REBUILD_EXPECTED_AML )) {dump_aml_files (data, true); - }else if (iasl) { + }else {test_acpi_asl (data); }
Thanks
Eric
PATCH v2 2/2 tests: acpi: do not skip tests when IASL is not installed
In reply to Igor Mammedovtests do binary comparision so we can check tables without IASL. Move IASL condition right before decompilation step and skip it if IASL is not installed.
---
v2:
- fix typo in commit message
Eric Auger <[email protected]>
tests/bios-tables-test.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
tests/bios-tables-test.c +14 -1
@@ -389,6 +389,14 @@ static void test_acpi_asl(test_data *data) all_tables_match = all_tables_match &&test_acpi_find_diff_allowed (exp_sdt); +/* +* don't try to decompile if IASL isn't present, in this case user +* will just 'get binary file mismatch' warnings and test failure +*/ +if (!iasl) { +continue ; + } + err =load_asl (data->tables, sdt); asl =normalize_asl (sdt->asl);
@@ -431,6 +439,11 @@ static void test_acpi_asl(test_data *data)g_string_free (asl, true);g_string_free (exp_asl, true); } +if (!iasl && !all_tables_match) { +fprintf (stderr,"to see ASL diff between mismatched files install IASL," +" rebuild QEMU from scratch and re-run tests with V=1" +" environment variable set" ); + }g_assert (all_tables_match);free_test_data (&exp_data);
@@ -599,7 +612,7 @@ static void test_acpi_one(const char *params, test_data *data)if (getenv (ACPI_REBUILD_EXPECTED_AML )) {dump_aml_files (data, true); - }else if (iasl) { + }else {test_acpi_asl (data); }
Signature · 1 line
2.18.1
Quoted 4 lines · Igor Mammedov
series should help to make tests more reproducable and not depend on IASL being installed. IASL will be required only is user needs to get textual diff of mismatching files.
I like this very much but pls send v3 with both patches so I can apply it easily.
Quoted 9 lines
Igor Mammedov (2):
tests: acpi: do not require IASL for dumping AML blobs
tests: acpi: do not skip tests when IASL is not installedtests/bios-tables-test.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)Signature · 1 line
2.18.1