[libvirt] libvirt 1.2.9.3 - test for vircgrouptest fails

Hi, one of the seems to fail on our build system, vircgrouptest fails with Unexpected: nodeGetCPUCount() yields: -1 The test runs fine locally. Here are the contents from testsuite.log with VIR_TEST_DEBUG=1 enabled. See tests/test-suite.log Please report to libvir-list@redhat.com ============================================================================ [...] + cat test-suite.log =========================================== libvirt 1.2.9.3: tests/test-suite.log =========================================== # TOTAL: 126 # PASS: 123 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 FAIL: vircgrouptest =================== TEST: vircgrouptest 1) New cgroup for self ... OK 2) New cgroup for partition ... libvirt: Cgroup error : At least one cgroup controller is required: No such device or address OK 3) New cgroup for partition nested ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 4) New cgroup for partition nested deeply ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 5) New cgroup for domain partition ... OK 6) New cgroup for domain partition escaped ... OK 7) Cgroup available ... OK 8) virCgroupGetBlkioIoServiced works ... OK 9) virCgroupGetBlkioIoDeviceServiced works ... OK 10) virCgroupGetMemoryUsage works ... OK 11) virCgroupGetPercpuStats works ... Unexpected: nodeGetCPUCount() yields: -1 libvirt: error : this function is not supported by the connection driver: host cpu counting not supported on this node FAILED 12) New cgroup for self (allinone) ... OK 13) Cgroup available ... OK 14) New cgroup for self (logind) ... OK 15) Cgroup available ... OK FAIL vircgrouptest (exit status: 1) [...] error: Bad exit status from /home/iurt/rpmbuild/tmp/rpm-tmp.7lQ0Fz (%check) Kind regards

On 24.02.2016 21:36, Florian Hubold wrote:
Hi,
one of the seems to fail on our build system, vircgrouptest fails with Unexpected: nodeGetCPUCount() yields: -1
The test runs fine locally. Here are the contents from testsuite.log with VIR_TEST_DEBUG=1 enabled.
See tests/test-suite.log Please report to libvir-list@redhat.com ============================================================================ [...] + cat test-suite.log =========================================== libvirt 1.2.9.3: tests/test-suite.log ===========================================
# TOTAL: 126 # PASS: 123 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0
.. contents:: :depth: 2
FAIL: vircgrouptest ===================
TEST: vircgrouptest 1) New cgroup for self ... OK 2) New cgroup for partition ... libvirt: Cgroup error : At least one cgroup controller is required: No such device or address OK 3) New cgroup for partition nested ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 4) New cgroup for partition nested deeply ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 5) New cgroup for domain partition ... OK 6) New cgroup for domain partition escaped ... OK 7) Cgroup available ... OK 8) virCgroupGetBlkioIoServiced works ... OK 9) virCgroupGetBlkioIoDeviceServiced works ... OK 10) virCgroupGetMemoryUsage works ... OK 11) virCgroupGetPercpuStats works ... Unexpected: nodeGetCPUCount() yields: -1 libvirt: error : this function is not supported by the connection driver: host cpu counting not supported on this node
Interesting. This error is produced becasue there's no /sys/devices/system/cpu/cpu0 directory on your system. Therefore: 1) it's our bug that in testsuite we access real data from host's sysfs. We need a bit more mocking. 2) it's interesting that you don't have cpu0. Can you please share dir listing of /sys/devices/system/cpu? Michal

On 25.02.2016 07:25, Michal Privoznik wrote:
On 24.02.2016 21:36, Florian Hubold wrote:
Hi,
one of the seems to fail on our build system, vircgrouptest fails with Unexpected: nodeGetCPUCount() yields: -1
The test runs fine locally. Here are the contents from testsuite.log with VIR_TEST_DEBUG=1 enabled.
See tests/test-suite.log Please report to libvir-list@redhat.com ============================================================================ [...] + cat test-suite.log =========================================== libvirt 1.2.9.3: tests/test-suite.log ===========================================
# TOTAL: 126 # PASS: 123 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0
.. contents:: :depth: 2
FAIL: vircgrouptest ===================
TEST: vircgrouptest 1) New cgroup for self ... OK 2) New cgroup for partition ... libvirt: Cgroup error : At least one cgroup controller is required: No such device or address OK 3) New cgroup for partition nested ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 4) New cgroup for partition nested deeply ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 5) New cgroup for domain partition ... OK 6) New cgroup for domain partition escaped ... OK 7) Cgroup available ... OK 8) virCgroupGetBlkioIoServiced works ... OK 9) virCgroupGetBlkioIoDeviceServiced works ... OK 10) virCgroupGetMemoryUsage works ... OK 11) virCgroupGetPercpuStats works ... Unexpected: nodeGetCPUCount() yields: -1 libvirt: error : this function is not supported by the connection driver: host cpu counting not supported on this node
Interesting. This error is produced becasue there's no /sys/devices/system/cpu/cpu0 directory on your system. Therefore:
1) it's our bug that in testsuite we access real data from host's sysfs. We need a bit more mocking. 2) it's interesting that you don't have cpu0. Can you please share dir listing of /sys/devices/system/cpu?
This should be now fixed in: commit 50129dcc9cb1caa312606c86b62431c643b8f39b Author: Michal Privoznik <mprivozn@redhat.com> AuthorDate: Thu Feb 25 08:44:46 2016 +0100 Commit: Michal Privoznik <mprivozn@redhat.com> CommitDate: Thu Feb 25 11:14:29 2016 +0100 vircgroupmock: Mock access("/sys/devices/system/cpu/present") There's been a report on the upstream list [1] describing we access /sys/devices/system/cpu/present directly on the host from within our test suite. This may end up in unpredictable results as no all linux systems are required to have that file. Mock access to the file. libvirt.git/tests $ ../run strace vircgrouptest ... access("/sys/devices/system/cpu/present", F_OK) = 0 ... Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Michal

