All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built
@ 2026-07-24  8:54 Shivang Upadhyay
  2026-07-24  9:02 ` Thomas Huth
  2026-07-24  9:22 ` Amit Machhiwal
  0 siblings, 2 replies; 5+ messages in thread
From: Shivang Upadhyay @ 2026-07-24  8:54 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: adityag, amachhiw, harshpb, milesg, npiggin, Shivang Upadhyay

While running remote interrupts test, without libslirp-devel installed,
facing the following panic logs.

  File
    ...
    raise VMLaunchFailure(
    ...<3 lines>...
    ) from exc
    ...
        Output: qemu-system-ppc64: -netdev user,id=net0: network backend
'user' is not compiled into this binary

Skipping the test if vm fails to launch.

Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
---
 tests/functional/ppc64/test_powernv.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
index bac2017e18..73ba4e7221 100755
--- a/tests/functional/ppc64/test_powernv.py
+++ b/tests/functional/ppc64/test_powernv.py
@@ -11,6 +11,8 @@
 from qemu_test import wait_for_console_pattern
 from qemu_test import exec_command_and_wait_for_pattern
 
+from qemu.machine.machine import VMLaunchFailure
+
 class PowernvMachine(LinuxKernelTest):
 
     timeout = 90
@@ -112,7 +114,11 @@ def test_linux_remote_interrupts(self):
             f'file={rootfs_path},format=raw,if=none,id=drive0,readonly=on',
             '-append', 'root=/dev/nvme0n1 console=hvc0',
             '-device', 'nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234')
-        self.vm.launch()
+        try:
+            self.vm.launch()
+        except VMLaunchFailure:
+            # Maybe not compiled with netuser backend
+            self.skipTest(f'Could not find -net user')
 
         # Wait for boot to complete
         console_pattern = 'CPU maps initialized for 1 thread per core'
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built
  2026-07-24  8:54 [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built Shivang Upadhyay
@ 2026-07-24  9:02 ` Thomas Huth
  2026-07-24 13:30   ` Shivang Upadhyay
  2026-07-24  9:22 ` Amit Machhiwal
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2026-07-24  9:02 UTC (permalink / raw)
  To: Shivang Upadhyay, qemu-devel, qemu-ppc
  Cc: adityag, amachhiw, harshpb, milesg, npiggin

On 24/07/2026 10.54, Shivang Upadhyay wrote:
> While running remote interrupts test, without libslirp-devel installed,
> facing the following panic logs.
> 
>    File
>      ...
>      raise VMLaunchFailure(
>      ...<3 lines>...
>      ) from exc
>      ...
>          Output: qemu-system-ppc64: -netdev user,id=net0: network backend
> 'user' is not compiled into this binary
> 
> Skipping the test if vm fails to launch.
> 
> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
> ---
>   tests/functional/ppc64/test_powernv.py | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
> index bac2017e18..73ba4e7221 100755
> --- a/tests/functional/ppc64/test_powernv.py
> +++ b/tests/functional/ppc64/test_powernv.py
> @@ -11,6 +11,8 @@
>   from qemu_test import wait_for_console_pattern
>   from qemu_test import exec_command_and_wait_for_pattern
>   
> +from qemu.machine.machine import VMLaunchFailure
> +
>   class PowernvMachine(LinuxKernelTest):
>   
>       timeout = 90
> @@ -112,7 +114,11 @@ def test_linux_remote_interrupts(self):
>               f'file={rootfs_path},format=raw,if=none,id=drive0,readonly=on',
>               '-append', 'root=/dev/nvme0n1 console=hvc0',
>               '-device', 'nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234')
> -        self.vm.launch()
> +        try:
> +            self.vm.launch()
> +        except VMLaunchFailure:
> +            # Maybe not compiled with netuser backend
> +            self.skipTest(f'Could not find -net user')
>   
>           # Wait for boot to complete
>           console_pattern = 'CPU maps initialized for 1 thread per core'

Please use self.require_netdev('user') instead, like it is already done in 
other tests.

  Thanks,
    Thomas



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built
  2026-07-24  8:54 [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built Shivang Upadhyay
  2026-07-24  9:02 ` Thomas Huth
@ 2026-07-24  9:22 ` Amit Machhiwal
  2026-07-24 13:26   ` Shivang Upadhyay
  1 sibling, 1 reply; 5+ messages in thread
From: Amit Machhiwal @ 2026-07-24  9:22 UTC (permalink / raw)
  To: Shivang Upadhyay
  Cc: qemu-devel, qemu-ppc, adityag, amachhiw, harshpb, milesg, npiggin

Hi Shivang,

Thanks for the patch. Please find my comments below:

On 2026/07/24 02:24 PM, Shivang Upadhyay wrote:
> While running remote interrupts test, without libslirp-devel installed,
> facing the following panic logs.
> 
>   File
>     ...
>     raise VMLaunchFailure(
>     ...<3 lines>...
>     ) from exc
>     ...
>         Output: qemu-system-ppc64: -netdev user,id=net0: network backend
> 'user' is not compiled into this binary
> 
> Skipping the test if vm fails to launch.
> 
> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
> ---
>  tests/functional/ppc64/test_powernv.py | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
> index bac2017e18..73ba4e7221 100755
> --- a/tests/functional/ppc64/test_powernv.py
> +++ b/tests/functional/ppc64/test_powernv.py
> @@ -11,6 +11,8 @@
>  from qemu_test import wait_for_console_pattern
>  from qemu_test import exec_command_and_wait_for_pattern
>  
> +from qemu.machine.machine import VMLaunchFailure
> +
>  class PowernvMachine(LinuxKernelTest):
>  
>      timeout = 90
> @@ -112,7 +114,11 @@ def test_linux_remote_interrupts(self):
>              f'file={rootfs_path},format=raw,if=none,id=drive0,readonly=on',
>              '-append', 'root=/dev/nvme0n1 console=hvc0',
>              '-device', 'nvme,drive=drive0,bus=pcie.2,addr=0x0,serial=1234')
> -        self.vm.launch()
> +        try:
> +            self.vm.launch()
> +        except VMLaunchFailure:
> +            # Maybe not compiled with netuser backend
> +            self.skipTest(f'Could not find -net user')

