Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions spec/configuration/cgroup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
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
it { should exist }
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 }
Expand All @@ -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
22 changes: 3 additions & 19 deletions spec/services/cgroup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading