diff --git a/cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb b/cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb index 40f9309284..86b5686008 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb @@ -3,27 +3,22 @@ title 'Check the configuration to disable c states' only_if { !os_properties.on_docker? && os_properties.x86? } - describe file('/etc/default/grub') do - it { should exist } - its('content') { should match(/processor.max_cstate=1/) } - its('content') { should match(/intel_idle.max_cstate=1/) } - end - - if os_properties.redhat8? || os_properties.alinux2? || os_properties.centos7? || os_properties.rocky8? - - describe file('/boot/grub2/grub.cfg') do + if os_properties.ubuntu2004? + describe file('/etc/default/grub') do it { should exist } its('content') { should match(/processor.max_cstate=1/) } its('content') { should match(/intel_idle.max_cstate=1/) } end - - elsif os.debian? - describe file('/boot/grub/grub.cfg') do it { should exist } its('content') { should match(/processor.max_cstate=1/) } its('content') { should match(/intel_idle.max_cstate=1/) } end + else + describe bash('cpupower idle-info') do + its('stdout') { should match(/Number of idle states: 2/) } + its('stdout') { should match(/Available idle states: POLL C1/) } + end end end