diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-11 13:23:44 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2015-02-17 09:24:44 -0500 |
commit | a5882a989a13cfb9097b337ec560fa771160fcfc (patch) | |
tree | c5b9652f5f414f307478c4040af9f2e4e7a73ca6 | |
parent | 2ce0bc1a3df3fda18465e928060abdc426c6641e (diff) | |
download | chef-a5882a989a13cfb9097b337ec560fa771160fcfc.tar.gz |
Added test for duplicating a security token
-rw-r--r-- | spec/functional/win32/security_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/functional/win32/security_spec.rb b/spec/functional/win32/security_spec.rb index 010a4ca557..7ad6756a20 100644 --- a/spec/functional/win32/security_spec.rb +++ b/spec/functional/win32/security_spec.rb @@ -34,4 +34,19 @@ describe 'Chef::Win32::Security', :windows_only do it "has_admin_privileges? returns false when running as non-admin" do skip "requires user support in mixlib-shellout" end + + describe 'Chef::Win32::Security::Token' do + let(:token) { + Chef::ReservedNames::Win32::Security.open_process_token( + Chef::ReservedNames::Win32::Process.get_current_process, + token_rights) + } + context 'with all rights' do + let(:token_rights) { Chef::ReservedNames::Win32::Security::TOKEN_ALL_ACCESS } + + it 'can duplicate a token' do + expect{ token.duplicate_token(:SecurityImpersonation) }.not_to raise_error + end + end + end end |