chef 15.8.23 → 15.9.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/README.md +1 -1
  4. data/Rakefile +9 -0
  5. data/lib/chef/application.rb +1 -1
  6. data/lib/chef/chef_fs/chef_fs_data_store.rb +1 -1
  7. data/lib/chef/chef_fs/command_line.rb +5 -5
  8. data/lib/chef/cookbook/metadata.rb +5 -4
  9. data/lib/chef/cookbook/synchronizer.rb +1 -0
  10. data/lib/chef/cookbook_loader.rb +1 -1
  11. data/lib/chef/data_collector/config_validation.rb +7 -7
  12. data/lib/chef/deprecated.rb +5 -5
  13. data/lib/chef/dsl/platform_introspection.rb +2 -2
  14. data/lib/chef/dsl/reboot_pending.rb +3 -3
  15. data/lib/chef/http/json_output.rb +1 -1
  16. data/lib/chef/knife.rb +1 -1
  17. data/lib/chef/knife/bootstrap/templates/README.md +2 -2
  18. data/lib/chef/knife/bootstrap/templates/chef-full.erb +9 -9
  19. data/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb +2 -2
  20. data/lib/chef/knife/core/ui.rb +1 -1
  21. data/lib/chef/knife/core/windows_bootstrap_context.rb +8 -8
  22. data/lib/chef/knife/data_bag_edit.rb +2 -2
  23. data/lib/chef/knife/edit.rb +1 -1
  24. data/lib/chef/knife/environment_compare.rb +1 -1
  25. data/lib/chef/knife/list.rb +1 -1
  26. data/lib/chef/mixin/api_version_request_handling.rb +1 -1
  27. data/lib/chef/provider/group/usermod.rb +2 -5
  28. data/lib/chef/provider/mount/mount.rb +1 -1
  29. data/lib/chef/provider/package/homebrew.rb +1 -2
  30. data/lib/chef/provider/package/rubygems.rb +1 -1
  31. data/lib/chef/provider/package/yum/python_helper.rb +2 -2
  32. data/lib/chef/provider/package/yum/rpm_utils.rb +4 -4
  33. data/lib/chef/provider/package/zypper.rb +2 -1
  34. data/lib/chef/provider/remote_file.rb +2 -2
  35. data/lib/chef/provider/route.rb +4 -4
  36. data/lib/chef/provider/windows_env.rb +3 -3
  37. data/lib/chef/resource.rb +7 -2
  38. data/lib/chef/resource/build_essential.rb +46 -22
  39. data/lib/chef/resource/cron.rb +1 -1
  40. data/lib/chef/resource/cron_d.rb +1 -1
  41. data/lib/chef/resource/execute.rb +1 -1
  42. data/lib/chef/resource/freebsd_package.rb +0 -3
  43. data/lib/chef/resource/homebrew_package.rb +1 -2
  44. data/lib/chef/resource/hostname.rb +2 -2
  45. data/lib/chef/resource/kernel_module.rb +3 -2
  46. data/lib/chef/resource/openbsd_package.rb +0 -3
  47. data/lib/chef/resource/remote_file.rb +1 -1
  48. data/lib/chef/resource/rhsm_errata.rb +9 -2
  49. data/lib/chef/resource/rhsm_errata_level.rb +11 -5
  50. data/lib/chef/resource/rhsm_register.rb +27 -12
  51. data/lib/chef/resource/swap_file.rb +2 -2
  52. data/lib/chef/resource/timezone.rb +2 -2
  53. data/lib/chef/resource/windows_certificate.rb +0 -2
  54. data/lib/chef/resource/windows_share.rb +1 -1
  55. data/lib/chef/shell/ext.rb +1 -1
  56. data/lib/chef/util/diff.rb +3 -3
  57. data/lib/chef/util/selinux.rb +2 -2
  58. data/lib/chef/version.rb +1 -1
  59. data/lib/chef/win32/error.rb +1 -1
  60. data/lib/chef/win32/registry.rb +1 -1
  61. data/lib/chef/win32/system.rb +0 -0
  62. data/spec/data/cookbooks/starter/recipes/default.rb +1 -1
  63. data/spec/data/windows_certificates/base64_test.cer +18 -20
  64. data/spec/data/windows_certificates/othertest.cer +0 -0
  65. data/spec/data/windows_certificates/test.cer +0 -0
  66. data/spec/data/windows_certificates/test.p7b +0 -0
  67. data/spec/data/windows_certificates/test.pem +18 -19
  68. data/spec/data/windows_certificates/test.pfx +0 -0
  69. data/spec/functional/resource/ifconfig_spec.rb +2 -2
  70. data/spec/functional/resource/windows_certificate_spec.rb +9 -9
  71. data/spec/functional/resource/windows_service_spec.rb +1 -2
  72. data/spec/functional/run_lock_spec.rb +7 -1
  73. data/spec/functional/win32/service_manager_spec.rb +1 -1
  74. data/spec/functional/win32/version_info_spec.rb +4 -4
  75. data/spec/integration/client/client_spec.rb +2 -2
  76. data/spec/integration/client/exit_code_spec.rb +1 -0
  77. data/spec/integration/client/ipv6_spec.rb +1 -0
  78. data/spec/integration/knife/chef_fs_data_store_spec.rb +1 -0
  79. data/spec/integration/knife/chef_repo_path_spec.rb +1 -0
  80. data/spec/integration/knife/chef_repository_file_system_spec.rb +1 -0
  81. data/spec/integration/knife/chefignore_spec.rb +1 -0
  82. data/spec/integration/knife/client_bulk_delete_spec.rb +1 -0
  83. data/spec/integration/knife/client_create_spec.rb +1 -0
  84. data/spec/integration/knife/client_delete_spec.rb +1 -0
  85. data/spec/integration/knife/client_key_create_spec.rb +1 -0
  86. data/spec/integration/knife/client_key_delete_spec.rb +1 -0
  87. data/spec/integration/knife/client_key_list_spec.rb +1 -0
  88. data/spec/integration/knife/client_key_show_spec.rb +1 -0
  89. data/spec/integration/knife/client_list_spec.rb +1 -0
  90. data/spec/integration/knife/client_show_spec.rb +1 -0
  91. data/spec/integration/knife/common_options_spec.rb +1 -0
  92. data/spec/integration/knife/config_get_profile_spec.rb +1 -0
  93. data/spec/integration/knife/config_get_spec.rb +1 -0
  94. data/spec/integration/knife/config_list_profiles_spec.rb +1 -0
  95. data/spec/integration/knife/config_use_profile_spec.rb +1 -0
  96. data/spec/integration/knife/cookbook_api_ipv6_spec.rb +1 -0
  97. data/spec/integration/knife/cookbook_bulk_delete_spec.rb +1 -0
  98. data/spec/integration/knife/cookbook_download_spec.rb +1 -0
  99. data/spec/integration/knife/cookbook_list_spec.rb +1 -0
  100. data/spec/integration/knife/cookbook_show_spec.rb +1 -0
  101. data/spec/integration/knife/cookbook_upload_spec.rb +1 -0
  102. data/spec/integration/knife/data_bag_create_spec.rb +1 -0
  103. data/spec/integration/knife/data_bag_delete_spec.rb +1 -0
  104. data/spec/integration/knife/data_bag_edit_spec.rb +1 -0
  105. data/spec/integration/knife/data_bag_from_file_spec.rb +1 -0
  106. data/spec/integration/knife/data_bag_list_spec.rb +1 -0
  107. data/spec/integration/knife/data_bag_show_spec.rb +1 -0
  108. data/spec/integration/knife/delete_spec.rb +1 -0
  109. data/spec/integration/knife/deps_spec.rb +3 -2
  110. data/spec/integration/knife/diff_spec.rb +1 -0
  111. data/spec/integration/knife/download_spec.rb +1 -0
  112. data/spec/integration/knife/environment_compare_spec.rb +1 -0
  113. data/spec/integration/knife/environment_create_spec.rb +1 -0
  114. data/spec/integration/knife/environment_delete_spec.rb +1 -0
  115. data/spec/integration/knife/environment_from_file_spec.rb +1 -0
  116. data/spec/integration/knife/environment_list_spec.rb +1 -0
  117. data/spec/integration/knife/environment_show_spec.rb +1 -0
  118. data/spec/integration/knife/list_spec.rb +1 -0
  119. data/spec/integration/knife/node_bulk_delete_spec.rb +1 -0
  120. data/spec/integration/knife/node_create_spec.rb +1 -0
  121. data/spec/integration/knife/node_delete_spec.rb +1 -0
  122. data/spec/integration/knife/node_environment_set_spec.rb +1 -0
  123. data/spec/integration/knife/node_from_file_spec.rb +1 -0
  124. data/spec/integration/knife/node_list_spec.rb +1 -0
  125. data/spec/integration/knife/node_run_list_add_spec.rb +1 -0
  126. data/spec/integration/knife/node_run_list_remove_spec.rb +1 -0
  127. data/spec/integration/knife/node_run_list_set_spec.rb +1 -0
  128. data/spec/integration/knife/node_show_spec.rb +1 -0
  129. data/spec/integration/knife/raw_spec.rb +1 -0
  130. data/spec/integration/knife/redirection_spec.rb +1 -0
  131. data/spec/integration/knife/role_bulk_delete_spec.rb +1 -0
  132. data/spec/integration/knife/role_create_spec.rb +1 -0
  133. data/spec/integration/knife/role_delete_spec.rb +1 -0
  134. data/spec/integration/knife/role_from_file_spec.rb +1 -0
  135. data/spec/integration/knife/role_list_spec.rb +1 -0
  136. data/spec/integration/knife/role_show_spec.rb +1 -0
  137. data/spec/integration/knife/search_node_spec.rb +1 -0
  138. data/spec/integration/knife/show_spec.rb +1 -0
  139. data/spec/integration/knife/upload_spec.rb +1 -0
  140. data/spec/integration/recipes/accumulator_spec.rb +1 -0
  141. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +1 -0
  142. data/spec/integration/recipes/lwrp_spec.rb +1 -0
  143. data/spec/integration/recipes/notifies_spec.rb +1 -0
  144. data/spec/integration/recipes/notifying_block_spec.rb +1 -0
  145. data/spec/integration/recipes/recipe_dsl_spec.rb +1 -0
  146. data/spec/integration/recipes/resource_action_spec.rb +1 -0
  147. data/spec/integration/recipes/unified_mode_spec.rb +1 -0
  148. data/spec/integration/solo/solo_spec.rb +1 -0
  149. data/spec/spec_helper.rb +7 -10
  150. data/spec/support/chef_helpers.rb +1 -1
  151. data/spec/support/key_helpers.rb +0 -2
  152. data/spec/support/platform_helpers.rb +7 -3
  153. data/spec/support/platforms/win32/spec_service.rb +27 -25
  154. data/spec/support/shared/context/config.rb +0 -3
  155. data/spec/support/shared/integration/integration_helper.rb +0 -1
  156. data/spec/support/shared/unit/execute_resource.rb +0 -2
  157. data/spec/support/shared/unit/provider/file.rb +0 -1
  158. data/spec/support/shared/unit/script_resource.rb +2 -4
  159. data/spec/support/shared/unit/windows_script_resource.rb +0 -2
  160. data/spec/unit/cookbook/gem_installer_spec.rb +1 -1
  161. data/spec/unit/cookbook/metadata_spec.rb +1 -10
  162. data/spec/unit/data_collector_spec.rb +1 -1
  163. data/spec/unit/deprecated_spec.rb +3 -3
  164. data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +1 -1
  165. data/spec/unit/encrypted_data_bag_item_spec.rb +2 -2
  166. data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +3 -3
  167. data/spec/unit/knife_spec.rb +6 -7
  168. data/spec/unit/mixin/shell_out_spec.rb +27 -29
  169. data/spec/unit/provider/file_spec.rb +1 -0
  170. data/spec/unit/resource/build_essential_spec.rb +48 -2
  171. data/spec/unit/resource/data/InstallHistory_with_CLT.plist +92 -0
  172. data/spec/unit/resource/data/InstallHistory_without_CLT.plist +38 -0
  173. data/spec/unit/resource/execute_spec.rb +1 -1
  174. data/spec/unit/resource/rhsm_register_spec.rb +24 -0
  175. data/spec/unit/resource/windows_share_spec.rb +3 -1
  176. data/tasks/rspec.rb +1 -0
  177. metadata +8 -6
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: 2015-2018 Chef Software, Inc.
2
+ # Copyright:: 2015-2020 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +20,7 @@ require_relative "../resource"
20
20
  class Chef
