[libvirt] 'make check' fails (qemuhotplugTest) with libvirt fakeroot build, starting with 3.1.0 release

Hello. I am not sure if this is a bug, but fakerot build of libvirt-3.1.0 reliably fails at 'make check' stage, always with the same error (qemuhotplugTest). 3.0.0 builds fine, 3.2.0 (git master dec6d9df5feeb768381dd1b010d8030b44ea1a9a) fails at the same spot. If I build as root, libvirt-3.1.0 'make check' passes without errors, and the build is successful. Is this the expected behaviour, bug in the fakeroot(1.21), or? Qemu is 2.8.0 test-suite.log -- ========================================= libvirt 3.1.0: tests/test-suite.log ========================================= # TOTAL: 114 # PASS: 113 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 FAIL: qemuhotplugtest ===================== TEST: qemuhotplugtest ........................................ 40 ...!!!...!...!.. 56 FAIL FAIL qemuhotplugtest (exit status: 1) Pedja

On 04.03.2017 15:55, Predrag Ivanovic wrote:
Hello.
I am not sure if this is a bug, but fakerot build of libvirt-3.1.0 reliably fails at 'make check' stage, always with the same error (qemuhotplugTest).
3.0.0 builds fine, 3.2.0 (git master dec6d9df5feeb768381dd1b010d8030b44ea1a9a) fails at the same spot. If I build as root, libvirt-3.1.0 'make check' passes without errors, and the build is successful. Is this the expected behaviour, bug in the fakeroot(1.21), or?
Maybe we are not mocking a function that we should.
Qemu is 2.8.0
test-suite.log -- ========================================= libvirt 3.1.0: tests/test-suite.log =========================================
# TOTAL: 114 # PASS: 113 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0
.. contents:: :depth: 2
FAIL: qemuhotplugtest =====================
TEST: qemuhotplugtest ........................................ 40 ...!!!...!...!.. 56 FAIL FAIL qemuhotplugtest (exit status: 1)
Can you try to run: libvirt.git $ cd tests/ tests $ VIR_TEST_DEBUG=2 ./qemuhotplugtest and share the output with us? Michal

