[PATCH v2 17/29] tests/acceptance/virtio_check_params: Improve exception logging

Philippe Mathieu-Daudé posted 29 patches 6 years ago
Only 28 patches received!
[PATCH v2 17/29] tests/acceptance/virtio_check_params: Improve exception logging
Posted by Philippe Mathieu-Daudé 6 years ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/virtio_check_params.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/acceptance/virtio_check_params.py b/tests/acceptance/virtio_check_params.py
index 4a417b8ef5..51a2dd76e8 100755
--- a/tests/acceptance/virtio_check_params.py
+++ b/tests/acceptance/virtio_check_params.py
@@ -77,8 +77,12 @@ class VirtioMaxSegSettingsCheck(Test):
             vm.set_machine(mt["name"])
             for s in VM_DEV_PARAMS[dev_type_name]:
                 vm.add_args(s)
-            vm.launch()
-            query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
+            try:
+                vm.launch()
+                query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
+            except:
+                query_ok = False
+                error = sys.exc_info()[0]
 
         if not query_ok:
             self.fail('machine type {0}: {1}'.format(mt['name'], error))
-- 
2.21.1


Re: [PATCH v2 17/29] tests/acceptance/virtio_check_params: Improve exception logging
Posted by Eduardo Habkost 6 years ago
On Wed, Jan 29, 2020 at 10:23:33PM +0100, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/virtio_check_params.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/acceptance/virtio_check_params.py b/tests/acceptance/virtio_check_params.py
> index 4a417b8ef5..51a2dd76e8 100755
> --- a/tests/acceptance/virtio_check_params.py
> +++ b/tests/acceptance/virtio_check_params.py
> @@ -77,8 +77,12 @@ class VirtioMaxSegSettingsCheck(Test):
>              vm.set_machine(mt["name"])
>              for s in VM_DEV_PARAMS[dev_type_name]:
>                  vm.add_args(s)
> -            vm.launch()
> -            query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
> +            try:
> +                vm.launch()
> +                query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
> +            except:
> +                query_ok = False
> +                error = sys.exc_info()[0]

I would prefer to do this inside query_virtqueue(), but:

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

-- 
Eduardo


Re: [PATCH v2 17/29] tests/acceptance/virtio_check_params: Improve exception logging
Posted by Philippe Mathieu-Daudé 6 years ago
On 2/6/20 8:54 PM, Eduardo Habkost wrote:
> On Wed, Jan 29, 2020 at 10:23:33PM +0100, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>   tests/acceptance/virtio_check_params.py | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/acceptance/virtio_check_params.py b/tests/acceptance/virtio_check_params.py
>> index 4a417b8ef5..51a2dd76e8 100755
>> --- a/tests/acceptance/virtio_check_params.py
>> +++ b/tests/acceptance/virtio_check_params.py
>> @@ -77,8 +77,12 @@ class VirtioMaxSegSettingsCheck(Test):
>>               vm.set_machine(mt["name"])
>>               for s in VM_DEV_PARAMS[dev_type_name]:
>>                   vm.add_args(s)
>> -            vm.launch()
>> -            query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
>> +            try:
>> +                vm.launch()
>> +                query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
>> +            except:
>> +                query_ok = False
>> +                error = sys.exc_info()[0]
> 
> I would prefer to do this inside query_virtqueue(), but:

The problem is in vm.launch():

DEBUG| Output: "xencall: error: Could not obtain handle on privileged 
command interface: No such file or directory\nxen be core: xen be core: 
can't open xen interface\ncan't open xen interface\nqemu-system-x86_64: 
failed to initialize xen: Operation not permitted\n"

> 
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> 

Thanks, I'll keep this patch queued.

Phil.