diff options
author | Matt Wrock <matt@mattwrock.com> | 2015-12-29 10:31:41 -0800 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2015-12-29 10:31:41 -0800 |
commit | 7f69ad99a2446e9c70112aa531f68a971a52758f (patch) | |
tree | 918bc63c8ffb8f1354b25378155c478b6fdad2ac /spec/functional | |
parent | b027f4b9cebda8314118a0839f93d812e1b6fcfa (diff) | |
download | chef-7f69ad99a2446e9c70112aa531f68a971a52758f.tar.gz |
fixes #3521 correcting format of user name passed to policy apis and does not clobber existing service rights of other users
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/resource/windows_service_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/functional/resource/windows_service_spec.rb b/spec/functional/resource/windows_service_spec.rb index 90545429e5..9ee4adde87 100644 --- a/spec/functional/resource/windows_service_spec.rb +++ b/spec/functional/resource/windows_service_spec.rb @@ -23,7 +23,7 @@ describe Chef::Resource::WindowsService, :windows_only, :system_windows_service_ include_context "using Win32::Service" let(:username) { "service_spec_user"} - let(:qualified_username) { ".\\#{username}"} + let(:qualified_username) { "#{ENV['COMPUTERNAME']}\\#{username}"} let(:password) { "1a2b3c4X!&narf"} let(:user_resource) { @@ -93,6 +93,9 @@ describe Chef::Resource::WindowsService, :windows_only, :system_windows_service_ service_resource.run_action(:start) end - it "raises an exception when it can't grant the logon privilege" + it "grants the user the log on as service right" do + service_resource.run_action(:start) + expect(Chef::ReservedNames::Win32::Security.get_account_right(qualified_username)).to include("SeServiceLogonRight") + end end end |