chef 14.12.9-universal-mingw32 → 14.13.11-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -9
  3. data/lib/chef/chef_fs/command_line.rb +11 -12
  4. data/lib/chef/deprecated.rb +3 -3
  5. data/lib/chef/dsl/data_query.rb +22 -4
  6. data/lib/chef/dsl/recipe.rb +1 -7
  7. data/lib/chef/dsl/universal.rb +6 -0
  8. data/lib/chef/file_access_control/windows.rb +5 -3
  9. data/lib/chef/knife.rb +3 -3
  10. data/lib/chef/knife/bootstrap.rb +1 -1
  11. data/lib/chef/knife/bootstrap/templates/chef-full.erb +2 -1
  12. data/lib/chef/knife/config_list_profiles.rb +1 -1
  13. data/lib/chef/knife/core/status_presenter.rb +9 -2
  14. data/lib/chef/mixin/template.rb +14 -9
  15. data/lib/chef/node_map.rb +5 -24
  16. data/lib/chef/provider/cron.rb +14 -2
  17. data/lib/chef/provider/file.rb +1 -1
  18. data/lib/chef/provider/service/insserv.rb +3 -1
  19. data/lib/chef/resource.rb +3 -10
  20. data/lib/chef/resource/windows_feature_powershell.rb +1 -1
  21. data/lib/chef/resource_collection.rb +3 -2
  22. data/lib/chef/shell.rb +1 -0
  23. data/lib/chef/version.rb +1 -1
  24. data/lib/chef/win32/api/security.rb +2 -0
  25. data/lib/chef/win32/file.rb +8 -0
  26. data/lib/chef/win32/security.rb +1 -1
  27. data/spec/data/templates/failed.erb +5 -0
  28. data/spec/functional/assets/inittest +36 -0
  29. data/spec/functional/resource/insserv_spec.rb +205 -0
  30. data/spec/functional/resource/link_spec.rb +2 -2
  31. data/spec/spec_helper.rb +1 -0
  32. data/spec/support/platform_helpers.rb +4 -0
  33. data/spec/support/shared/functional/directory_resource.rb +12 -10
  34. data/spec/support/shared/functional/file_resource.rb +2 -2
  35. data/spec/support/shared/functional/securable_resource.rb +102 -71
  36. data/spec/support/shared/unit/provider/file.rb +1 -0
  37. data/spec/unit/knife/bootstrap_spec.rb +22 -0
  38. data/spec/unit/knife_spec.rb +8 -5
  39. data/spec/unit/mixin/template_spec.rb +45 -0
  40. data/spec/unit/node_map_spec.rb +10 -43
  41. data/spec/unit/provider/cron_spec.rb +123 -20
  42. data/spec/unit/provider/service/insserv_service_spec.rb +2 -2
  43. data/spec/unit/resource_collection_spec.rb +8 -0
  44. data/spec/unit/resource_spec.rb +1 -13
  45. data/spec/unit/win32/security_spec.rb +25 -0
  46. metadata +7 -4
@@ -36,7 +36,7 @@ describe Chef::Provider::Service::Insserv do
36
36
  describe "load_current_resource" do
37
37
  describe "when startup links exist" do
38
38
  before do
39
- allow(Dir).to receive(:glob).with("/etc/rc**/S*initgrediant").and_return(["/etc/rc5.d/S18initgrediant", "/etc/rc2.d/S18initgrediant", "/etc/rc4.d/S18initgrediant", "/etc/rc3.d/S18initgrediant"])
39
+ allow(Dir).to receive(:glob).with("/etc/rc*/**/S*initgrediant").and_return(["/etc/rc.d/rc5.d/S18initgrediant", "/etc/rc.d/rc2.d/S18initgrediant", "/etc/rc.d/rc4.d/S18initgrediant", "/etc/rc.d/rc3.d/S18initgrediant"])
40
40
  end
41
41
 
42
42
  it "sets the current enabled status to true" do
@@ -47,7 +47,7 @@ describe Chef::Provider::Service::Insserv do
47
47
 
48
48
  describe "when startup links do not exist" do
49
49
  before do
50
- allow(Dir).to receive(:glob).with("/etc/rc**/S*initgrediant").and_return([])
50
+ allow(Dir).to receive(:glob).with("/etc/rc*/**/S*initgrediant").and_return([])
51
51
  end
52
52
 
53
53
  it "sets the current enabled status to false" do
@@ -183,6 +183,14 @@ describe Chef::ResourceCollection do
183
183
  expect(rc).to be_empty
184
184
  end
185
185
 
186
+ it "should allow to delete resources with different providers" do
187
+ pkg = Chef::Resource::YumPackage.new("monkey")
188
+ rc.insert(pkg, instance_name: "monkey", resource_type: "package")
189
+ expect(rc).not_to be_empty
190
+ expect(rc.delete("package[monkey]")).to eql(pkg)
191
+ expect(rc).to be_empty
192
+ end
193
+
186
194
  it "should raise an exception if you send something strange to delete" do