On Sun, 05 Mar 2017 08:22:26 +0100 Michal Privoznik wrote:
Can you try to run:
libvirt.git $ cd tests/ tests $ VIR_TEST_DEBUG=2 ./qemuhotplugtest
and share the output with us? Sure. HEAD is cbcfd0976, ./configure and make in the top directory run without any extra options. First log is with fakeroot, second as a regular user.
VIR_TEST_DEBUG=2 fakeroot ./qemuhotplugtest TEST: qemuhotplugtest QEMU driver capabilities: <capabilities> <host> <cpu> <arch>x86_64</arch> <model>core2duo</model> <vendor>Intel</vendor> <topology sockets='1' cores='2' threads='1'/> <feature name='ds'/> <feature name='acpi'/> <feature name='ss'/> <feature name='ht'/> <feature name='tm'/> <feature name='pbe'/> <feature name='ds_cpl'/> <feature name='vmx'/> <feature name='est'/> <feature name='tm2'/> <feature name='cx16'/> <feature name='xtpr'/> <feature name='lahf_lm'/> </cpu> <power_management/> <secmodel> <model>none</model> <doi>0</doi> </secmodel> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'/> <domain type='kvm'> <emulator>/usr/bin/qemu-kvm</emulator> <machine>pc</machine> <machine>isapc</machine> </domain> </arch> <features> <cpuselection/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'/> <domain type='kvm'> <emulator>/usr/bin/kvm</emulator> <machine>pc</machine> <machine>isapc</machine> </domain> <domain type='kvm'> <emulator>/usr/bin/kvm</emulator> </domain> </arch> <features> <cpuselection/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-ppc64</emulator> <machine>pseries</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc64le'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-ppc64</emulator> <machine>pseries</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-ppc</emulator> <machine>g3beige</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='s390x'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-s390x</emulator> <machine>s390-virtio</machine> <machine>s390-ccw-virtio</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='armv7l'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-arm</emulator> <machine>vexpress-a9</machine> <machine>vexpress-a15</machine> <machine>versatilepb</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='aarch64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-aarch64</emulator> <machine>virt</machine> <domain type='qemu'/> </arch> </guest> </capabilities> 1) graphics-spice UPDATE graphics-spice-nochange ... OK 2) graphics-spice-timeout UPDATE graphics-spice-timeout-nochange ... OK 3) graphics-spice-timeout UPDATE graphics-spice-timeout-password ... OK 4) graphics-spice UPDATE graphics-spice-listen ... libvirt: QEMU Driver error : Operation not supported: cannot change listen address setting on 'spice' graphics OK 5) graphics-spice-listen-network UPDATE graphics-spice-listen-network-password ... OK 6) disk-cdrom UPDATE disk-cdrom-nochange ... device type 'disk' cannot be updated OK 7) console-compat-2-live ATTACH console-virtio ... OK 8) console-compat-2-live DETACH console-virtio ... OK 9) base-live ATTACH disk-virtio ... OK 10) base-live DETACH disk-virtio ... OK 11) base-live ATTACH disk-virtio ... OK 12) base-live DETACH disk-virtio ... OK 13) base-live DETACH disk-virtio ... OK 14) base-live ATTACH disk-usb ... OK 15) base-live DETACH disk-usb ... OK 16) base-live ATTACH disk-usb ... OK 17) base-live DETACH disk-usb ... OK 18) base-live DETACH disk-usb ... OK 19) base-live ATTACH disk-scsi ... OK 20) base-live DETACH disk-scsi ... OK 21) base-live ATTACH disk-scsi ... OK 22) base-live DETACH disk-scsi ... OK 23) base-live DETACH disk-scsi ... OK 24) base-without-scsi-controller-live ATTACH disk-scsi-2 ... OK 25) base-with-scsi-controller-live DETACH disk-scsi-2 ... OK 26) base-without-scsi-controller-live ATTACH disk-scsi-2 ... OK 27) base-with-scsi-controller-live DETACH disk-scsi-2 ... OK 28) base-with-scsi-controller-live DETACH disk-scsi-2 ... OK 29) base-live ATTACH qemu-agent ... OK 30) base-live DETACH qemu-agent-detach ... OK 31) base-ccw-live ATTACH ccw-virtio ... OK 32) base-ccw-live DETACH ccw-virtio ... OK 33) base-ccw-live-with-ccw-virtio ATTACH ccw-virtio-2 ... OK 34) base-ccw-live-with-ccw-virtio DETACH ccw-virtio-2 ... OK 35) base-ccw-live-with-ccw-virtio ATTACH ccw-virtio-2-explicit ... OK 36) base-ccw-live-with-ccw-virtio DETACH ccw-virtio-2-explicit ... OK 37) base-ccw-live-with-ccw-virtio ATTACH ccw-virtio-2-explicit ... OK 38) base-ccw-live-with-2-ccw-virtio DETACH ccw-virtio-1-explicit ... OK 39) base-ccw-live-with-2-ccw-virtio ATTACH ccw-virtio-1-reverse ... OK 40) base-live ATTACH ivshmem-plain ... OK 41) base-live ATTACH ivshmem-doorbell ... OK 42) base-live+ivshmem-plain DETACH ivshmem-doorbell-detach ... OK 43) base-live DETACH ivshmem-plain-detach ... OK 44) hotplug vcpus group x86-modern-bulk ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 45) hotplug vcpus group x86-old-bulk ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 46) hotplug vcpus group ppc64-modern-bulk ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 47) hotplug vcpus group ppc64-modern-bulk ... libvirt: QEMU Driver error : unsupported configuration: target vm vcpu granularity does not allow the desired vcpu count OK 48) hotplug vcpus group ppc64-modern-bulk ... libvirt: QEMU Driver error : unsupported configuration: target vm vcpu granularity does not allow the desired vcpu count OK 49) hotplug vcpus group ppc64-modern-bulk ... libvirt: QEMU Driver error : unsupported configuration: target vm vcpu granularity does not allow the desired vcpu count OK 50) hotplug vcpus group x86-modern-individual-add ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 51) hotplug vcpus group x86-modern-individual-add ... libvirt: QEMU Driver error : Operation not supported: only one hotpluggable entity can be selected OK 52) hotplug vcpus group x86-modern-individual-add ... libvirt: QEMU Driver error : invalid argument: vcpu '7' is already in requested state OK 53) hotplug vcpus group x86-modern-individual-add ... libvirt: QEMU Driver error : Operation not supported: this qemu version does not support specific vCPU hotplug OK 54) hotplug vcpus group ppc64-modern-individual ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 55) hotplug vcpus group ppc64-modern-individual ... libvirt: QEMU Driver error : invalid argument: vcpu '23' was not selected but it belongs to hotpluggable entity '16-23' which was partially selected OK 56) hotplug vcpus group ppc64-modern-individual ... libvirt: QEMU Driver error : invalid argument: vcpu '17' belongs to a larger hotpluggable entity, but siblings were not selected OK ---------------- VIR_TEST_DEBUG=2 ./qemuhotplugtest TEST: qemuhotplugtest QEMU driver capabilities: <capabilities> <host> <cpu> <arch>x86_64</arch> <model>core2duo</model> <vendor>Intel</vendor> <topology sockets='1' cores='2' threads='1'/> <feature name='ds'/> <feature name='acpi'/> <feature name='ss'/> <feature name='ht'/> <feature name='tm'/> <feature name='pbe'/> <feature name='ds_cpl'/> <feature name='vmx'/> <feature name='est'/> <feature name='tm2'/> <feature name='cx16'/> <feature name='xtpr'/> <feature name='lahf_lm'/> </cpu> <power_management/> <secmodel> <model>none</model> <doi>0</doi> </secmodel> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'/> <domain type='kvm'> <emulator>/usr/bin/qemu-kvm</emulator> <machine>pc</machine> <machine>isapc</machine> </domain> </arch> <features> <cpuselection/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc-0.11</machine> <machine canonical='pc-0.11'>pc</machine> <machine>pc-0.10</machine> <machine>isapc</machine> <domain type='qemu'/> <domain type='kvm'> <emulator>/usr/bin/kvm</emulator> <machine>pc</machine> <machine>isapc</machine> </domain> <domain type='kvm'> <emulator>/usr/bin/kvm</emulator> </domain> </arch> <features> <cpuselection/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-ppc64</emulator> <machine>pseries</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc64le'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-ppc64</emulator> <machine>pseries</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-ppc</emulator> <machine>g3beige</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='s390x'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-s390x</emulator> <machine>s390-virtio</machine> <machine>s390-ccw-virtio</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='armv7l'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-arm</emulator> <machine>vexpress-a9</machine> <machine>vexpress-a15</machine> <machine>versatilepb</machine> <domain type='qemu'/> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='aarch64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-aarch64</emulator> <machine>virt</machine> <domain type='qemu'/> </arch> </guest> </capabilities> 1) graphics-spice UPDATE graphics-spice-nochange ... OK 2) graphics-spice-timeout UPDATE graphics-spice-timeout-nochange ... OK 3) graphics-spice-timeout UPDATE graphics-spice-timeout-password ... OK 4) graphics-spice UPDATE graphics-spice-listen ... libvirt: QEMU Driver error : Operation not supported: cannot change listen address setting on 'spice' graphics OK 5) graphics-spice-listen-network UPDATE graphics-spice-listen-network-password ... OK 6) disk-cdrom UPDATE disk-cdrom-nochange ... device type 'disk' cannot be updated OK 7) console-compat-2-live ATTACH console-virtio ... OK 8) console-compat-2-live DETACH console-virtio ... OK 9) base-live ATTACH disk-virtio ... OK 10) base-live DETACH disk-virtio ... OK 11) base-live ATTACH disk-virtio ... OK 12) base-live DETACH disk-virtio ... OK 13) base-live DETACH disk-virtio ... OK 14) base-live ATTACH disk-usb ... OK 15) base-live DETACH disk-usb ... OK 16) base-live ATTACH disk-usb ... OK 17) base-live DETACH disk-usb ... OK 18) base-live DETACH disk-usb ... OK 19) base-live ATTACH disk-scsi ... OK 20) base-live DETACH disk-scsi ... OK 21) base-live ATTACH disk-scsi ... OK 22) base-live DETACH disk-scsi ... OK 23) base-live DETACH disk-scsi ... OK 24) base-without-scsi-controller-live ATTACH disk-scsi-2 ... OK 25) base-with-scsi-controller-live DETACH disk-scsi-2 ... OK 26) base-without-scsi-controller-live ATTACH disk-scsi-2 ... OK 27) base-with-scsi-controller-live DETACH disk-scsi-2 ... OK 28) base-with-scsi-controller-live DETACH disk-scsi-2 ... OK 29) base-live ATTACH qemu-agent ... OK 30) base-live DETACH qemu-agent-detach ... OK 31) base-ccw-live ATTACH ccw-virtio ... OK 32) base-ccw-live DETACH ccw-virtio ... OK 33) base-ccw-live-with-ccw-virtio ATTACH ccw-virtio-2 ... OK 34) base-ccw-live-with-ccw-virtio DETACH ccw-virtio-2 ... OK 35) base-ccw-live-with-ccw-virtio ATTACH ccw-virtio-2-explicit ... OK 36) base-ccw-live-with-ccw-virtio DETACH ccw-virtio-2-explicit ... OK 37) base-ccw-live-with-ccw-virtio ATTACH ccw-virtio-2-explicit ... OK 38) base-ccw-live-with-2-ccw-virtio DETACH ccw-virtio-1-explicit ... OK 39) base-ccw-live-with-2-ccw-virtio ATTACH ccw-virtio-1-reverse ... OK 40) base-live ATTACH ivshmem-plain ... OK 41) base-live ATTACH ivshmem-doorbell ... OK 42) base-live+ivshmem-plain DETACH ivshmem-doorbell-detach ... OK 43) base-live DETACH ivshmem-plain-detach ... OK 44) hotplug vcpus group x86-modern-bulk ... OK 45) hotplug vcpus group x86-old-bulk ... OK 46) hotplug vcpus group ppc64-modern-bulk ... OK 47) hotplug vcpus group ppc64-modern-bulk ... libvirt: QEMU Driver error : unsupported configuration: target vm vcpu granularity does not allow the desired vcpu count OK 48) hotplug vcpus group ppc64-modern-bulk ... libvirt: QEMU Driver error : unsupported configuration: target vm vcpu granularity does not allow the desired vcpu count OK 49) hotplug vcpus group ppc64-modern-bulk ... libvirt: QEMU Driver error : unsupported configuration: target vm vcpu granularity does not allow the desired vcpu count OK 50) hotplug vcpus group x86-modern-individual-add ... OK 51) hotplug vcpus group x86-modern-individual-add ... libvirt: QEMU Driver error : Operation not supported: only one hotpluggable entity can be selected OK 52) hotplug vcpus group x86-modern-individual-add ... libvirt: QEMU Driver error : invalid argument: vcpu '7' is already in requested state OK 53) hotplug vcpus group x86-modern-individual-add ... libvirt: QEMU Driver error : Operation not supported: this qemu version does not support specific vCPU hotplug OK 54) hotplug vcpus group ppc64-modern-individual ... OK 55) hotplug vcpus group ppc64-modern-individual ... libvirt: QEMU Driver error : invalid argument: vcpu '23' was not selected but it belongs to hotpluggable entity '16-23' which was partially selected OK 56) hotplug vcpus group ppc64-modern-individual ... libvirt: QEMU Driver error : invalid argument: vcpu '17' belongs to a larger hotpluggable entity, but siblings were not selected OK ---------------------- Pedja