Am 25.02.2016 um 07:25 schrieb Michal Privoznik:
On 24.02.2016 21:36, Florian Hubold wrote:
Hi,
one of the seems to fail on our build system, vircgrouptest fails with Unexpected: nodeGetCPUCount() yields: -1
The test runs fine locally. Here are the contents from testsuite.log with VIR_TEST_DEBUG=1 enabled.
See tests/test-suite.log Please report to libvir-list@redhat.com ============================================================================ [...] + cat test-suite.log =========================================== libvirt 1.2.9.3: tests/test-suite.log ===========================================
# TOTAL: 126 # PASS: 123 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0
.. contents:: :depth: 2
FAIL: vircgrouptest ===================
TEST: vircgrouptest 1) New cgroup for self ... OK 2) New cgroup for partition ... libvirt: Cgroup error : At least one cgroup controller is required: No such device or address OK 3) New cgroup for partition nested ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 4) New cgroup for partition nested deeply ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 5) New cgroup for domain partition ... OK 6) New cgroup for domain partition escaped ... OK 7) Cgroup available ... OK 8) virCgroupGetBlkioIoServiced works ... OK 9) virCgroupGetBlkioIoDeviceServiced works ... OK 10) virCgroupGetMemoryUsage works ... OK 11) virCgroupGetPercpuStats works ... Unexpected: nodeGetCPUCount() yields: -1 libvirt: error : this function is not supported by the connection driver: host cpu counting not supported on this node Interesting. This error is produced becasue there's no /sys/devices/system/cpu/cpu0 directory on your system. Therefore:
1) it's our bug that in testsuite we access real data from host's sysfs. We need a bit more mocking. 2) it's interesting that you don't have cpu0. Can you please share dir listing of /sys/devices/system/cpu? That's a bit difficult as I don't have shell access, but one of our friendly sysadmins provided it, see http://paste.pound-python.org/show/W7zyZNUTtfDAn8RAwi26/
For the full build logs when the test suite failed, see http://pkgsubmit.mageia.org/uploads/failure/cauldron/core/release/2016022420... for i586 build and http://pkgsubmit.mageia.org/uploads/failure/cauldron/core/release/2016022420... for the x86_64 build.
Michal

On 25.02.2016 19:50, Florian Hubold wrote:
Am 25.02.2016 um 07:25 schrieb Michal Privoznik:
On 24.02.2016 21:36, Florian Hubold wrote:
Hi,
one of the seems to fail on our build system, vircgrouptest fails with Unexpected: nodeGetCPUCount() yields: -1
The test runs fine locally. Here are the contents from testsuite.log with VIR_TEST_DEBUG=1 enabled.
See tests/test-suite.log Please report to libvir-list@redhat.com ============================================================================ [...] + cat test-suite.log =========================================== libvirt 1.2.9.3: tests/test-suite.log ===========================================
# TOTAL: 126 # PASS: 123 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0
.. contents:: :depth: 2
FAIL: vircgrouptest ===================
TEST: vircgrouptest 1) New cgroup for self ... OK 2) New cgroup for partition ... libvirt: Cgroup error : At least one cgroup controller is required: No such device or address OK 3) New cgroup for partition nested ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 4) New cgroup for partition nested deeply ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 5) New cgroup for domain partition ... OK 6) New cgroup for domain partition escaped ... OK 7) Cgroup available ... OK 8) virCgroupGetBlkioIoServiced works ... OK 9) virCgroupGetBlkioIoDeviceServiced works ... OK 10) virCgroupGetMemoryUsage works ... OK 11) virCgroupGetPercpuStats works ... Unexpected: nodeGetCPUCount() yields: -1 libvirt: error : this function is not supported by the connection driver: host cpu counting not supported on this node Interesting. This error is produced becasue there's no /sys/devices/system/cpu/cpu0 directory on your system. Therefore:
1) it's our bug that in testsuite we access real data from host's sysfs. We need a bit more mocking. 2) it's interesting that you don't have cpu0. Can you please share dir listing of /sys/devices/system/cpu? That's a bit difficult as I don't have shell access, but one of our friendly sysadmins provided it, see http://paste.pound-python.org/show/W7zyZNUTtfDAn8RAwi26/
Wow, this is interesting. You do have /sys/devices/system/cpu/cpu0 directory. Maybe something else is preventing access (e.g. SELinux)? Or the path is not accessible because of some mounting masquerade the build script is doing? At any rate, test suite should not touch live data on host at all. This is fixed now. If you want, try building the latest HEAD and see if the test still fails. Michal

