summaryrefslogtreecommitdiff
path: root/nova/tests/functional/libvirt/base.py
diff options
context:
space:
mode:
authorJorge San Emeterio <jsanemet@redhat.com>2023-02-08 15:33:54 +0100
committerDan Smith <dansmith@redhat.com>2023-05-03 15:03:07 -0700
commit973ff4fc1a0586937d13f2b39e517422713b1003 (patch)
tree3d64f0da2ab7672efc1d8766e0bae19076e50cde /nova/tests/functional/libvirt/base.py
parenta2964417822bd1a4a83fa5c27282d2be1e18868a (diff)
downloadnova-973ff4fc1a0586937d13f2b39e517422713b1003.tar.gz
Have host look for CPU controller of cgroupsv2 location.
Make the host class look under '/sys/fs/cgroup/cgroup.controllers' for support of the cpu controller. The host will try searching through cgroupsv1 first, just like up until now, and in the case that fails, it will try cgroupsv2 then. The host will not support the feature if both checks fail. This new check needs to be mocked by all tests that focus on this piece of code, as it touches a system file that requires privileges. For such thing, the CGroupsFixture is defined to easily add suck mocking to all test cases that require so. I also removed old mocking at test_driver.py in favor of the fixture from above. Partial-Bug: #2008102 Change-Id: I99b57c27c8a4425389bec2b7f05af660bab85610
Diffstat (limited to 'nova/tests/functional/libvirt/base.py')
-rw-r--r--nova/tests/functional/libvirt/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/nova/tests/functional/libvirt/base.py b/nova/tests/functional/libvirt/base.py
index 7b6ee10631..1ee46a3217 100644
--- a/nova/tests/functional/libvirt/base.py
+++ b/nova/tests/functional/libvirt/base.py
@@ -43,6 +43,7 @@ class ServersTestBase(integrated_helpers._IntegratedTestBase):
super(ServersTestBase, self).setUp()
self.useFixture(nova_fixtures.LibvirtImageBackendFixture())
+ self.useFixture(nova_fixtures.CGroupsFixture())
self.libvirt = self.useFixture(nova_fixtures.LibvirtFixture())
self.useFixture(nova_fixtures.OSBrickFixture())