Permalink
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
  • Loading branch information...
1 parent 9fe8917 commit c3d46bcf2c330e90aff8f1bb1e1701d57078cca8 @jtimberman jtimberman committed Mar 25, 2015
View
@@ -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 @@
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'
View
@@ -37,7 +37,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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'

0 comments on commit c3d46bc

Please sign in to comment.