On 05.03.2017 17:47, Predrag Ivanovic wrote:
On Sun, 05 Mar 2017 08:22:26 +0100 Michal Privoznik wrote:
Can you try to run:
libvirt.git $ cd tests/ tests $ VIR_TEST_DEBUG=2 ./qemuhotplugtest
and share the output with us? Sure. HEAD is cbcfd0976, ./configure and make in the top directory run without any extra options. First log is with fakeroot, second as a regular user.
VIR_TEST_DEBUG=2 fakeroot ./qemuhotplugtest TEST: qemuhotplugtest
44) hotplug vcpus group x86-modern-bulk ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 45) hotplug vcpus group x86-old-bulk ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED 46) hotplug vcpus group ppc64-modern-bulk ... libvirt: Domain Config error : cannot create config directory '/root/.cache/libvirt/qemu/run': Permission denied FAILED
This is the problem. fakeroot tells the test that it is running under root user therefore it tries to access some dirs there (which is denied because of fakeroot). Well, we shouldn't mkdir() from our test suite neither - will look into that. BTW: why do you run tests under fakeroot? why not run them under your regular user? Michal

On Mon, 06 Mar 2017 07:06:22 +0100 Michal Privoznik wrote:
This is the problem. fakeroot tells the test that it is running under root user therefore it tries to access some dirs there (which is denied because of fakeroot). Well, we shouldn't mkdir() from our test suite neither - will look into that. BTW: why do you run tests under fakeroot? why not run them under your regular user?
When I build the libvirt package (or any other package on the system), all stages (configure, make, make check, make install) run under fakeroot, for security reasons and to catch if the port is broken so it tries to do something silly :) I am OK making the exception and building libvirt as root, if that makes your life easier, though, it's not that big of the deal. Or I could just skip the 'make check' altogether, I haven't decided yet. Pedja

