From 228ac1a05bacf9f07d5d9e4a873dfa32d9b90d64 Mon Sep 17 00:00:00 2001 From: Nils Date: Mon, 20 Jul 2026 15:16:15 +0100 Subject: [PATCH 1/3] update Serverspec to test native redborder.slice for cgroups v2 --- spec/services/cgroup_spec.rb | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/spec/services/cgroup_spec.rb b/spec/services/cgroup_spec.rb index e357a02..a736c05 100644 --- a/spec/services/cgroup_spec.rb +++ b/spec/services/cgroup_spec.rb @@ -3,24 +3,8 @@ require 'spec_helper' set :os, family: 'redhat', release: '9', arch: 'x86_64' -packages = %w[ - redborder-cgroups -] - -describe 'Checking redborder cgroups packages' do - packages.each do |package| - describe package(package) do - it { should be_installed } - end - end - - describe service('redborder-cgroups') do - it { should be_enabled } - end - - describe 'Configuration' do - describe file('/etc/cgroup.conf') do - it { should exist } - end +describe 'Checking redborder cgroups v2 systemd slice' do + describe file('/etc/systemd/system/redborder.slice') do + it { should exist } end end From 28d8d0f7950755c3040ebcc9972cb1cdae491dc4 Mon Sep 17 00:00:00 2001 From: Nils Date: Fri, 31 Jul 2026 15:02:07 +0100 Subject: [PATCH 2/3] fix cgroup test --- spec/configuration/cgroup_spec.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/spec/configuration/cgroup_spec.rb b/spec/configuration/cgroup_spec.rb index cd99b6b..f4a9049 100644 --- a/spec/configuration/cgroup_spec.rb +++ b/spec/configuration/cgroup_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' set :os, family: 'redhat', release: '9', arch: 'x86_64' -cgroups = command('find /sys/fs/cgroup/redborder.slice -type d -name "redborder-*" -not -name "*.service"').stdout.split +cgroups = command('find /sys/fs/cgroup/redborder.slice -type d -name "*.service"').stdout.split describe 'Check cgroups config' do describe file('/sys/fs/cgroup/redborder.slice') do @@ -11,12 +11,6 @@ end cgroups.each do |cgroup| - describe file("#{cgroup}/cgroup.controllers") do - it { should exist } - it { should be_file } - its(:content) { should match(/io/) } - end - describe file("#{cgroup}/memory.max") do it { should exist } it { should be_file } @@ -28,12 +22,6 @@ it { should be_file } its(:content) { should match(/^\d+$/) } end - - describe file("#{cgroup}/io.bfq.weight") do - it { should exist } - it { should be_file } - its(:content) { should match(/^default\s\d+$/) } - end end end From bf1d685cac3b893178cb10f6125bd0225f069f70 Mon Sep 17 00:00:00 2001 From: Nils Date: Fri, 31 Jul 2026 15:32:41 +0100 Subject: [PATCH 3/3] Fix cgroup tests to check service cgroups and remove deprecated checks --- spec/configuration/cgroup_spec.rb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/spec/configuration/cgroup_spec.rb b/spec/configuration/cgroup_spec.rb index f4a9049..ccb1fe5 100644 --- a/spec/configuration/cgroup_spec.rb +++ b/spec/configuration/cgroup_spec.rb @@ -24,23 +24,3 @@ end end end - -describe file('/usr/lib/redborder/bin/rb_check_cgroups'), :rb_check_cgroups do - it { should exist } - it { should be_file } - it { should be_executable } -end - -describe file('/usr/lib/redborder/bin/rb_check_cgroups.sh'), :rb_check_cgroups do - it { should exist } - it { should be_file } - it { should be_executable } -end - -describe file('/usr/lib/redborder/scripts/rb_check_cgroups.rb'), :rb_check_cgroups do - it { should exist } - it { should be_file } - it { should be_executable.by(:owner) } - it { should be_executable.by(:group) } - its(:content) { should match(%r{^(\s*#.*|)#!/usr/bin/env\s+ruby.*$}) } -end