diff --git a/spec/configuration/cgroup_spec.rb b/spec/configuration/cgroup_spec.rb index cd99b6b..ccb1fe5 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,31 +22,5 @@ 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 - -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 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