diff mbox series

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

Message ID 20200129212345.20547-18-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/acceptance/virtio_seg_max_adjust: Restrict it to Linux/X86 | expand

Commit Message

Philippe Mathieu-Daudé Jan. 29, 2020, 9:23 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/virtio_check_params.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Eduardo Habkost Feb. 6, 2020, 7:54 p.m. UTC | #1
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>
Philippe Mathieu-Daudé Feb. 6, 2020, 8:36 p.m. UTC | #2
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.
diff mbox series

Patch

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))