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 86b5686008..e560019afd 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb @@ -3,16 +3,13 @@ title 'Check the configuration to disable c states' only_if { !os_properties.on_docker? && os_properties.x86? } - 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 - 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/) } + if os_properties.ubuntu? + %w(/etc/default/grub /boot/grub/grub.cfg).each do |file_path| + describe file(file_path) do + it { should exist } + its('content') { should match(/processor.max_cstate=1/) } + its('content') { should match(/intel_idle.max_cstate=1/) } + end end else describe bash('cpupower idle-info') do