I think VMLaunchFailure would be raised for any VM launch failure — not
just a missing netdev backend. This bare catch will silently skip the
test even when the VM fails for completely unrelated reasons which may
mask real regressions.

The framework already has require_netdev() which probes the binary
before launching the VM using qemu-system-ppc64 -M none -netdev help.
Catching a post-launch failure to work around a pre-launch condition is
the wrong layering entirely.

Below change should be enough to achieve what you are trying.

diff --git a/tests/functional/ppc64/test_powernv.py b/tests/functional/ppc64/test_powernv.py
index bac2017e18df..f3e05e4d3810 100755
--- a/tests/functional/ppc64/test_powernv.py
+++ b/tests/functional/ppc64/test_powernv.py
@@ -90,6 +90,7 @@ def test_linux_smt_boot(self):
 
     def test_linux_remote_interrupts(self):
         self.require_accelerator("tcg")
+        self.require_netdev('user')
         self.set_machine('powernv')
 
         # Have below setup in this test:

Thanks,
Amit

>  
>          # Wait for boot to complete
>          console_pattern = 'CPU maps initialized for 1 thread per core'
> -- 
> 2.54.0
> 
> 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built
  2026-07-24  9:22 ` Amit Machhiwal
@ 2026-07-24 13:26   ` Shivang Upadhyay
  0 siblings, 0 replies; 5+ messages in thread
From: Shivang Upadhyay @ 2026-07-24 13:26 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, adityag, harshpb, milesg, npiggin

On Fri, 2026-07-24 at 14:52 +0530, Amit Machhiwal wrote:
> 
> Below change should be enough to achieve what you are trying.
> 
> diff --git a/tests/functional/ppc64/test_powernv.py
> b/tests/functional/ppc64/test_powernv.py
> index bac2017e18df..f3e05e4d3810 100755
> --- a/tests/functional/ppc64/test_powernv.py
> +++ b/tests/functional/ppc64/test_powernv.py
> @@ -90,6 +90,7 @@ def test_linux_smt_boot(self):
>  
>      def test_linux_remote_interrupts(self):
>          self.require_accelerator("tcg")
> +        self.require_netdev('user')
>          self.set_machine('powernv')
>  

Hi Amit, 
 Thanks for proper fix, I wanted something like this. I'll try this and
send a revision.

~Shivang.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built
  2026-07-24  9:02 ` Thomas Huth
@ 2026-07-24 13:30   ` Shivang Upadhyay
  0 siblings, 0 replies; 5+ messages in thread
From: Shivang Upadhyay @ 2026-07-24 13:30 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, qemu-ppc
  Cc: adityag, amachhiw, harshpb, milesg, npiggin

On Fri, 2026-07-24 at 11:02 +0200, Thomas Huth wrote:
> >            # Wait for boot to complete
> >            console_pattern = 'CPU maps initialized for 1 thread per
> > core'
> 
> Please use self.require_netdev('user') instead, like it is already
> done in 
> other tests.
> 
>   Thanks,
>     Thomas


Thanks Thomas, I didn't see this case. I saw some other tests using
VMLaunchFailure this way, so went ahead like this. I'll send a
revision.

~Shivang.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-24 13:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24  8:54 [PATCH] tests/functional/ppc: skip remote interrupts test if -net user not built Shivang Upadhyay
2026-07-24  9:02 ` Thomas Huth
2026-07-24 13:30   ` Shivang Upadhyay
2026-07-24  9:22 ` Amit Machhiwal
2026-07-24 13:26   ` Shivang Upadhyay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.