21
21
  class Resource
22
22
  class RhsmErrata < Chef::Resource
23
+ unified_mode true
23
24
  resource_name :rhsm_errata
24
25
  provides(:rhsm_errata) { true }
25
26
 
@@ -36,11 +37,17 @@ class Chef
36
37
  description "Installs a package for a specific errata ID."
37
38
 
38
39
  execute "Install errata packages for #{new_resource.errata_id}" do
39
- command "yum update --advisory #{new_resource.errata_id} -y"
40
+ command "#{package_manager_command} update --advisory #{new_resource.errata_id} -y"
40
41
  default_env true
41
42
  action :run
42
43
  end
43
44
  end
45
+
46
+ action_class do
47
+ def package_manager_command
48
+ node["platform_version"].to_i >= 8 ? "dnf" : "yum"
49
+ end
50
+ end
44
51
  end
45
52
  end
46
53
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: 2015-2018 Chef Software, Inc.
2
+ # Copyright:: 2015-2020 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +20,7 @@ require_relative "../resource"
20
20
  class Chef
21
21
  class Resource
22
22
  class RhsmErrataLevel < Chef::Resource
23
+ unified_mode true
23
24
  resource_name :rhsm_errata_level
24
25
  provides(:rhsm_errata_level) { true }
25
26
 
