[PATCH] tests: viracpitest only works on little endian

Boris Fiuczynski posted 1 patch 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20230418095308.512087-1-fiuczy@linux.ibm.com
tests/meson.build | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
[PATCH] tests: viracpitest only works on little endian
Posted by Boris Fiuczynski 1 year, 7 months ago
Commit fc216db4fb789cbd309 introduced a mocked test with binary test data
which fails on big endian machines.
Therefore build the viracpitest test only on little endian machines.

Fixes: fc216db4fb789cbd30917be036d0b94d965bdf7f

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
---
 tests/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/meson.build b/tests/meson.build
index 35adbc2d56..0082446029 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -269,7 +269,6 @@ tests += [
   { 'name': 'storagevolxml2xmltest' },
   { 'name': 'sysinfotest' },
   { 'name': 'utiltest' },
-  { 'name': 'viracpitest' },
   { 'name': 'viralloctest' },
   { 'name': 'virauthconfigtest' },
   { 'name': 'virbitmaptest' },
@@ -308,6 +307,12 @@ tests += [
   { 'name': 'virmigtest' },
 ]
 
+if host_machine.endian() == 'little'
+  tests += [
+    { 'name': 'viracpitest' },
+  ]
+endif
+
 if host_machine.system() == 'linux'
   tests += [
     { 'name': 'fchosttest' },
-- 
2.39.0
Re: [PATCH] tests: viracpitest only works on little endian
Posted by Michal Prívozník 1 year, 7 months ago
On 4/18/23 11:53, Boris Fiuczynski wrote:
> Commit fc216db4fb789cbd309 introduced a mocked test with binary test data
> which fails on big endian machines.
> Therefore build the viracpitest test only on little endian machines.
> 
> Fixes: fc216db4fb789cbd30917be036d0b94d965bdf7f
> 
> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
> ---
>  tests/meson.build | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/meson.build b/tests/meson.build
> index 35adbc2d56..0082446029 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -269,7 +269,6 @@ tests += [
>    { 'name': 'storagevolxml2xmltest' },
>    { 'name': 'sysinfotest' },
>    { 'name': 'utiltest' },
> -  { 'name': 'viracpitest' },
>    { 'name': 'viralloctest' },
>    { 'name': 'virauthconfigtest' },
>    { 'name': 'virbitmaptest' },
> @@ -308,6 +307,12 @@ tests += [
>    { 'name': 'virmigtest' },
>  ]
>  
> +if host_machine.endian() == 'little'
> +  tests += [
> +    { 'name': 'viracpitest' },
> +  ]
> +endif
> +
>  if host_machine.system() == 'linux'
>    tests += [
>      { 'name': 'fchosttest' },

Yeah, this test can work only on little endian arches, because of the
input data. I'm just wondering whether this is actual bug in the
viracpi.c. I mean, this whole code aims on parsing IORT table, which is
ARM specific and ARM is bi-endian. But I don't think I've ever seen ARM
run in BE mode.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

and merged.

Michal
Re: [PATCH] tests: viracpitest only works on little endian
Posted by Marc Hartmayer 1 year, 7 months ago
Boris Fiuczynski <fiuczy@linux.ibm.com> writes:

> Commit fc216db4fb789cbd309 introduced a mocked test with binary test data
> which fails on big endian machines.
> Therefore build the viracpitest test only on little endian machines.
>
> Fixes: fc216db4fb789cbd30917be036d0b94d965bdf7f
>
> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
> ---
>  tests/meson.build | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/meson.build b/tests/meson.build
> index 35adbc2d56..0082446029 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -269,7 +269,6 @@ tests += [
>    { 'name': 'storagevolxml2xmltest' },
>    { 'name': 'sysinfotest' },
>    { 'name': 'utiltest' },
> -  { 'name': 'viracpitest' },
>    { 'name': 'viralloctest' },
>    { 'name': 'virauthconfigtest' },
>    { 'name': 'virbitmaptest' },
> @@ -308,6 +307,12 @@ tests += [
>    { 'name': 'virmigtest' },
>  ]
>  
> +if host_machine.endian() == 'little'
> +  tests += [
> +    { 'name': 'viracpitest' },
> +  ]
> +endif
> +
>  if host_machine.system() == 'linux'
>    tests += [
>      { 'name': 'fchosttest' },
> -- 
> 2.39.0

LGTM.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>