mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
add arch linux support for service resource
This commit is contained in:
parent
45081735ad
commit
36ad0dd5a0
2 changed files with 12 additions and 0 deletions
|
@ -64,6 +64,8 @@ class Service < Vulcano.resource(1)
|
|||
@service_mgmt = WindowsSrv.new(vulcano)
|
||||
when 'freebsd'
|
||||
@service_mgmt = BSDInit.new(vulcano)
|
||||
when 'arch'
|
||||
@service_mgmt = Systemd.new(vulcano)
|
||||
end
|
||||
|
||||
return skip_resource 'The `service` resource is not supported on your OS yet.' if @service_mgmt.nil?
|
||||
|
|
|
@ -35,6 +35,16 @@ describe 'Vulcano::Resources::Service' do
|
|||
_(resource.running?).must_equal true
|
||||
end
|
||||
|
||||
# arch linux with systemd
|
||||
it 'verify arch linux package parsing' do
|
||||
resource = MockLoader.new(:arch).load_resource('service', 'sshd')
|
||||
srv = { name: 'sshd.service', description: 'OpenSSH server daemon', installed: true, running: true, enabled: true, type: 'systemd' }
|
||||
_(resource.info).must_equal srv
|
||||
_(resource.installed?).must_equal true
|
||||
_(resource.enabled?).must_equal true
|
||||
_(resource.running?).must_equal true
|
||||
end
|
||||
|
||||
# debian 8 with systemd
|
||||
it 'verify arch linux package parsing' do
|
||||
resource = MockLoader.new(:debian7).load_resource('service', 'sshd')
|
||||
|
|
Loading…
Add table
Reference in a new issue