Am 26.02.2016 um 11:49 schrieb Michal Privoznik:
Am 25.02.2016 um 07:25 schrieb Michal Privoznik:
On 24.02.2016 21:36, Florian Hubold wrote:
Hi,
one of the seems to fail on our build system, vircgrouptest fails with Unexpected: nodeGetCPUCount() yields: -1
The test runs fine locally. Here are the contents from testsuite.log with VIR_TEST_DEBUG=1 enabled.
See tests/test-suite.log Please report to libvir-list@redhat.com ============================================================================ [...] + cat test-suite.log =========================================== libvirt 1.2.9.3: tests/test-suite.log ===========================================
# TOTAL: 126 # PASS: 123 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0
.. contents:: :depth: 2
FAIL: vircgrouptest ===================
TEST: vircgrouptest 1) New cgroup for self ... OK 2) New cgroup for partition ... libvirt: Cgroup error : At least one cgroup controller is required: No such device or address OK 3) New cgroup for partition nested ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 4) New cgroup for partition nested deeply ... libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory OK 5) New cgroup for domain partition ... OK 6) New cgroup for domain partition escaped ... OK 7) Cgroup available ... OK 8) virCgroupGetBlkioIoServiced works ... OK 9) virCgroupGetBlkioIoDeviceServiced works ... OK 10) virCgroupGetMemoryUsage works ... OK 11) virCgroupGetPercpuStats works ... Unexpected: nodeGetCPUCount() yields: -1 libvirt: error : this function is not supported by the connection driver: host cpu counting not supported on this node Interesting. This error is produced becasue there's no /sys/devices/system/cpu/cpu0 directory on your system. Therefore:
1) it's our bug that in testsuite we access real data from host's sysfs. We need a bit more mocking. 2) it's interesting that you don't have cpu0. Can you please share dir listing of /sys/devices/system/cpu? That's a bit difficult as I don't have shell access, but one of our friendly sysadmins provided it, see http://paste.pound-python.org/show/W7zyZNUTtfDAn8RAwi26/ Wow, this is interesting. You do have /sys/devices/system/cpu/cpu0
On 25.02.2016 19:50, Florian Hubold wrote: directory. Maybe something else is preventing access (e.g. SELinux)? Or the path is not accessible because of some mounting masquerade the build script is doing? At any rate, test suite should not touch live data on host at all. This is fixed now. If you want, try building the latest HEAD and see if the test still fails.
Michal
Well, our buildsystem uses simple chroots, so it should not differ from the physical system. FWIW the output provided above was from the physical system. We also don't use SELinux. But if it fails again at least I'll know what to look for and will try to provide the same output from inside the chroot :) Thanks for the previous fix, can I apply this also on top of v1.2.9-maint branch or does it require some subsequent commits from HEAD?

On Fri, 2016-02-26 at 18:54 +0100, Florian Hubold wrote:
Thanks for the previous fix, can I apply this also on top of v1.2.9-maint branch or does it require some subsequent commits from HEAD?
The fix is self-contained enough that you shouldn't have any problem applying it on top of the v1.2.9-maint branch. Cheers. -- Andrea Bolognani Software Engineer - Virtualization Team

On Fri, 2016-02-26 at 19:15 +0100, Andrea Bolognani wrote:
On Fri, 2016-02-26 at 18:54 +0100, Florian Hubold wrote:
Thanks for the previous fix, can I apply this also on top of v1.2.9-maint branch or does it require some subsequent commits from HEAD?
The fix is self-contained enough that you shouldn't have any problem applying it on top of the v1.2.9-maint branch.
Never mind, looks like you're going to either cherry-pick commit af1c98e40604e9d3ee6164e01df82e17b99ce562 Author: Ján Tomko <jtomko@redhat.com> Date: Thu Jan 22 11:54:50 2015 +0100 Fix virCgroupGetPercpuStats with non-continuous present CPUs Per-cpu stats are only shown for present CPUs in the cgroups, but we were only parsing the largest CPU number from /sys/devices/system/cpu/present and looking for stats even for non-present CPUs. This resulted in: internal error: cpuacct parse error as well or, for a less invasive change, add # define SYSFS_CPU_PRESENT "/sys/devices/system/cpu/present" yourself near the top of the tests/vircgroupmock.c file. Cheers. -- Andrea Bolognani Software Engineer - Virtualization Team
participants (3)
-
Andrea Bolognani
-
Florian Hubold
-
Michal Privoznik