On 06.03.2017 12:05, Predrag Ivanovic wrote:
On Mon, 06 Mar 2017 07:06:22 +0100 Michal Privoznik wrote:
This is the problem. fakeroot tells the test that it is running under root user therefore it tries to access some dirs there (which is denied because of fakeroot). Well, we shouldn't mkdir() from our test suite neither - will look into that. BTW: why do you run tests under fakeroot? why not run them under your regular user?
When I build the libvirt package (or any other package on the system), all stages (configure, make, make check, make install) run under fakeroot, for security reasons and to catch if the port is broken so it tries to do something silly :) I am OK making the exception and building libvirt as root, if that makes your life easier, though, it's not that big of the deal. Or I could just skip the 'make check' altogether, I haven't decided yet.
Well, I understand that if you're building under root you want to use some security package (e.g. fakeroot). What I don't understand is why you are building under root in the first place. Anyway, posted a patch that should resolve your issue here: https://www.redhat.com/archives/libvir-list/2017-March/msg00176.html If you apply the patch on the top of your sources, you should be able to use fakeroot just fine again. However, I'd still not recommend building under root. Michal

On Mon, Mar 06, 2017 at 12:05:58PM +0100, Predrag Ivanovic wrote:
On Mon, 06 Mar 2017 07:06:22 +0100 Michal Privoznik wrote:
This is the problem. fakeroot tells the test that it is running under root user therefore it tries to access some dirs there (which is denied because of fakeroot). Well, we shouldn't mkdir() from our test suite neither - will look into that. BTW: why do you run tests under fakeroot? why not run them under your regular user?
When I build the libvirt package (or any other package on the system), all stages (configure, make, make check, make install) run under fakeroot, for security reasons and to catch if the port is broken so it tries to do something silly :) I am OK making the exception and building libvirt as root, if that makes your life easier, though, it's not that big of the deal. Or I could just skip the 'make check' altogether, I haven't decided yet.
You should *never* build libvirt as root, nor run tests as root. The libvirt code (and in fact any software package) should always be built as an unprivileged non-root user. The libvirt 'make check' should work as a non-privileged user too. Only the 'make install' step requires elevatd privileges, and that's only if you want to install into a privileged location like /usr or /opt. Even the install step can run unprivileged if using somewhere under $HOME as an install location. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
participants (3)
-
Daniel P. Berrange
-
Michal Privoznik
-
Predrag Ivanovic