commit aa295b4ad71b59ba9ba612f07f1f108a8a25473b
Author: Jorge San Emeterio <email address hidden>
Date: Wed Feb 8 15:33:54 2023 +0100
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.
NOTE(auniyal):
- as new cgroup fixture is added, removed old mocking in few more unit test cases in test_driver
- did not remove test_guest_cpu_shares_with_multi_vcpu from test_driver
Partial-Bug: #2008102
Change-Id: I99b57c27c8a4425389bec2b7f05af660bab85610
(cherry picked from commit 973ff4fc1a0586937d13f2b39e517422713b1003)
(cherry picked from commit eb3fe4ddc621380afa32ec9aec0c285f36f99ee3)
(cherry picked from commit 9e86be5a5365b1896d489de7149e471fd22881d6)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /882920 /opendev. org/openstack/ nova/commit/ aa295b4ad71b59b a9ba612f07f1f10 8a8a25473b
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/yoga
commit aa295b4ad71b59b a9ba612f07f1f10 8a8a25473b
Author: Jorge San Emeterio <email address hidden>
Date: Wed Feb 8 15:33:54 2023 +0100
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.
Conflicts:
nova/tests/ unit/virt/ libvirt/ test_driver. py
NOTE(auniyal): cpu_shares_ with_multi_ vcpu from test_driver
- as new cgroup fixture is added, removed old mocking in few more unit test cases in test_driver
- did not remove test_guest_
Partial-Bug: #2008102 5389bec2b7f05af 660bab85610 37d13f2b39e5174 22713b1003) afa32ec9aec0c28 5f36f99ee3) 96d489de7149e47 1fd22881d6)
Change-Id: I99b57c27c8a442
(cherry picked from commit 973ff4fc1a05869
(cherry picked from commit eb3fe4ddc621380
(cherry picked from commit 9e86be5a5365b18