summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAnton Kvashenkin <ak@gfoil.ru>2018-09-24 21:57:12 +0300
committerAnton Kvashenkin <ak@gfoil.ru>2018-10-16 22:46:27 +0300
commitb2f02d134ce96599416f1c3a5ab045cb261cc883 (patch)
tree2a692fa9ef10c771d71f2c98918648012c504a14 /spec
parent1a793e91ed42e8e36f748c16ceda3874205f9968 (diff)
downloadchef-b2f02d134ce96599416f1c3a5ab045cb261cc883.tar.gz
Add support for localized system account to windows_task resource
Signed-off-by: Anton Kvashenkin <anton.jugatsu@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/windows_task_spec.rb2
-rw-r--r--spec/unit/provider/windows_task_spec.rb1
-rw-r--r--spec/unit/resource/windows_task_spec.rb2
3 files changed, 3 insertions, 2 deletions
diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb
index a2cd4b97d7..cb14da80d8 100644
--- a/spec/functional/resource/windows_task_spec.rb
+++ b/spec/functional/resource/windows_task_spec.rb
@@ -1571,7 +1571,7 @@ describe Chef::Resource::WindowsTask, :windows_only do
it "raises error" do
subject.user "Administrator"
subject.frequency :onstart
- expect { subject.after_created }.to raise_error(%q{Cannot specify a user other than the system users without specifying a password!. Valid passwordless users: 'NT AUTHORITY\SYSTEM', 'SYSTEM', 'NT AUTHORITY\LOCALSERVICE', 'NT AUTHORITY\NETWORKSERVICE', 'BUILTIN\USERS', 'USERS'})
+ expect { subject.after_created }.to raise_error(%q{Cannot specify a user other than the system users without specifying a password!. Valid passwordless users: 'SYSTEM', 'NT AUTHORITY\SYSTEM', 'LOCAL SERVICE', 'NT AUTHORITY\LOCAL SERVICE', 'NETWORK SERVICE', 'NT AUTHORITY\NETWORK SERVICE', 'ADMINISTRATORS', 'BUILTIN\ADMINISTRATORS', 'USERS', 'BUILTIN\USERS', 'GUESTS', 'BUILTIN\GUESTS'})
end
end
diff --git a/spec/unit/provider/windows_task_spec.rb b/spec/unit/provider/windows_task_spec.rb
index 3a046ab5de..3565da1ca3 100644
--- a/spec/unit/provider/windows_task_spec.rb
+++ b/spec/unit/provider/windows_task_spec.rb
@@ -416,6 +416,7 @@ describe Chef::Provider::WindowsTask, :windows_only do
end
it "return logon_type bindary value as 1 as if password is not nil" do
+ new_resource.user = "Administrator"
new_resource.password = "abc"
expect(provider.send(:logon_type)).to be(1)
end
diff --git a/spec/unit/resource/windows_task_spec.rb b/spec/unit/resource/windows_task_spec.rb
index 76e2a86ee8..efbc1b1846 100644
--- a/spec/unit/resource/windows_task_spec.rb
+++ b/spec/unit/resource/windows_task_spec.rb
@@ -73,7 +73,7 @@ describe Chef::Resource::WindowsTask, :windows_only do
end
it "raises an error if the user is a non-system user" do
resource.user "bob"
- expect { resource.after_created }.to raise_error(ArgumentError, %q{Cannot specify a user other than the system users without specifying a password!. Valid passwordless users: 'NT AUTHORITY\SYSTEM', 'SYSTEM', 'NT AUTHORITY\LOCALSERVICE', 'NT AUTHORITY\NETWORKSERVICE', 'BUILTIN\USERS', 'USERS'})
+ expect { resource.after_created }.to raise_error(ArgumentError, %q{Cannot specify a user other than the system users without specifying a password!. Valid passwordless users: 'SYSTEM', 'NT AUTHORITY\SYSTEM', 'LOCAL SERVICE', 'NT AUTHORITY\LOCAL SERVICE', 'NETWORK SERVICE', 'NT AUTHORITY\NETWORK SERVICE', 'ADMINISTRATORS', 'BUILTIN\ADMINISTRATORS', 'USERS', 'BUILTIN\USERS', 'GUESTS', 'BUILTIN\GUESTS'})
end
it "does not raise an error if the user is a system user" do