mirror of
https://github.com/inspec/inspec
synced 2025-02-17 14:38:43 +00:00
fix runit_service tests, replace socat with a proper mock daemon
This commit is contained in:
parent
492c7f8146
commit
f2f2db120d
3 changed files with 18 additions and 5 deletions
|
@ -2,7 +2,6 @@
|
||||||
# author: Stephan Renatus
|
# author: Stephan Renatus
|
||||||
|
|
||||||
include_recipe 'runit::default'
|
include_recipe 'runit::default'
|
||||||
package 'socat'
|
|
||||||
|
|
||||||
# put ctl in alt location
|
# put ctl in alt location
|
||||||
directory '/opt/chef/embedded/sbin' do
|
directory '/opt/chef/embedded/sbin' do
|
||||||
|
@ -19,9 +18,17 @@ runit_service 'running-runit-service' do
|
||||||
run_template_name 'default-svlog'
|
run_template_name 'default-svlog'
|
||||||
end
|
end
|
||||||
|
|
||||||
runit_service 'non-running-runit-service' do
|
runit_service 'not-enabled-runit-service' do
|
||||||
default_logger true
|
default_logger true
|
||||||
run_template_name 'default-svlog'
|
run_template_name 'default-svlog'
|
||||||
start_down true
|
start_down true
|
||||||
|
action :enable
|
||||||
|
end
|
||||||
|
|
||||||
|
runit_service 'not-running-runit-service' do
|
||||||
|
default_logger true
|
||||||
|
run_template_name 'default-svlog'
|
||||||
action :create
|
action :create
|
||||||
end
|
end
|
||||||
|
|
||||||
|
execute 'sv down not-running-runit-service'
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec 2>&1
|
exec > /dev/null
|
||||||
exec socat - TCP4-LISTEN:6701,fork
|
exec yes
|
||||||
|
|
|
@ -51,12 +51,18 @@ if os[:family] == 'centos'
|
||||||
it { should be_running }
|
it { should be_running }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe runit_service('non-running-runit-service') do
|
describe runit_service('not-running-runit-service') do
|
||||||
it { should be_enabled }
|
it { should be_enabled }
|
||||||
it { should be_installed }
|
it { should be_installed }
|
||||||
it { should_not be_running }
|
it { should_not be_running }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe runit_service('not-enabled-runit-service') do
|
||||||
|
it { should_not be_enabled }
|
||||||
|
it { should be_installed }
|
||||||
|
it { should_not be_running }
|
||||||
|
end
|
||||||
|
|
||||||
# alt. ctl location
|
# alt. ctl location
|
||||||
describe runit_service('running-runit-service', '/opt/chef/embedded/sbin/sv') do
|
describe runit_service('running-runit-service', '/opt/chef/embedded/sbin/sv') do
|
||||||
it { should be_enabled }
|
it { should be_enabled }
|
||||||
|
|
Loading…
Add table
Reference in a new issue