@@ -35,17 +36,22 @@ class Chef
35
36
  action :install do
36
37
  description "Install all packages of the specified errata level."
37
38
 
38
- yum_package "yum-plugin-security" do
39
- action :install
40
- only_if { node["platform_version"].to_i == 6 }
39
+ if rhel6?
40
+ yum_package "yum-plugin-security"
41
41
  end
42
42
 
43
43
  execute "Install any #{new_resource.errata_level} errata" do
44
- command "yum update --sec-severity=#{new_resource.errata_level.capitalize} -y"
44
+ command "#{package_manager_command} update --sec-severity=#{new_resource.errata_level.capitalize} -y"
45
45
  default_env true
46
46
  action :run
47
47
  end
48
48
  end
49
+
50
+ action_class do
51
+ def package_manager_command
52
+ node["platform_version"].to_i >= 8 ? "dnf" : "yum"
53
+ end
54
+ end
49
55
  end
50
56
  end
51
57
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: 2015-2018 Chef Software, Inc.
2
+ # Copyright:: 2015-2020 Chef Software, Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,11 +16,13 @@
16
16
  #
17
17
 
18
18
  require_relative "../resource"
19
+ require_relative "../dist"
19
20
  require "shellwords" unless defined?(Shellwords)
20
21
 
21
22
  class Chef
