mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
Add startname to systemd server
Signed-off-by: Mendy Baitelman <mendy@baitelman.com>
This commit is contained in:
parent
4d990865a1
commit
db58322d41
3 changed files with 4 additions and 0 deletions
|
@ -304,10 +304,12 @@ module Inspec::Resources
|
|||
|
||||
# LoadState values eg. loaded, not-found
|
||||
installed = params["LoadState"] == "loaded"
|
||||
startname = params["User"] != "" : params["User"]; nil
|
||||
|
||||
{
|
||||
name: params["Id"],
|
||||
description: params["Description"],
|
||||
startname: startname,
|
||||
installed: installed,
|
||||
running: is_active?(service_name),
|
||||
enabled: is_enabled?(service_name),
|
||||
|
|
|
@ -5,3 +5,4 @@ LoadState=loaded
|
|||
UnitFileState=
|
||||
SubState=running
|
||||
ActiveState=active
|
||||
User=root
|
||||
|
|
|
@ -359,6 +359,7 @@ describe "Inspec::Resources::Service" do
|
|||
_(resource.type).must_equal "systemd"
|
||||
_(resource.name).must_equal "apache2.service"
|
||||
_(resource.description).must_equal "LSB: Apache2 web server"
|
||||
_(resource.startname).must_equal "root"
|
||||
_(resource.installed?).must_equal true
|
||||
_(resource.enabled?).must_equal true
|
||||
_(resource.running?).must_equal true
|
||||
|
|
Loading…
Reference in a new issue