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