22
23
  class Resource
23
24
  class RhsmRegister < Chef::Resource
25
+ unified_mode true
24
26
  resource_name :rhsm_register
25
27
  provides(:rhsm_register) { true }
26
28
 
@@ -60,25 +62,30 @@ class Chef
60
62
  description: "If true, the system will be registered even if it is already registered. Normally, any register operations will fail if the machine has already been registered.",
61
63
  default: false, desired_state: false
62
64
 
65
+ property :https_for_ca_consumer, [TrueClass, FalseClass],
66
+ description: "If true, #{Chef::Dist::PRODUCT} will fetch the katello-ca-consumer-latest.noarch.rpm from the satellite_host using HTTPS.",
67
+ default: false, desired_state: false,
68
+ introduced: "15.9"
69
+
63
70
  action :register do
64
71
  description "Register the node with RHSM."
65
72
 
66
73
  package "subscription-manager"
67
74
 
68
75
  unless new_resource.satellite_host.nil? || registered_with_rhsm?
69
- remote_file "#{Chef::Config[:file_cache_path]}/katello-package.rpm" do
70
- source "http://#{new_resource.satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm"
71
- action :create
72
- notifies :install, "yum_package[katello-ca-consumer-latest]", :immediately
73
- not_if { katello_cert_rpm_installed? }
74
- end
75
-
76
- yum_package "katello-ca-consumer-latest" do
76
+ declare_resource(package_resource, "katello-ca-consumer-latest") do
77
77
  options "--nogpgcheck"
78
78
  source "#{Chef::Config[:file_cache_path]}/katello-package.rpm"
79
79
  action :nothing
80
80
  end
81
81
 
82
+ remote_file "#{Chef::Config[:file_cache_path]}/katello-package.rpm" do
83
+ source ca_consumer_package_source
84
+ action :create
85
+ notifies :install, "#{package_resource}[katello-ca-consumer-latest]", :immediately
86
+ not_if { katello_cert_rpm_installed? }
87
+ end
88
+
82
89
  file "#{Chef::Config[:file_cache_path]}/katello-package.rpm" do
83
90
  action :delete
84
91
  end
