Commit c3d46bcf authored by jtimberman's avatar jtimberman
Browse files

Add support for Fedora 21, kitchen updates

This commit mainly adds support for Fedora 21, which now has packages in
imeyer's Package Cloud repository.

- Update centos base boxes to latest releases
- Add ubuntu 14.04
- Add fedora to 'rhel' conditionals where applicable
- Register the 'runit_service' resource with MiniTest::Chef so it can be
  asserted using the runit state instead of underlying system service
  state checking because that generally will attempt to use the "lsb
  init interface," which doesn't work with systemd
parent 9fe89176
......@@ -5,11 +5,12 @@ provisioner:
name: chef_zero
platforms:
- name: centos-5.10
- name: centos-6.5
- name: fedora-19
- name: centos-5.11
- name: centos-6.6
- name: fedora-21
- name: ubuntu-10.04
- name: ubuntu-12.04
- name: ubuntu-14.04
suites:
- name: default
......
......@@ -36,7 +36,7 @@ when 'debian'
default['runit']['reload'] = 'reload runsvdir'
end
when 'rhel'
when 'rhel', 'fedora'
default['runit']['sv_bin'] = '/sbin/sv'
default['runit']['chpst_bin'] = '/sbin/chpst'
default['runit']['service_dir'] = '/etc/service'
......
......@@ -37,7 +37,7 @@ execute 'runit-hup-init' do
end
case node['platform_family']
when 'rhel'
when 'rhel', 'fedora'
packagecloud_repo 'imeyer/runit' unless node['runit']['prefer_local_yum']
package 'runit'
......
......@@ -21,9 +21,10 @@ require File.expand_path('../support/helpers', __FILE__)
describe 'runit_test::service' do
include Helpers::RunitTest
MiniTest::Chef::Resources.register_resource(:runit_service)
it 'creates a service with the defaults' do
service('plain-defaults').must_be_running
runit_service('plain-defaults').must_be_running
file('/etc/service/plain-defaults/run').must_exist
file('/etc/service/plain-defaults/log/run').must_exist
file('/etc/init.d/plain-defaults').must_exist
......@@ -34,53 +35,53 @@ describe 'runit_test::service' do
end
it 'creates a service that doesnt use the svlog' do
service('no-svlog').must_be_running
runit_service('no-svlog').must_be_running
directory('/etc/sv/no-svlog/log').wont_exist
end
it 'creates a service that uses the default svlog' do
regexp = %r{#!/bin/sh\nexec svlogd -tt /var/log/default-svlog}
service('default-svlog').must_be_running
runit_service('default-svlog').must_be_running
file('/etc/service/default-svlog/log/run').must_match(regexp)
end
it 'creates a service that has a check script' do
service('checker').must_be_running
runit_service('checker').must_be_running
file('/etc/service/checker/check').must_exist
end
it 'creates a service that has a finish script' do
service('finisher').must_be_running
runit_service('finisher').must_be_running
file('/etc/service/finisher/finish').must_exist
end
it 'creates a service using sv_timeout' do
service('timer').must_be_running
runit_service('timer').must_be_running
end
it 'creates a service using sv_verbose' do
service('chatterbox').must_be_running
runit_service('chatterbox').must_be_running
end
it 'creates a service that uses env files' do
regexp = %r{\$PATH:/opt/chef/embedded/bin}
service('env-files').must_be_running
runit_service('env-files').must_be_running
file('/etc/service/env-files/env/PATH').must_match(regexp)
end
it 'creates a service that sets options for the templates' do
service('template-options').must_be_running
runit_service('template-options').must_be_running
file('/etc/service/template-options/run').must_match('# Options are delicious')
end
it 'creates a service that uses control signal files' do
service('control-signals').must_be_running
runit_service('control-signals').must_be_running
file('/etc/service/control-signals/control/u').must_match(/control signal up/)
end
it 'creates a runsvdir service for a normal user' do
regexp = %r{exec chpst -ufloyd runsvdir /home/floyd/service}
service('runsvdir-floyd').must_be_running
runit_service('runsvdir-floyd').must_be_running
file('/etc/service/runsvdir-floyd/run').must_match(regexp)
end
......@@ -101,11 +102,11 @@ describe 'runit_test::service' do
end
it 'creates a service with differently named template files' do
service('yerba').must_be_running
runit_service('yerba').must_be_running
end
it 'creates a service with differently named run script template' do
service('yerba-alt').must_be_running
runit_service('yerba-alt').must_be_running
end
it 'creates a service that should exist but be disabled' do
......@@ -114,11 +115,11 @@ describe 'runit_test::service' do
end
it 'can use templates from another cookbook' do
service('other-cookbook-templates').must_be_running
runit_service('other-cookbook-templates').must_be_running
end
it 'creates a service that has its own run scripts' do
skip 'RHEL platforms dont ship runit scripts' if node['platform_family'] == 'rhel'
skip 'RHEL platforms dont ship runit scripts' if node['platform_family'] == 'rhel' || node['platform_family'] == 'fedora'
git_daemon = shell_out("#{node['runit']['sv_bin']} status /etc/service/git-daemon")
assert git_daemon.stdout.include?('run:')
......
......@@ -141,7 +141,7 @@ runit_service 'other-cookbook-templates' do
cookbook 'runit-other_test'
end
unless platform_family?('rhel')
unless platform_family?('rhel', 'fedora')
# Create a service that has a package with its own service directory
package 'git-daemon-run'
......
Markdown is supported
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