Add startname to systemd server

Signed-off-by: Mendy Baitelman <mendy@baitelman.com>
This commit is contained in:
Mendy Baitelman 2019-08-06 21:04:52 -07:00
parent 4d990865a1
commit db58322d41
3 changed files with 4 additions and 0 deletions

View file

@ -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),

View file

@ -5,3 +5,4 @@ LoadState=loaded
UnitFileState=
SubState=running
ActiveState=active
User=root

View file

@ -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