@@ -92,9 +99,8 @@ class Chef
92
99
  not_if { registered_with_rhsm? } unless new_resource.force
93
100
  end
94
101
 
95
- yum_package "katello-agent" do
96
- action :install
97
- only_if { new_resource.install_katello_agent && !new_resource.satellite_host.nil? }
102
+ if new_resource.install_katello_agent && !new_resource.satellite_host.nil?
103
+ package "katello-agent"
98
104
  end
99
105
  end
100
106
 
@@ -117,6 +123,10 @@ class Chef
117
123
  end
118
124
 
119
125
  action_class do
126
+ def package_resource
127
+ node["platform_version"].to_i >= 8 ? :dnf_package : :yum_package
128
+ end
129
+
120
130
  def registered_with_rhsm?
121
131
  cmd = Mixlib::ShellOut.new("subscription-manager status", env: { LANG: "en_US" })
122
132
  cmd.run_command
@@ -129,6 +139,11 @@ class Chef
129
139
  !cmd.stdout.match(/katello-ca-consumer/).nil?
130
140
  end
131
141
 
142
+ def ca_consumer_package_source
143
+ protocol = new_resource.https_for_ca_consumer ? "https" : "http"
144
+ "#{protocol}://#{new_resource.satellite_host}/pub/katello-ca-consumer-latest.noarch.rpm"
145
+ end
146
+
132
147
  def register_command
133
148
  command = %w{subscription-manager register}
134
149
 
@@ -1,6 +1,6 @@
1
1
  #
2
- # Copyright 2012-2018, Seth Vargo
3
- # Copyright 2017-2018, Chef Software, Inc.
2
+ # Copyright:: 2012-2018, Seth Vargo
3
+ # Copyright:: 2017-2020, Chef Software, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
1
1
  #
2
2
  # Author:: Kirill Kouznetsov <agon.smith@gmail.com>
3
3
  #
4
- # Copyright 2018, Kirill Kouznetsov.
5
- # Copyright 2018, Chef Software, Inc.
4
+ # Copyright:: 2018, Kirill Kouznetsov.
5
+ # Copyright:: 2018-2020, Chef Software Inc.
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.
@@ -85,7 +85,6 @@ class Chef
85
85
  guard_script << cert_exists_script(hash)
86
86
 
87
87
  powershell_script "setting the acls on #{new_resource.source} in #{cert_location}\\#{new_resource.store_name}" do
88
- guard_interpreter :powershell_script
89
88
  convert_boolean_return true
90
89
  code code_script
91
90
  only_if guard_script
@@ -310,7 +309,6 @@ class Chef
310
309
  def import_certificates(cert_objs, is_pfx)
311
310
  [cert_objs].flatten.each do |cert_obj|
312
311
  thumbprint = OpenSSL::Digest::SHA1.new(cert_obj.to_der).to_s # Fetch its thumbprint
313
-
314
312
  # Need to check if return value is Boolean:true
315
313
  # If not then the given certificate should be added in certstore
316
314
  if verify_cert(thumbprint) == true
@@ -39,7 +39,7 @@ class Chef
39
39
  # Specifies the path of the location of the folder to share. The path must be fully qualified. Relative paths or paths that contain wildcard characters are not permitted.
40
40
  property :path, String,
41
41
  description: "The path of the folder to share. Required when creating. If the share already exists on a different path then it is deleted and re-created.",
42
- coerce: proc { |p| p.gsub!(%r{/}, "\\") || p }
42
+ coerce: proc { |p| p.gsub(%r{/}, "\\") || p }
43
43
 
44
44
  # Specifies an optional description of the SMB share. A description of the share is displayed by running the Get-SmbShare cmdlet. The description may not contain more than 256 characters.
45
45
  property :description, String,
@@ -211,7 +211,7 @@ module Shell
211
211
  desc "prints information about #{Chef::Dist::PRODUCT}"
212
212
  def version
213
213
  puts "Welcome to the #{Chef::Dist::SHELL} #{::Chef::VERSION}\n" +
214
- "For usage see https://docs.chef.io/chef_shell.html"
214
+ "For usage see https://docs.chef.io/chef_shell/"
215
215
  :ucanhaz_automation
216
216
  end
217
217
  alias :shell :version
@@ -152,14 +152,14 @@ class Chef
152
152
 
153
153
  if !diff_str.empty? && diff_str != "No differences encountered\n"
