chef 16.2.50-universal-mingw32 → 16.2.73-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -15
- data/chef.gemspec +2 -2
- data/lib/chef/application/apply.rb +1 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +2 -2
- data/lib/chef/digester.rb +3 -2
- data/lib/chef/file_access_control/windows.rb +2 -2
- data/lib/chef/file_content_management/deploy/mv_unix.rb +1 -1
- data/lib/chef/http.rb +1 -1
- data/lib/chef/knife/bootstrap.rb +12 -3
- data/lib/chef/knife/cookbook_upload.rb +1 -4
- data/lib/chef/knife/core/bootstrap_context.rb +1 -1
- data/lib/chef/knife/core/windows_bootstrap_context.rb +1 -1
- data/lib/chef/resource.rb +1 -1
- data/lib/chef/resource/dmg_package.rb +1 -1
- data/lib/chef/resource/launchd.rb +1 -1
- data/lib/chef/resource/windows_user_privilege.rb +25 -2
- data/lib/chef/version.rb +1 -1
- data/spec/functional/knife/configure_spec.rb +1 -1
- data/spec/functional/resource/aix_service_spec.rb +10 -1
- data/spec/functional/resource/aixinit_service_spec.rb +1 -1
- data/spec/functional/resource/bash_spec.rb +3 -2
- data/spec/functional/resource/bff_spec.rb +1 -1
- data/spec/functional/resource/chocolatey_package_spec.rb +4 -0
- data/spec/functional/resource/cron_spec.rb +10 -1
- data/spec/functional/resource/dnf_package_spec.rb +4 -1
- data/spec/functional/resource/execute_spec.rb +1 -1
- data/spec/functional/resource/group_spec.rb +9 -1
- data/spec/functional/resource/ifconfig_spec.rb +9 -1
- data/spec/functional/resource/insserv_spec.rb +3 -2
- data/spec/functional/resource/link_spec.rb +2 -5
- data/spec/functional/resource/mount_spec.rb +9 -1
- data/spec/functional/resource/msu_package_spec.rb +9 -3
- data/spec/functional/resource/powershell_script_spec.rb +4 -4
- data/spec/functional/resource/remote_file_spec.rb +6 -6
- data/spec/functional/resource/rpm_spec.rb +1 -1
- data/spec/functional/resource/timezone_spec.rb +2 -0
- data/spec/functional/resource/windows_package_spec.rb +0 -1
- data/spec/functional/resource/windows_path_spec.rb +4 -0
- data/spec/functional/resource/windows_security_policy_spec.rb +0 -1
- data/spec/functional/resource/windows_service_spec.rb +4 -0
- data/spec/functional/resource/windows_task_spec.rb +4 -3
- data/spec/functional/resource/windows_user_privilege_spec.rb +0 -1
- data/spec/functional/resource/yum_package_spec.rb +4 -1
- data/spec/functional/resource/zypper_package_spec.rb +4 -1
- data/spec/functional/shell_spec.rb +0 -1
- data/spec/functional/win32/crypto_spec.rb +1 -1
- data/spec/integration/knife/cookbook_upload_spec.rb +1 -1
- data/spec/integration/knife/data_bag_from_file_spec.rb +1 -1
- data/spec/integration/knife/environment_from_file_spec.rb +1 -1
- data/spec/integration/knife/node_from_file_spec.rb +1 -1
- data/spec/integration/knife/role_from_file_spec.rb +1 -1
- data/spec/integration/recipes/recipe_dsl_spec.rb +4 -0
- data/spec/integration/recipes/resource_load_spec.rb +2 -2
- data/spec/support/shared/functional/securable_resource.rb +1 -2
- data/spec/support/shared/functional/securable_resource_with_reporting.rb +0 -1
- data/spec/support/shared/functional/windows_script.rb +2 -2
- data/spec/support/shared/unit/provider/file.rb +12 -8
- data/spec/unit/application/solo_spec.rb +4 -2
- data/spec/unit/chef_fs/config_spec.rb +2 -2
- data/spec/unit/chef_fs/diff_spec.rb +8 -8
- data/spec/unit/client_spec.rb +4 -1
- data/spec/unit/cookbook/synchronizer_spec.rb +26 -24
- data/spec/unit/data_bag_spec.rb +6 -3
- data/spec/unit/decorator_spec.rb +23 -23
- data/spec/unit/environment_spec.rb +5 -1
- data/spec/unit/guard_interpreter_spec.rb +1 -1
- data/spec/unit/http/api_versions_spec.rb +1 -1
- data/spec/unit/knife/bootstrap_spec.rb +1 -0
- data/spec/unit/knife/cookbook_download_spec.rb +2 -2
- data/spec/unit/knife/cookbook_show_spec.rb +6 -7
- data/spec/unit/knife/data_bag_edit_spec.rb +1 -1
- data/spec/unit/lwrp_spec.rb +5 -2
- data/spec/unit/mixin/powershell_out_spec.rb +2 -4
- data/spec/unit/mixin/powershell_type_coercions_spec.rb +1 -1
- data/spec/unit/mixin/subclass_directive_spec.rb +2 -2
- data/spec/unit/mixin/unformatter_spec.rb +2 -2
- data/spec/unit/mixin/uris_spec.rb +1 -1
- data/spec/unit/provider/batch_spec.rb +1 -1
- data/spec/unit/provider/cron/unix_spec.rb +1 -1
- data/spec/unit/provider/dsc_resource_spec.rb +22 -38
- data/spec/unit/provider/dsc_script_spec.rb +10 -10
- data/spec/unit/provider/execute_spec.rb +1 -1
- data/spec/unit/provider/git_spec.rb +3 -3
- data/spec/unit/provider/mdadm_spec.rb +1 -3
- data/spec/unit/provider/package/openbsd_spec.rb +1 -1
- data/spec/unit/provider/package/pacman_spec.rb +17 -20
- data/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb +3 -3
- data/spec/unit/provider/user/dscl_spec.rb +2 -2
- data/spec/unit/provider/windows_env_spec.rb +5 -4
- data/spec/unit/resource/chef_client_cron_spec.rb +23 -7
- data/spec/unit/resource/chef_client_systemd_timer_spec.rb +7 -4
- data/spec/unit/resource/file/verification_spec.rb +2 -1
- data/spec/unit/resource_spec.rb +25 -8
- data/spec/unit/role_spec.rb +23 -21
- data/spec/unit/util/backup_spec.rb +1 -1
- data/spec/unit/util/powershell/ps_credential_spec.rb +2 -2
- data/spec/unit/util/selinux_spec.rb +2 -1
- metadata +20 -15
- data/spec/functional/resource/base.rb +0 -28
@@ -17,11 +17,11 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require "spec_helper"
|
20
|
-
require "functional/resource/base"
|
21
20
|
require "timeout"
|
22
21
|
|
23
22
|
describe Chef::Resource::Execute do
|
24
23
|
let(:resource) do
|
24
|
+
run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
25
25
|
resource = Chef::Resource::Execute.new("foo_resource", run_context)
|
26
26
|
resource.command("echo hello")
|
27
27
|
resource
|
@@ -18,7 +18,6 @@
|
|
18
18
|
#
|
19
19
|
|
20
20
|
require "spec_helper"
|
21
|
-
require "functional/resource/base"
|
22
21
|
require "chef/mixin/shell_out"
|
23
22
|
|
24
23
|
describe Chef::Resource::Group, :requires_root_or_running_windows do
|
@@ -113,6 +112,15 @@ describe Chef::Resource::Group, :requires_root_or_running_windows do
|
|
113
112
|
# TODO: User shouldn't exist
|
114
113
|
end
|
115
114
|
|
115
|
+
let(:run_context) do
|
116
|
+
node = Chef::Node.new
|
117
|
+
node.default[:platform] = ohai[:platform]
|
118
|
+
node.default[:platform_version] = ohai[:platform_version]
|
119
|
+
node.default[:os] = ohai[:os]
|
120
|
+
events = Chef::EventDispatch::Dispatcher.new
|
121
|
+
Chef::RunContext.new(node, {}, events)
|
122
|
+
end
|
123
|
+
|
116
124
|
shared_examples_for "correct group management" do
|
117
125
|
def add_members_to_group(members)
|
118
126
|
temp_resource = group_resource.dup
|
@@ -17,7 +17,6 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require "spec_helper"
|
20
|
-
require "functional/resource/base"
|
21
20
|
require "chef/mixin/shell_out"
|
22
21
|
|
23
22
|
# run this test only for following platforms.
|
@@ -26,6 +25,15 @@ include_flag = !(%w{amazon debian aix}.include?(ohai[:platform_family]) || (ohai
|
|
26
25
|
describe Chef::Resource::Ifconfig, :requires_root, :requires_ifconfig, external: include_flag do
|
27
26
|
include Chef::Mixin::ShellOut
|
28
27
|
|
28
|
+
let(:run_context) do
|
29
|
+
node = Chef::Node.new
|
30
|
+
node.default[:platform] = ohai[:platform]
|
31
|
+
node.default[:platform_version] = ohai[:platform_version]
|
32
|
+
node.default[:os] = ohai[:os]
|
33
|
+
events = Chef::EventDispatch::Dispatcher.new
|
34
|
+
Chef::RunContext.new(node, {}, events)
|
35
|
+
end
|
36
|
+
|
29
37
|
let(:new_resource) do
|
30
38
|
new_resource = Chef::Resource::Ifconfig.new("10.10.0.1", run_context)
|
31
39
|
new_resource
|
@@ -18,7 +18,6 @@
|
|
18
18
|
#
|
19
19
|
|
20
20
|
require "spec_helper"
|
21
|
-
require "functional/resource/base"
|
22
21
|
require "chef/mixin/shell_out"
|
23
22
|
require "fileutils"
|
24
23
|
|
@@ -54,6 +53,8 @@ describe Chef::Resource::Service, :requires_root, :opensuse do
|
|
54
53
|
|
55
54
|
# Actual tests
|
56
55
|
let(:new_resource) do
|
56
|
+
run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
57
|
+
|
57
58
|
new_resource = Chef::Resource::Service.new("inittest", run_context)
|
58
59
|
new_resource.provider Chef::Provider::Service::Insserv
|
59
60
|
new_resource.supports({ status: true, restart: true, reload: true })
|
@@ -65,7 +66,7 @@ describe Chef::Resource::Service, :requires_root, :opensuse do
|
|
65
66
|
provider
|
66
67
|
end
|
67
68
|
|
68
|
-
let
|
69
|
+
let(:service_name) { "Chef::Util::PathHelper.escape_glob_dir(current_resource.service_name)" }
|
69
70
|
|
70
71
|
let(:current_resource) do
|
71
72
|
provider.load_current_resource
|
@@ -64,13 +64,10 @@ describe Chef::Resource::Link do
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
def
|
67
|
+
def user(user)
|
68
68
|
node = Chef::Node.new
|
69
69
|
node.consume_external_attrs(ohai.data, {})
|
70
|
-
node
|
71
|
-
end
|
72
|
-
|
73
|
-
def user(user)
|
70
|
+
run_context = Chef::RunContext.new(node, {}, Chef::EventDispatch::Dispatcher.new)
|
74
71
|
usr = Chef::Resource.resource_for_node(:user, node).new(user, run_context)
|
75
72
|
usr.password("ComplexPass11!") if windows?
|
76
73
|
usr
|
@@ -17,7 +17,6 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require "spec_helper"
|
20
|
-
require "functional/resource/base"
|
21
20
|
require "chef/mixin/shell_out"
|
22
21
|
require "tmpdir"
|
23
22
|
|
@@ -101,6 +100,15 @@ describe Chef::Resource::Mount, :requires_root, external: include_flag do
|
|
101
100
|
expect(shell_out("cat #{unix_mount_config_file}").stdout).not_to include("#{mount_point}:")
|
102
101
|
end
|
103
102
|
|
103
|
+
let(:run_context) do
|
104
|
+
node = Chef::Node.new
|
105
|
+
node.default[:platform] = ohai[:platform]
|
106
|
+
node.default[:platform_version] = ohai[:platform_version]
|
107
|
+
node.default[:os] = ohai[:os]
|
108
|
+
events = Chef::EventDispatch::Dispatcher.new
|
109
|
+
Chef::RunContext.new(node, {}, events)
|
110
|
+
end
|
111
|
+
|
104
112
|
let(:new_resource) do
|
105
113
|
new_resource = Chef::Resource::Mount.new(@mount_point, run_context)
|
106
114
|
new_resource.device @device
|
@@ -26,11 +26,17 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
|
|
26
26
|
let(:package_identity) { "Package_for_KB2959977~31bf3856ad364e35~amd64~~6.3.1.1" }
|
27
27
|
let(:timeout) { 3600 }
|
28
28
|
|
29
|
-
let(:
|
30
|
-
let(:cab_provider) do
|
29
|
+
let(:run_context) do
|
31
30
|
node = Chef::Node.new
|
31
|
+
node.default[:platform] = ohai[:platform]
|
32
|
+
node.default[:platform_version] = ohai[:platform_version]
|
33
|
+
node.default[:os] = ohai[:os]
|
32
34
|
events = Chef::EventDispatch::Dispatcher.new
|
33
|
-
|
35
|
+
Chef::RunContext.new(node, {}, events)
|
36
|
+
end
|
37
|
+
|
38
|
+
let(:new_resource) { Chef::Resource::CabPackage.new("windows_test_pkg") }
|
39
|
+
let(:cab_provider) do
|
34
40
|
Chef::Provider::Package::Cab.new(new_resource, run_context)
|
35
41
|
end
|
36
42
|
|
@@ -23,8 +23,8 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
|
|
23
23
|
|
24
24
|
include_context Chef::Resource::WindowsScript
|
25
25
|
|
26
|
-
let
|
27
|
-
let
|
26
|
+
let(:architecture_command) { "echo $env:PROCESSOR_ARCHITECTURE" }
|
27
|
+
let(:output_command) { " | out-file -encoding ASCII " }
|
28
28
|
|
29
29
|
it_behaves_like "a Windows script running on Windows"
|
30
30
|
|
@@ -68,8 +68,8 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
let
|
72
|
-
let
|
71
|
+
let(:negative_exit_status) { -27 }
|
72
|
+
let(:unsigned_exit_status) { (-negative_exit_status ^ 65535) + 1 }
|
73
73
|
it "returns the exit status -27 as a signed integer or an unsigned 16-bit 2's complement value of 65509 for a powershell script that exits with -27" do
|
74
74
|
|
75
75
|
# Versions of PowerShell prior to 4.0 return a 16-bit unsigned value --
|
@@ -229,8 +229,8 @@ describe Chef::Resource::RemoteFile do
|
|
229
229
|
end
|
230
230
|
|
231
231
|
context "when the resource is accessed using an alternate user's identity with no access to the file" do
|
232
|
-
let
|
233
|
-
let
|
232
|
+
let(:windows_nonadmin_user) { "chefremfile1" }
|
233
|
+
let(:windows_nonadmin_user_password) { "j82ajfxK3;2Xe1" }
|
234
234
|
include_context "a non-admin Windows user"
|
235
235
|
|
236
236
|
before do
|
@@ -246,8 +246,8 @@ describe Chef::Resource::RemoteFile do
|
|
246
246
|
end
|
247
247
|
|
248
248
|
context "when the the file is only accessible as a specific alternate identity" do
|
249
|
-
let
|
250
|
-
let
|
249
|
+
let(:windows_nonadmin_user) { "chefremfile2" }
|
250
|
+
let(:windows_nonadmin_user_password) { "j82ajfxK3;2Xe2" }
|
251
251
|
include_context "a non-admin Windows user"
|
252
252
|
|
253
253
|
before do
|
@@ -279,8 +279,8 @@ describe Chef::Resource::RemoteFile do
|
|
279
279
|
end
|
280
280
|
|
281
281
|
context "when the resource is accessed using an alternate user's identity with no access to the file" do
|
282
|
-
let
|
283
|
-
let
|
282
|
+
let(:windows_nonadmin_user) { "chefremfile3" }
|
283
|
+
let(:windows_nonadmin_user_password) { "j82ajfxK3;2Xe3" }
|
284
284
|
include_context "a non-admin Windows user"
|
285
285
|
|
286
286
|
let(:remote_user) { windows_nonadmin_user_qualified }
|
@@ -17,7 +17,6 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require "spec_helper"
|
20
|
-
require "functional/resource/base"
|
21
20
|
require "chef/mixin/shell_out"
|
22
21
|
|
23
22
|
# run this test only for following platforms.
|
@@ -26,6 +25,7 @@ describe Chef::Resource::RpmPackage, :requires_root, external: exclude_test do
|
|
26
25
|
include Chef::Mixin::ShellOut
|
27
26
|
|
28
27
|
let(:new_resource) do
|
28
|
+
run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
29
29
|
new_resource = Chef::Resource::RpmPackage.new(@pkg_name, run_context)
|
30
30
|
new_resource.source @pkg_path
|
31
31
|
new_resource
|
@@ -21,6 +21,8 @@ describe Chef::Resource::Timezone, :windows_only do
|
|
21
21
|
let(:timezone) { "GMT Standard Time" }
|
22
22
|
|
23
23
|
def timezone_resource
|
24
|
+
run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
25
|
+
|
24
26
|
Chef::Resource::Timezone.new(timezone, run_context)
|
25
27
|
end
|
26
28
|
|
@@ -21,6 +21,10 @@ require "spec_helper"
|
|
21
21
|
describe Chef::Resource::WindowsPath, :windows_only do
|
22
22
|
let(:path) { "test_path" }
|
23
23
|
|
24
|
+
let(:run_context) do
|
25
|
+
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
26
|
+
end
|
27
|
+
|
24
28
|
before(:all) do
|
25
29
|
@old_path = ENV["PATH"].dup
|
26
30
|
end
|
@@ -62,6 +62,10 @@ describe Chef::Resource::WindowsService, :windows_only, :system_windows_service_
|
|
62
62
|
r
|
63
63
|
end
|
64
64
|
|
65
|
+
let(:run_context) do
|
66
|
+
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
67
|
+
end
|
68
|
+
|
65
69
|
before do
|
66
70
|
user_resource.run_action(:create)
|
67
71
|
|
@@ -25,12 +25,13 @@ describe Chef::Resource::WindowsTask, :windows_only do
|
|
25
25
|
let(:task_name) { "chef-client-functional-test" }
|
26
26
|
let(:new_resource) { Chef::Resource::WindowsTask.new(task_name) }
|
27
27
|
let(:windows_task_provider) do
|
28
|
-
node = Chef::Node.new
|
29
|
-
events = Chef::EventDispatch::Dispatcher.new
|
30
|
-
run_context = Chef::RunContext.new(node, {}, events)
|
31
28
|
Chef::Provider::WindowsTask.new(new_resource, run_context)
|
32
29
|
end
|
33
30
|
|
31
|
+
let(:run_context) do
|
32
|
+
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
33
|
+
end
|
34
|
+
|
34
35
|
describe "action :create" do
|
35
36
|
after { delete_task }
|
36
37
|
context "when command is with arguments" do
|
@@ -16,7 +16,6 @@
|
|
16
16
|
#
|
17
17
|
|
18
18
|
require "spec_helper"
|
19
|
-
require "functional/resource/base"
|
20
19
|
require "chef/mixin/shell_out"
|
21
20
|
|
22
21
|
# run this test only for following platforms.
|
@@ -64,6 +63,10 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
|
|
64
63
|
FileUtils.rm_f "/etc/yum.repos.d/chef-yum-localtesting.repo"
|
65
64
|
end
|
66
65
|
|
66
|
+
let(:run_context) do
|
67
|
+
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
68
|
+
end
|
69
|
+
|
67
70
|
let(:package_name) { "chef_rpm" }
|
68
71
|
let(:yum_package) do
|
69
72
|
r = Chef::Resource::YumPackage.new(package_name, run_context)
|
@@ -17,7 +17,6 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require "spec_helper"
|
20
|
-
require "functional/resource/base"
|
21
20
|
require "chef/mixin/shell_out"
|
22
21
|
|
23
22
|
describe Chef::Resource::ZypperPackage, :requires_root, :suse_only do
|
@@ -52,6 +51,10 @@ describe Chef::Resource::ZypperPackage, :requires_root, :suse_only do
|
|
52
51
|
FileUtils.rm_f "/etc/zypp/repos.d/chef-zypp-localtesting.repo"
|
53
52
|
end
|
54
53
|
|
54
|
+
let(:run_context) do
|
55
|
+
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
56
|
+
end
|
57
|
+
|
55
58
|
let(:package_name) { "chef_rpm" }
|
56
59
|
let(:zypper_package) do
|
57
60
|
r = Chef::Resource::ZypperPackage.new(package_name, run_context)
|
@@ -32,7 +32,7 @@ describe "Chef::ReservedNames::Win32::Crypto", :windows_only do
|
|
32
32
|
@run_context = Chef::RunContext.new(new_node, {}, events)
|
33
33
|
end
|
34
34
|
|
35
|
-
let
|
35
|
+
let(:plaintext) { "p@assword" }
|
36
36
|
|
37
37
|
it "can be decrypted by powershell" do
|
38
38
|
encrypted = Chef::ReservedNames::Win32::Crypto.encrypt(plaintext)
|
@@ -25,7 +25,7 @@ describe "knife cookbook upload", :workstation do
|
|
25
25
|
|
26
26
|
include_context "default config options"
|
27
27
|
|
28
|
-
let
|
28
|
+
let(:cb_dir) { "#{@repository_dir}/cookbooks" }
|
29
29
|
|
30
30
|
when_the_chef_server "is empty" do
|
31
31
|
when_the_repository "has a cookbook" do
|
@@ -24,7 +24,7 @@ describe "knife data bag from file", :workstation do
|
|
24
24
|
|
25
25
|
include_context "default config options"
|
26
26
|
|
27
|
-
let
|
27
|
+
let(:db_dir) { "#{@repository_dir}/data_bags" }
|
28
28
|
|
29
29
|
when_the_chef_server "has an empty data bag" do
|
30
30
|
before do
|
@@ -24,7 +24,7 @@ describe "knife environment from file", :workstation do
|
|
24
24
|
|
25
25
|
# include_context "default config options"
|
26
26
|
|
27
|
-
let
|
27
|
+
let(:env_dir) { "#{@repository_dir}/environments" }
|
28
28
|
|
29
29
|
when_the_chef_server "is empty" do
|
30
30
|
when_the_repository "has some environments" do
|
@@ -24,7 +24,7 @@ describe "knife node from file", :workstation do
|
|
24
24
|
|
25
25
|
# include_context "default config options"
|
26
26
|
|
27
|
-
let
|
27
|
+
let(:node_dir) { "#{@repository_dir}/nodes" }
|
28
28
|
|
29
29
|
when_the_chef_server "is empty" do
|
30
30
|
when_the_repository "has some nodes" do
|
@@ -24,7 +24,7 @@ describe "knife role from file", :workstation do
|
|
24
24
|
|
25
25
|
# include_context "default config options"
|
26
26
|
|
27
|
-
let
|
27
|
+
let(:role_dir) { "#{@repository_dir}/roles" }
|
28
28
|
|
29
29
|
when_the_chef_server "is empty" do
|
30
30
|
when_the_repository "has some roles" do
|
@@ -1233,6 +1233,10 @@ describe "Recipe DSL methods" do
|
|
1233
1233
|
before { Namer.current_index += 1 }
|
1234
1234
|
|
1235
1235
|
context "with an LWRP that declares actions" do
|
1236
|
+
let(:run_context) do
|
1237
|
+
Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
1238
|
+
end
|
1239
|
+
|
1236
1240
|
let(:resource_class) do
|
1237
1241
|
Class.new(Chef::Resource::LWRPBase) do
|
1238
1242
|
provides :"recipe_dsl_spec#{Namer.current_index}"
|
@@ -119,10 +119,10 @@ describe "Resource.load_current_value" do
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
let
|
122
|
+
let(:subresource_name) do
|
123
123
|
:"load_current_value_subresource_dsl#{Namer.current_index}"
|
124
124
|
end
|
125
|
-
let
|
125
|
+
let(:subresource_class) do
|
126
126
|
r = Class.new(resource_class) do
|
127
127
|
property :y, default: lazy { "default_y #{Namer.incrementing_value}" }
|
128
128
|
end
|
@@ -19,7 +19,6 @@
|
|
19
19
|
#
|
20
20
|
|
21
21
|
require "etc"
|
22
|
-
require "functional/resource/base"
|
23
22
|
|
24
23
|
shared_context "setup correct permissions" do
|
25
24
|
if windows?
|
@@ -135,7 +134,7 @@ shared_context "use Windows permissions", :windows_only do
|
|
135
134
|
}
|
136
135
|
end
|
137
136
|
|
138
|
-
let
|
137
|
+
let(:write_flag) { 3 }
|
139
138
|
|
140
139
|
RSpec::Matchers.define :have_expected_properties do |mask, type, flags|
|
141
140
|
match do |ace|
|