Skip to contentSkip to conversation

bios-tables-test: do not ignore allowed diff list

PATCH In review Michael S. Tsirkin 3 participants 7 messages Oct 27, 2022 – Oct 31, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bios-tables-test: do not ignore allowed diff list

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Sigh.

Let's at least make it work going forward.

---
 tests/qtest/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +1 -1
index e6096e7f73..a72f6ca326 100644
@@ -458,7 +458,7 @@ static void test_acpi_asl(test_data *data)
                 "for instructions on how to update expected files.\n",
                 exp_sdt->aml, sdt->aml_file, exp_sdt->aml_file);
 
-        all_tables_match = all_tables_match &&
+        all_tables_match = all_tables_match ||
             test_acpi_find_diff_allowed(exp_sdt);
 
         /*
Signature · 1 line
MST
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Michael S. Tsirkin

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Doh! Seems the bug is present from the beginning?

Quoted 6 lines

Sigh.

Let's at least make it work going forward.

Fixes df7cafdeb68b6572fa81 ("bios-tables-test: list all tables that differ")

other than that,

Quoted 20 lines
---
 tests/qtest/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +1 -2
index e6096e7f73..a72f6ca326 100644
@@ -458,7 +458,7 @@ static void test_acpi_asl(test_data *data)
                 "for instructions on how to update expected files.\n",
                 exp_sdt->aml, sdt->aml_file, exp_sdt->aml_file);
 
-        all_tables_match = all_tables_match &&
+        all_tables_match = all_tables_match ||
             test_acpi_find_diff_allowed(exp_sdt);
 
         /*
--

MST

#2 lore raw
In reply to Michael S. Tsirkin
Quoted 7 lines · On Thu, 27 Oct 2022 11:11:48 -0400 "Michael S. Tsirkin" <[email protected]> wrote:

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Sigh.

strange,
it seems to be working fine (I mean white-listing) here

Quoted 21 lines

Let's at least make it work going forward.

---
 tests/qtest/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +1 -1
index e6096e7f73..a72f6ca326 100644
@@ -458,7 +458,7 @@ static void test_acpi_asl(test_data *data)
                 "for instructions on how to update expected files.\n",
                 exp_sdt->aml, sdt->aml_file, exp_sdt->aml_file);
 
-        all_tables_match = all_tables_match &&
+        all_tables_match = all_tables_match ||
             test_acpi_find_diff_allowed(exp_sdt);
 
         /*
#3 lore raw
Quoted 9 lines · Igor Mammedov
Quoted 6 lines · On Thu, 27 Oct 2022 11:11:48 -0400 "Michael S. Tsirkin" <[email protected]> wrote:

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Quoted 4 lines
Quoted 1 line

Sigh.

strange,
it seems to be working fine (I mean white-listing) here

it's pretty clear no? if we only check test_acpi_find_diff_allowed when all tables match anyway, it won't help test pass.

Quoted 21 lines
Quoted 21 lines

Let's at least make it work going forward.

---
 tests/qtest/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +1 -1
index e6096e7f73..a72f6ca326 100644
@@ -458,7 +458,7 @@ static void test_acpi_asl(test_data *data)
                 "for instructions on how to update expected files.\n",
                 exp_sdt->aml, sdt->aml_file, exp_sdt->aml_file);
 
-        all_tables_match = all_tables_match &&
+        all_tables_match = all_tables_match ||
             test_acpi_find_diff_allowed(exp_sdt);
 
         /*
#4 lore raw
Quoted 10 lines · On Mon, 31 Oct 2022 06:52:11 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 9 lines · Igor Mammedov
Quoted 6 lines · On Thu, 27 Oct 2022 11:11:48 -0400 "Michael S. Tsirkin" <[email protected]> wrote:

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Sigh.

strange,
it seems to be working fine (I mean white-listing) here

it's pretty clear no? if we only check test_acpi_find_diff_allowed when all tables match anyway, it won't help test pass.

currently all_tables_match is accumulated value that starts with 'true' and with the meaning 'do not explode unless at least a table was not explicitly whitelisted'
[...]

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- all_tables_match = all_tables_match &&

'&&' here serves as a trigger that lets flip always initial 'all_tables_match = true'

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ all_tables_match = all_tables_match ||

once it changes to '||' the all_tables_match will never flip to false
and trigger
g_assert(all_tables_match);
at the end, when there is unexpected (non-whitelisted) table mismatch.

Am I missing something?

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
             test_acpi_find_diff_allowed(exp_sdt);
 
         /*  
#5 lore raw
Quoted 15 lines · Igor Mammedov
Quoted 12 lines · On Mon, 31 Oct 2022 06:52:11 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 11 lines · Igor Mammedov
Quoted 7 lines · On Thu, 27 Oct 2022 11:11:48 -0400 "Michael S. Tsirkin" <[email protected]> wrote:

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Sigh.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

strange,
it seems to be working fine (I mean white-listing) here

it's pretty clear no? if we only check test_acpi_find_diff_allowed when all tables match anyway, it won't help test pass.

currently all_tables_match is accumulated value that starts with 'true'

Problem is, it can be false because of another unrelated table.

Quoted 10 lines

and with the meaning 'do not explode unless at least a table was not explicitly whitelisted'

[...]

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- all_tables_match = all_tables_match &&

'&&' here serves as a trigger that lets flip always initial 'all_tables_match = true'

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

+ all_tables_match = all_tables_match ||

once it changes to '||' the all_tables_match will never flip to false
and trigger
g_assert(all_tables_match);
at the end, when there is unexpected (non-whitelisted) table mismatch.

Am I missing something?

I agree this patch is bad.

I did not record the issue I saw and don't really want to go debugging. Will drop for now.

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
             test_acpi_find_diff_allowed(exp_sdt);
 
         /*  
#6 lore raw
In reply to Igor Mammedov
Quoted 30 lines · On Mon, Oct 31, 2022 at 18:01 Igor Mammedov <[email protected]> wrote:
Quoted 10 lines · On Mon, 31 Oct 2022 06:52:11 -0400 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 9 lines · Igor Mammedov
Quoted 6 lines · On Thu, 27 Oct 2022 11:11:48 -0400 "Michael S. Tsirkin" <[email protected]> wrote:

we had such a beautiful structure for updating expected files, designed to keep bisect working. It turns out that we ignored the result of the allow list checks unless all tables matched anyway.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Sigh.

strange,
it seems to be working fine (I mean white-listing) here

it's pretty clear no? if we only check test_acpi_find_diff_allowed when all tables match anyway, it won't help test pass.

currently all_tables_match is accumulated value that starts with 'true' and with the meaning 'do not explode unless at least a table was not explicitly whitelisted'
[...]

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- all_tables_match = all_tables_match &&

'&&' here serves as a trigger that lets flip always initial
'all_tables_match = true'

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

+ all_tables_match = all_tables_match ||

once it changes to '||' the all_tables_match will never flip to false
and trigger
g_assert(all_tables_match);
at the end, when there is unexpected (non-whitelisted) table mismatch.

Am I missing something?

Ah you are right. My bad I didn’t see this either.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
             test_acpi_find_diff_allowed(exp_sdt);

         /*