154
154
  if diff_str.length > diff_output_threshold
155
- return "(long diff of over #{diff_output_threshold} characters, diff output suppressed)"
155
+ "(long diff of over #{diff_output_threshold} characters, diff output suppressed)"
156
156
  else
157
157
  diff_str = encode_diff_for_json(diff_str)
158
158
  @diff = diff_str.split("\n")
159
- return "(diff available)"
159
+ "(diff available)"
160
160
  end
161
161
  else
162
- return "(no diff)"
162
+ "(no diff)"
163
163
  end
164
164
  end
165
165
 
@@ -75,9 +75,9 @@ class Chef
75
75
  cmd = shell_out!(selinuxenabled_path, returns: [0, 1])
76
76
  case cmd.exitstatus
77
77
  when 1
78
- return false
78
+ false
79
79
  when 0
80
- return true
80
+ true
81
81
  else
82
82
  raise "Unknown exit code from command #{selinuxenabled_path}: #{cmd.exitstatus}"
83
83
  end
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("../..", __FILE__)
26
- VERSION = Chef::VersionString.new("15.8.23")
26
+ VERSION = Chef::VersionString.new("15.9.17")
27
27
  end
28
28
 
29
29
  #
@@ -50,7 +50,7 @@ class Chef
50
50
 
51
51
  # Extract the string
52
52
  begin
53
- return buffer.read_pointer.read_wstring(num_chars)
53
+ buffer.read_pointer.read_wstring(num_chars)
54
54
  ensure
55
55
  Chef::ReservedNames::Win32::Memory.local_free(buffer.read_pointer)
56
56
  end
@@ -154,7 +154,7 @@ class Chef
154
154
  return true
155
155
  end
156
156
  rescue ::Win32::Registry::Error => e
157
- return false
157
+ false
158
158
  end
159
159
  end
160
160
 
File without changes
@@ -1,4 +1,4 @@
1
1
  # This is a Chef recipe file. It can be used to specify resources which will
2
2
  # apply configuration to a server.
3
3
 
4
- # For more information, see the documentation: https://docs.chef.io/essentials_cookbook_recipes.html
4
+ # For more information, see the documentation: https://docs.chef.io/recipes/
@@ -1,22 +1,20 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDjjCCAnagAwIBAgIQNH6iXZnEKbFOEQ7D9f9iCTANBgkqhkiG9w0BAQsFADBK
3
- MSMwIQYDVQQDDBpBIEJhc2U2NCBEdW1teSBDZXJ0aWZpY2F0ZTEjMCEGCSqGSIb3
4
- DQEJARYUdGVzdGJ5cnNwZWNAY2hlZi5jb20wHhcNMTkwMjEyMDk1ODM2WhcNMjAw
5
- MjEyMTAxODM2WjBKMSMwIQYDVQQDDBpBIEJhc2U2NCBEdW1teSBDZXJ0aWZpY2F0
6
- ZTEjMCEGCSqGSIb3DQEJARYUdGVzdGJ5cnNwZWNAY2hlZi5jb20wggEiMA0GCSqG
7
- SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSy2Qlf2k1X3y/YgEjnvD0K8NeKgXKKi62
8
- RHRMTJ2+6KSg+I1MqHZC+BVrfzehuJVby5kM7tGLF8FvM3q7X/5oSPg8pvLZzIV0
9
- pBrpVPCTYw8fnlmFKBt/+m2XOqsWyL59yP+p66SHAKmoLYTGu8dkGvgJn3dwKNen
10
- VFmwadteVfKs2wFW/ZwUxH4aLloCa8KSyqstIXrYQmdqqFOSuEgkynalD19dozSv
11
- QtkQ9FZPuFGDwNpdO7OrcjE1lTUlzuth7CqV/pj4GYJhK/PPtO8Ing/BtwZm5XB8
12
- 2yvvLVnL7Y/hikg2ENKA9fOYk52zR/kkd7d8qoJva7WlYEXTZvpdAgMBAAGjcDBu
13
- MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEw
14
- HgYDVR0RBBcwFYITd3d3LnRlc3RieXJzcGVjLmNvbTAdBgNVHQ4EFgQUuL1l247K
15
- h+cVH9LehmQgXuV8F6MwDQYJKoZIhvcNAQELBQADggEBAMTJ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chef Software Inc.
3
+ # Copyright:: Copyright 2013-2020, Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,7 +23,7 @@ require "chef/mixin/shell_out"
23
23
  # run this test only for following platforms.
