autotest / tp-libvirt

Test Provider for Libvirt and related virtualization backends
Other
33 stars 168 forks source link

UnboundLocalError: local variable 'res' referenced before assignment #5884

Open qiankehan opened 1 week ago

qiankehan commented 1 week ago

Version: 4abb80df Failed cases:

svirt.selinux.seclabel.per_device.relabel_no.serial.cold_plug
svirt.selinux.seclabel.per_device.relabel_yes.without_label.serial.cold_plug
svirt.selinux.seclabel.per_device.relabel_yes.label_legit.serial.cold_plug
svirt.selinux.seclabel.per_device.relabel_yes.label_MCS.serial.cold_plug
svirt.selinux.seclabel.per_device.relabel_yes.label_default.serial.cold_plug
svirt.selinux.seclabel.per_device.relabel_yes.label_invalid_fmt.serial.cold_plug

Errors:

04:20:10 ERROR| Traceback (most recent call last):

04:20:10 ERROR|   File "/var/ci/libvirt-ci/runtest/avocado-vt/avocado/avocado/core/test.py", line 881, in _run_avocado
    raise test_exception

04:20:10 ERROR|   File "/var/ci/libvirt-ci/runtest/avocado-vt/avocado/avocado/core/test.py", line 788, in _run_avocado
    testMethod()

04:20:10 ERROR|   File "/var/ci/libvirt-ci/runtest/avocado-vt/avocado-vt/avocado_vt/test.py", line 208, in runTest
    raise self.__status  # pylint: disable=E0702

04:20:10 ERROR|   File "/var/ci/libvirt-ci/runtest/avocado-vt/avocado-vt/avocado_vt/test.py", line 146, in setUp
    self._runTest()

04:20:10 ERROR|   File "/var/ci/libvirt-ci/runtest/avocado-vt/avocado-vt/avocado_vt/test.py", line 280, in _runTest
    run_func(self, params, env)

04:20:10 ERROR|   File "/var/lib/avocado/data/avocado-vt/virttest/test-providers.d/downloads/io-github-autotest-libvirt/libvirt/tests/src/svirt/selinux/selinux_seclabel_per_device.py", line 92, in run
    if res.exit_status == 0:

04:20:10 ERROR| UnboundLocalError: local variable 'res' referenced before assignment

04:20:10 ERROR| ERROR 1-type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_default.serial.cold_plug -> UnboundLocalError: local variable 'res' referenced before assignment

It seems caused by ee3c70fcba. After reverting it, the most of the failed cases could pass:

# for i in $(cat svirt-cases);do avocado run --vt-type libvirt --vt-machine-type q35 $i;done                                                    
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                            
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                                               
JOB ID     : 44c630bce94932a053f7b10a3f88143eca81cb60                                                                                                                                                      
JOB LOG    : /var/log/avocado/job-results/job-2024-09-08T23.19-44c630b/job.log                                                                                                                             
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_no.serial.cold_plug: STARTED                                                   
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_no.serial.cold_plug: PASS (7.80 s)           
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                      
JOB HTML   : /var/log/avocado/job-results/job-2024-09-08T23.19-44c630b/results.html                                                                                                                        
JOB TIME   : 9.72 s                                                                                                                                                      
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                            
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.      
JOB ID     : f916f9eecc3d7a132286bf9df1ffd786b65c250d                                                                                                                                                      
JOB LOG    : /var/log/avocado/job-results/job-2024-09-08T23.20-f916f9e/job.log                                                                                                                             
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.without_label.serial.cold_plug: STARTED                                    
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.without_label.serial.cold_plug: FAIL: Run '/bin/virsh start avocado-vt-vm1 ' expect fail, but run successfully. (8.03 s)
RESULTS    : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                      
JOB HTML   : /var/log/avocado/job-results/job-2024-09-08T23.20-f916f9e/results.html                                                    
JOB TIME   : 10.01 s                                                                                                                                                                                       
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                            
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                                               
JOB ID     : 80f3292e6316c2f9ee13fc258cdfa063ff5838ea                                                                                                                    
JOB LOG    : /var/log/avocado/job-results/job-2024-09-08T23.20-80f3292/job.log                                                                                           
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_legit.serial.cold_plug: STARTED                                                                        
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_legit.serial.cold_plug: PASS (16.68 s)                               
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                                                        
JOB HTML   : /var/log/avocado/job-results/job-2024-09-08T23.20-80f3292/results.html                                                                                      
JOB TIME   : 18.57 s                                                                                                                                                     
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                     
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                        
JOB ID     : 5f57ccfb1007d1adbce101ae88a3130a93eb5ce5                                                                                                                                                      
JOB LOG    : /var/log/avocado/job-results/job-2024-09-08T23.20-5f57ccf/job.log                                                                                                                             
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_MCS.serial.cold_plug: STARTED                                                                          
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_MCS.serial.cold_plug: PASS (16.63 s)                                                                   
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                                                                                          
JOB HTML   : /var/log/avocado/job-results/job-2024-09-08T23.20-5f57ccf/results.html                                                                                                                                               
JOB TIME   : 18.52 s                                    
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                            
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                                               
JOB ID     : ec8aff6829dd5eebc3a6272516753f0b651334d8                                                            
JOB LOG    : /var/log/avocado/job-results/job-2024-09-08T23.21-ec8aff6/job.log                                                                                                                                                    
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_default.serial.cold_plug: STARTED                                                                                             
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_default.serial.cold_plug: PASS (16.55 s)                                                                                      
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                                                                                                                 
JOB HTML   : /var/log/avocado/job-results/job-2024-09-08T23.21-ec8aff6/results.html                                                                                                                                               
JOB TIME   : 18.45 s                                                    
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                                                                                            
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.                                                                                                                               
JOB ID     : 45d026d76a38deafe3427301bea60ddeef46f2bc                   
JOB LOG    : /var/log/avocado/job-results/job-2024-09-08T23.21-45d026d/job.log                                                                   
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_invalid_fmt.serial.cold_plug: STARTED                                                                                                                                                         
 (1/1) type_specific.io-github-autotest-libvirt.svirt.selinux.seclabel.per_device.relabel_yes.label_invalid_fmt.serial.cold_plug: PASS (7.06 s)                                                                                                                                                   
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                                
JOB HTML   : /var/log/avocado/job-results/job-2024-09-08T23.21-45d026d/results.html                                                              
JOB TIME   : 8.94 s