Commit 9fd21a83 authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Add test suite for systemd recipe

parent 825304d4
......@@ -337,6 +337,9 @@ suites:
unit:
unknown_method:
whatever: "Should throw an error but converge"
journald:
Storage: volatile
RuntimeMaxUse: 128M
- name: sys_time
run_list:
- recipe[sys::time]
......
source 'http://rubygems.org'
group :jessie do
# net-ssh >= 5 requires ruby 2.2 and
# net-telnet >= 0.2 requires ruby 2.3
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.2.0')
gem 'net-ssh', '< 5'
gem 'net-telnet', '< 0.2'
end
end
# Cookbook Name:: sys
# Integration tests for recipe sys::systemd systemd unit config
#
# Copyright 2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
#
# Authors:
# Christopher Huhn <c.huhn@gsi.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'spec_helper'
describe file '/etc/systemd/journald.conf' do
it { should exist }
its(:content) { should contain '# This file is managed by chef' }
its(:content) { should match /^Storage=volatile$/ }
end
describe service 'systemd-journald' do
it { should be_running }
end
# Cookbook Name:: sys
# Integration tests for recipe sys::systemd systemd unit config
#
# Copyright 2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
#
# Authors:
# Christopher Huhn <c.huhn@gsi.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'spec_helper'
describe file('/etc/systemd/system/unknown_method.service') do
it { should exist }
its(:content) { should contain '# This file is managed by chef' }
end
require 'serverspec'
set :backend, :exec
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment