avocado-vt icon indicating copy to clipboard operation
avocado-vt copied to clipboard

Fixup: improper split lines of lscpu output

Open sathnaga opened this issue 5 years ago • 6 comments

Have encountered below error in recent distribution runs,

|     cpu_info = dict(map(lambda x: [i.strip() for i in x.split(":")], output))
| ValueError: dictionary update sequence element #21 has length 1; 2 is required

This is due to lscpu displaying lines with more characters (for vulnerbilities details etc,) portion of line might be placed in next line becasue aexpect shell terminal length, so the splitlines() spliting them, resulting in a line without : so the failure.

So, lets split with \n instead.

Signed-off-by: Satheesh Rajendran [email protected]

sathnaga avatar Feb 19 '20 10:02 sathnaga

Result after fix:

 (01/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_2_threads.id_option.option_enable_live: PASS (94.05 s)
 (02/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_2_threads.id_option.option_disable_live: PASS (89.72 s)
 (03/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_2_threads.name_option: PASS (92.78 s)
 (04/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_2_threads.uuid_option: PASS (92.78 s)
 (05/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_4_threads.id_option.option_enable_live: PASS (94.19 s)
 (06/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_4_threads.id_option.option_disable_live: PASS (92.31 s)
 (07/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_4_threads.name_option: PASS (93.40 s)
 (08/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_4_threads.uuid_option: PASS (91.52 s)
 (09/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_8_threads.id_option.option_enable_live: PASS (93.49 s)
 (10/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_8_threads.id_option.option_disable_live: PASS (97.64 s)
 (11/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_8_threads.name_option: PASS (97.18 s)
 (12/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_comma.with_8_threads.uuid_option: PASS (91.59 s)
 (13/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_hypen.with_2_threads.id_option.option_enable_live: PASS (92.78 s)
 (14/55) qemu.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.virsh.setvcpu.normal_test.guest_on.with_hypen.with_2_threads.id_option.option_disable_live: PASS (94.14 s)

sathnaga avatar Feb 19 '20 10:02 sathnaga

Finding this not working in some case, do not merge.

sathnaga avatar Feb 26 '20 10:02 sathnaga

Tested and working fine,

 (1/1) qemu.hugepages.qcow2.virtio_scsi.smp2.virtio_net.Guest.Ubuntu.20.04.ppc64le.powerkvm-libvirt.libvirt_vcpu_plug_unplug.positive_test.vcpu_set.live.with_maxvcpu:  PASS (457.04 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 458.88 s

sathnaga avatar Feb 26 '20 11:02 sathnaga

Am seeing this failure is multiple places which is using latest guest kernel,

2020-07-06 09:31:22,256 stacktrace       L0045 ERROR| Traceback (most recent call last):
2020-07-06 09:31:22,256 stacktrace       L0045 ERROR|   File "/home/smfci/tests/data/avocado-vt/test-providers.d/downloads/io-github-autotest-libvirt/libvirt/tests/src/libvirt_vcpu_plug_unplug.py", line 372, in run
2020-07-06 09:31:22,256 stacktrace       L0045 ERROR|     if not cpu.check_vcpu_value(vm, expect_vcpu_num, expect_vcpupin, setvcpu_option):
2020-07-06 09:31:22,256 stacktrace       L0045 ERROR|   File "/usr/local/lib/python3.7/site-packages/avocado_framework_plugin_vt-80.0-py3.7.egg/virttest/cpu.py", line 525, in check_vcpu_value
2020-07-06 09:31:22,256 stacktrace       L0045 ERROR|     if not guest_numa_check(vm, exp_vcpu):
2020-07-06 09:31:22,256 stacktrace       L0045 ERROR|   File "/usr/local/lib/python3.7/site-packages/avocado_framework_plugin_vt-80.0-py3.7.egg/virttest/cpu.py", line 562, in guest_numa_check
2020-07-06 09:31:22,256 stacktrace       L0045 ERROR|     vm_cpu_info = get_cpu_info(session)
2020-07-06 09:31:22,257 stacktrace       L0045 ERROR|   File "/usr/local/lib/python3.7/site-packages/avocado_framework_plugin_vt-80.0-py3.7.egg/virttest/cpu.py", line 687, in get_cpu_info
2020-07-06 09:31:22,257 stacktrace       L0045 ERROR|     cpu_info = dict(map(lambda x: [i.strip() for i in x.split(":")], output))
2020-07-06 09:31:22,257 stacktrace       L0045 ERROR| ValueError: dictionary update sequence element #21 has length 1; 2 is required

it would be helpful, it we get this merged. tnx!

sathnaga avatar Jul 06 '20 13:07 sathnaga

@luckyh ping

sathnaga avatar Jul 30 '20 13:07 sathnaga

@luckyh @chunfuwen good candidate for LTS.

sathnaga avatar Sep 11 '20 08:09 sathnaga