24
24
  include_flag = !(%w{amazon debian aix}.include?(ohai[:platform_family]) || (ohai[:platform_family] == "rhel" && ohai[:platform_version].to_i < 7))
25
25
 
26
- describe Chef::Resource::Ifconfig, :requires_root, external: include_flag do
26
+ describe Chef::Resource::Ifconfig, :requires_root, :requires_ifconfig, external: include_flag do
27
27
  include Chef::Mixin::ShellOut
28
28
 
29
29
  let(:new_resource) do
@@ -47,7 +47,7 @@ module WindowsCertificateHelper
47
47
  end
48
48
  end
49
49
 
50
- describe Chef::Resource::WindowsCertificate, :windows_only, :appveyor_only do
50
+ describe Chef::Resource::WindowsCertificate, :windows_only do
51
51
  include WindowsCertificateHelper
52
52
 
53
53
  let(:stdout) { StringIO.new }
@@ -65,11 +65,11 @@ describe Chef::Resource::WindowsCertificate, :windows_only, :appveyor_only do
65
65
  let(:p7b_path) { File.join(certificate_path, "test.p7b") }
66
66
  let(:pfx_path) { File.join(certificate_path, "test.pfx") }
67
67
  let(:out_path) { File.join(certificate_path, "testout.pem") }
68
- let(:tests_thumbprint) { "3180B3E3217862600BD7B2D28067B03D41576A4F" }
68
+ let(:tests_thumbprint) { "e45a4a7ff731e143cf20b8bfb9c7c4edd5238bb3" }
69
69
  let(:other_cer_path) { File.join(certificate_path, "othertest.cer") }
70
- let(:others_thumbprint) { "AD393859B2D2D4161D224F16CBD3D16555753A20" }
71
- let(:p7b_thumbprint) { "50954A52DDFA2043F36EA9026FDD95EC252048D0" }
72
- let(:p7b_nested_thumbprint) { "4A3333FC4E1274995AF5A95810881C86F2DF7FBD" }
70
+ let(:others_thumbprint) { "6eae1deefaf59daf1a97c9ceeff39c98b3da38cb" }
71
+ let(:p7b_thumbprint) { "f867e25b928061318ed2c36ca517681774b06260" }
72
+ let(:p7b_nested_thumbprint) { "dc395eae6be5b69951b8b6e1090cfc33df30d2cd" }
73
73
 
74
74
  before do
75
75
  opts = { store_name: store }
@@ -221,7 +221,7 @@ describe Chef::Resource::WindowsCertificate, :windows_only, :appveyor_only do
221
221
  expect(win_certificate).not_to be_updated_by_last_action
222
222
  end
223
223
  it "Nested certificates are also imported" do
224
- expect(no_of_certificates).to eq(2)
224
+ expect(no_of_certificates).to eq(3)
225
225
  end
226
226
  end
227
227
 
@@ -322,7 +322,7 @@ describe Chef::Resource::WindowsCertificate, :windows_only, :appveyor_only do
322
322
  win_certificate.run_action(:verify)
323
323
  end
324
324
  it "Initial check if certificate is present" do
325
- expect(no_of_certificates).to eq(2)
325
+ expect(no_of_certificates).to eq(3)
326
326
  end
327
327
  it "Displays correct message" do
328
328
  expect(stdout.string.strip).to eq("Certificate is valid")
@@ -338,7 +338,7 @@ describe Chef::Resource::WindowsCertificate, :windows_only, :appveyor_only do
338
338
  win_certificate.run_action(:verify)
339
339
  end
340
340
  it "Initial check if certificate is present" do
341
- expect(no_of_certificates).to eq(2)
341
+ expect(no_of_certificates).to eq(3)
342
342
  end
343
343
  it "Displays correct message" do
344
344
  expect(stdout.string.strip).to eq("Certificate is valid")
@@ -354,7 +354,7 @@ describe Chef::Resource::WindowsCertificate, :windows_only, :appveyor_only do
354
354
  win_certificate.run_action(:verify)
355
355
  end
356
356
  it "Initial check if certificate is present" do
357
- expect(no_of_certificates).to eq(2)
357
+ expect(no_of_certificates).to eq(3)
358
358
  end
359
359
  it "Displays correct message" do
360
360
  expect(stdout.string.strip).to eq("Certificate not found")