Skip to content

Commit c3d46bc

Browse files
author
jtimberman
committed
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
1 parent 9fe8917 commit c3d46bc

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

.kitchen.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ provisioner:
55
name: chef_zero
66

77
platforms:
8-
- name: centos-5.10
9-
- name: centos-6.5
10-
- name: fedora-19
8+
- name: centos-5.11
9+
- name: centos-6.6
10+
- name: fedora-21
1111
- name: ubuntu-10.04
1212
- name: ubuntu-12.04
13+
- name: ubuntu-14.04
1314

1415
suites:
1516
- name: default

attributes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
default['runit']['reload'] = 'reload runsvdir'
3737
end
3838

39-
when 'rhel'
39+
when 'rhel', 'fedora'
4040
default['runit']['sv_bin'] = '/sbin/sv'
4141
default['runit']['chpst_bin'] = '/sbin/chpst'
4242
default['runit']['service_dir'] = '/etc/service'

recipes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
end
3838

3939
case node['platform_family']
40-
when 'rhel'
40+
when 'rhel', 'fedora'
4141

4242
packagecloud_repo 'imeyer/runit' unless node['runit']['prefer_local_yum']
4343
package 'runit'

test/cookbooks/runit_test/files/default/tests/minitest/service_test.rb

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121

2222
describe 'runit_test::service' do
2323
include Helpers::RunitTest
24+
MiniTest::Chef::Resources.register_resource(:runit_service)
2425

2526
it 'creates a service with the defaults' do
26-
service('plain-defaults').must_be_running
27+
runit_service('plain-defaults').must_be_running
2728
file('/etc/service/plain-defaults/run').must_exist
2829
file('/etc/service/plain-defaults/log/run').must_exist
2930
file('/etc/init.d/plain-defaults').must_exist
@@ -34,53 +35,53 @@
3435
end
3536

3637
it 'creates a service that doesnt use the svlog' do
37-
service('no-svlog').must_be_running
38+
runit_service('no-svlog').must_be_running
3839
directory('/etc/sv/no-svlog/log').wont_exist
3940
end
4041

4142
it 'creates a service that uses the default svlog' do
4243
regexp = %r{#!/bin/sh\nexec svlogd -tt /var/log/default-svlog}
43-
service('default-svlog').must_be_running
44+
runit_service('default-svlog').must_be_running
4445
file('/etc/service/default-svlog/log/run').must_match(regexp)
4546
end
4647

4748
it 'creates a service that has a check script' do
48-
service('checker').must_be_running
49+
runit_service('checker').must_be_running
4950
file('/etc/service/checker/check').must_exist
5051
end
5152

5253
it 'creates a service that has a finish script' do
53-
service('finisher').must_be_running
54+
runit_service('finisher').must_be_running
5455
file('/etc/service/finisher/finish').must_exist
5556
end
5657

5758
it 'creates a service using sv_timeout' do
58-
service('timer').must_be_running
59+
runit_service('timer').must_be_running
5960
end
6061

6162
it 'creates a service using sv_verbose' do
62-
service('chatterbox').must_be_running
63+
runit_service('chatterbox').must_be_running
6364
end
6465

6566
it 'creates a service that uses env files' do
6667
regexp = %r{\$PATH:/opt/chef/embedded/bin}
67-
service('env-files').must_be_running
68+
runit_service('env-files').must_be_running
6869
file('/etc/service/env-files/env/PATH').must_match(regexp)
6970
end
7071

7172
it 'creates a service that sets options for the templates' do
72-
service('template-options').must_be_running
73+
runit_service('template-options').must_be_running
7374
file('/etc/service/template-options/run').must_match('# Options are delicious')
7475
end
7576

7677
it 'creates a service that uses control signal files' do
77-
service('control-signals').must_be_running
78+
runit_service('control-signals').must_be_running
7879
file('/etc/service/control-signals/control/u').must_match(/control signal up/)
7980
end
8081

8182
it 'creates a runsvdir service for a normal user' do
8283
regexp = %r{exec chpst -ufloyd runsvdir /home/floyd/service}
83-
service('runsvdir-floyd').must_be_running
84+
runit_service('runsvdir-floyd').must_be_running
8485
file('/etc/service/runsvdir-floyd/run').must_match(regexp)
8586
end
8687

@@ -101,11 +102,11 @@
101102
end
102103

103104
it 'creates a service with differently named template files' do
104-
service('yerba').must_be_running
105+
runit_service('yerba').must_be_running
105106
end
106107

107108
it 'creates a service with differently named run script template' do
108-
service('yerba-alt').must_be_running
109+
runit_service('yerba-alt').must_be_running
109110
end
110111

111112
it 'creates a service that should exist but be disabled' do
@@ -114,11 +115,11 @@
114115
end
115116

116117
it 'can use templates from another cookbook' do
117-
service('other-cookbook-templates').must_be_running
118+
runit_service('other-cookbook-templates').must_be_running
118119
end
119120

120121
it 'creates a service that has its own run scripts' do
121-
skip 'RHEL platforms dont ship runit scripts' if node['platform_family'] == 'rhel'
122+
skip 'RHEL platforms dont ship runit scripts' if node['platform_family'] == 'rhel' || node['platform_family'] == 'fedora'
122123

123124
git_daemon = shell_out("#{node['runit']['sv_bin']} status /etc/service/git-daemon")
124125
assert git_daemon.stdout.include?('run:')

test/cookbooks/runit_test/recipes/service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
cookbook 'runit-other_test'
142142
end
143143

144-
unless platform_family?('rhel')
144+
unless platform_family?('rhel', 'fedora')
145145
# Create a service that has a package with its own service directory
146146
package 'git-daemon-run'
147147

0 commit comments

Comments
 (0)