@@ -220,6 +220,39 @@ def test_changing_strategy_fails(self):
220
220
self .restart_compute_service , hostname = 'compute1' )
221
221
222
222
223
+ class PowerManagementTestsGovernorNotSupported (PowerManagementTestsBase ):
224
+ """Test suite for OS without governor support usage (same 10-core host)"""
225
+
226
+ def setUp (self ):
227
+ super (PowerManagementTestsGovernorNotSupported , self ).setUp ()
228
+
229
+ self .useFixture (nova_fixtures .SysFileSystemFixture (
230
+ cpufreq_enabled = False ))
231
+
232
+ # Definining the CPUs to be pinned.
233
+ self .flags (cpu_dedicated_set = '1-9' , cpu_shared_set = None ,
234
+ group = 'compute' )
235
+ self .flags (vcpu_pin_set = None )
236
+ self .flags (cpu_power_management = True , group = 'libvirt' )
237
+ self .flags (cpu_power_management_strategy = 'cpu_state' , group = 'libvirt' )
238
+
239
+ self .flags (allow_resize_to_same_host = True )
240
+ self .host_info = fakelibvirt .HostInfo (cpu_nodes = 1 , cpu_sockets = 1 ,
241
+ cpu_cores = 5 , cpu_threads = 2 )
242
+
243
+ def test_enabling_governor_strategy_fails (self ):
244
+ self .flags (cpu_power_management_strategy = 'governor' , group = 'libvirt' )
245
+ self .assertRaises (exception .FileNotFound , self .start_compute ,
246
+ host_info = self .host_info , hostname = 'compute1' )
247
+
248
+ def test_enabling_cpu_state_strategy_works (self ):
249
+ self .flags (cpu_power_management_strategy = 'cpu_state' , group = 'libvirt' )
250
+ self .compute1 = self .start_compute (host_info = self .host_info ,
251
+ hostname = 'compute1' )
252
+ cpu_dedicated_set = hardware .get_cpu_dedicated_set ()
253
+ self ._assert_cpu_set_state (cpu_dedicated_set , expected = 'offline' )
254
+
255
+
223
256
class PowerManagementMixedInstances (PowerManagementTestsBase ):
224
257
"""Test suite for a single host with 6 dedicated cores, 3 shared and one
225
258
OS-restricted.
0 commit comments