File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
cookbooks/aws-parallelcluster-slurm/test/controls Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 4646 end
4747
4848 describe 'check cgroup memory resource controller is enabled' do
49- subject { bash ( "sleep 5 && grep memory /proc/cgroups | awk '{print $4}'" ) }
50- its ( 'exit_status' ) { should eq 0 }
51- its ( 'stdout.strip' ) { should cmp 1 }
49+ # Check if we're using cgroups v2
50+ cgroup_v2 = bash ( 'test -f /sys/fs/cgroup/cgroup.controllers' ) . exit_status == 0
51+
52+ if cgroup_v2
53+ # For cgroups v2, check if memory controller is in available controllers
54+ describe bash ( 'cat /sys/fs/cgroup/cgroup.controllers' ) do
55+ its ( 'stdout' ) { should include 'memory' }
56+ its ( 'exit_status' ) { should eq 0 }
57+ end
58+ else
59+ # Original check for cgroups v1
60+ describe bash ( "grep memory /proc/cgroups | awk '{print $4}'" ) do
61+ its ( 'stdout.strip' ) { should cmp '1' }
62+ its ( 'exit_status' ) { should eq 0 }
63+ end
64+ end
5265 end
5366end
You can’t perform that action at this time.
0 commit comments