qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/6] tests/acceptance/virtio_seg_max_adjust: Only remove list


From: Cornelia Huck
Subject: Re: [PATCH 1/6] tests/acceptance/virtio_seg_max_adjust: Only remove listed machines
Date: Thu, 23 Jan 2020 12:20:18 +0100

On Wed, 22 Jan 2020 23:32:42 +0100
Philippe Mathieu-Daudé <address@hidden> wrote:

> Do not remove unavailable machines, this fixes:
> 
>   VirtioMaxSegSettingsCheck.test_machine_types: ERROR: list.remove(x): x not 
> in list (0.12 s)
> 
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  tests/acceptance/virtio_seg_max_adjust.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/acceptance/virtio_seg_max_adjust.py 
> b/tests/acceptance/virtio_seg_max_adjust.py
> index 5458573138..4a417b8ef5 100755
> --- a/tests/acceptance/virtio_seg_max_adjust.py
> +++ b/tests/acceptance/virtio_seg_max_adjust.py
> @@ -109,14 +109,15 @@ class VirtioMaxSegSettingsCheck(Test):
>          return False
>  
>      def test_machine_types(self):
> -        # collect all machine types except 'none', 'isapc', 'microvm'
> +        EXCLUDED_MACHINES = ['none', 'isapc', 'microvm']

That one seems more flexible as well.

> +        # collect all machine types except the ones in EXCLUDED_MACHINES
>          with QEMUMachine(self.qemu_bin) as vm:
>              vm.launch()
>              machines = [m['name'] for m in vm.command('query-machines')]
>              vm.shutdown()
> -        machines.remove('none')
> -        machines.remove('isapc')
> -        machines.remove('microvm')
> +        for m in EXCLUDED_MACHINES:
> +            if m in machines:
> +                machines.remove(m)
>  
>          for dev_type in DEV_TYPES:
>              # create the list of machine types and their parameters.

Reviewed-by: Cornelia Huck <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]