187
195
  expect { rc.delete(:symbol) }.to raise_error(ArgumentError)
188
196
  end
@@ -867,7 +867,7 @@ describe Chef::Resource do
867
867
  snitch_var1 = snitch_var2 = 0
868
868
  runner = Chef::Runner.new(run_context)
869
869
 
870
- Chef::Provider::SnakeOil.provides :cat, __core_override__: true
870
+ Chef::Provider::SnakeOil.provides :cat
871
871
 
872
872
  resource1.only_if { snitch_var1 = 1 }
873
873
  resource1.not_if { snitch_var2 = 2 }
@@ -1191,17 +1191,5 @@ describe Chef::Resource do
1191
1191
  expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, { canonical: true })
1192
1192
  klass.resource_name(:test_resource)
1193
1193
  end
1194
-
1195
- it "adds allow_cookbook_override when true" do
1196
- expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, { canonical: true, allow_cookbook_override: true })
1197
- klass.preview_resource(true)
1198
- klass.resource_name(:test_resource)
1199
- end
1200
-
1201
- it "allows manually overriding back to false" do
1202
- expect(Chef.resource_handler_map).to receive(:set).with(:test_resource, klass, { allow_cookbook_override: false })
1203
- klass.preview_resource(true)
1204
- klass.provides(:test_resource, allow_cookbook_override: false)
1205
- end
1206
1194
  end
1207
1195
  end
@@ -106,4 +106,29 @@ describe "Chef::Win32::Security", :windows_only do
106
106
  expect { Chef::ReservedNames::Win32::Security.get_token_information_elevation_type(token) }.to raise_error(Chef::Exceptions::Win32APIError)
107
107
  end
108
108
  end
109
+
110
+ describe "self.lookup_account_name" do
111
+ let(:security_class) { Chef::ReservedNames::Win32::Security }
112
+
113
+ context "when FFI::LastError.error result is ERROR_INSUFFICIENT_BUFFER" do
114
+ it "does not raise the exception" do
115
+ expect(FFI::LastError).to receive(:error).and_return(122)
116
+ expect { security_class.lookup_account_name "system" }.to_not raise_error
117
+ end
118
+ end
119
+
120
+ context "when operation completed successfully and FFI::LastError.error result is NO_ERROR" do
121
+ it "does not raise the exception" do
122
+ expect(FFI::LastError).to receive(:error).and_return(0)
123
+ expect { security_class.lookup_account_name "system" }.to_not raise_error
124
+ end
125
+ end
126
+
127
+ context "when FFI::LastError.error result is not ERROR_INSUFFICIENT_BUFFER and not NO_ERROR" do
128
+ it "raises Chef::ReservedNames::Win32::Error.raise! exception" do
129
+ expect(FFI::LastError).to receive(:error).and_return(123).at_least(:once)
130
+ expect { security_class.lookup_account_name "system" }.to raise_error
131
+ end
132
+ end
133
+ end
109
134
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.12.9
4
+ version: 14.13.11
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-19 00:00:00.000000000 Z
11
+ date: 2019-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 14.12.9
19
+ version: 14.13.11
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 14.12.9
26
+ version: 14.13.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-cli
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -1889,6 +1889,7 @@ files:
1889
1889
  - spec/data/templates/chef-seattle20160930-4388-1crv7ef.txt
1890
1890
  - spec/data/templates/chef-seattle20160930-4388-jjfoae.txt
1891
1891
  - spec/data/templates/chef-seattle20160930-4388-umeq2c.txt
1892
+ - spec/data/templates/failed.erb
1892
1893
  - spec/data/templates/seattle.txt
1893
1894
  - spec/data/trusted_certs/example.crt
1894
1895
  - spec/data/trusted_certs/example_no_cn.crt
@@ -1911,6 +1912,7 @@ files:
1911
1912
  - spec/functional/assets/chocolatey_feed/test-B.1.0.nupkg
1912
1913
  - spec/functional/assets/dummy-1-0.aix6.1.noarch.rpm
1913
1914
  - spec/functional/assets/dummy-2-0.aix6.1.noarch.rpm
1915
+ - spec/functional/assets/inittest
1914
1916
  - spec/functional/assets/mytest-1.0-1.noarch.rpm
1915
1917
  - spec/functional/assets/mytest-2.0-1.noarch.rpm
1916
1918
  - spec/functional/assets/testchefsubsys
@@ -1993,6 +1995,7 @@ files:
1993
1995
  - spec/functional/resource/git_spec.rb
1994
1996
  - spec/functional/resource/group_spec.rb
1995
1997
  - spec/functional/resource/ifconfig_spec.rb
1998
+ - spec/functional/resource/insserv_spec.rb
1996
1999
  - spec/functional/resource/link_spec.rb
1997
2000
  - spec/functional/resource/mount_spec.rb
1998
2001
  - spec/functional/resource/msu_package_spec.rb