chef 16.7.61-universal-mingw32 → 16.9.20-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -5
- data/README.md +2 -2
- data/chef.gemspec +12 -2
- data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
- data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
- data/distro/ruby_bin_folder/x86/Chef.PowerShell.dll +0 -0
- data/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
- data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
- data/lib/chef/application/base.rb +1 -1
- data/lib/chef/client.rb +3 -0
- data/lib/chef/compliance/default_attributes.rb +93 -0
- data/lib/chef/compliance/fetcher/automate.rb +69 -0
- data/lib/chef/compliance/fetcher/chef_server.rb +134 -0
- data/lib/chef/compliance/reporter/automate.rb +201 -0
- data/lib/chef/compliance/reporter/chef_server_automate.rb +94 -0
- data/lib/chef/compliance/reporter/compliance_enforcer.rb +20 -0
- data/lib/chef/compliance/reporter/json_file.rb +19 -0
- data/lib/chef/compliance/runner.rb +262 -0
- data/lib/chef/cookbook_manifest.rb +1 -0
- data/lib/chef/encrypted_data_bag_item/assertions.rb +1 -1
- data/lib/chef/exceptions.rb +4 -0
- data/lib/chef/http/ssl_policies.rb +33 -14
- data/lib/chef/knife/bootstrap/train_connector.rb +1 -1
- data/lib/chef/knife/core/formatting_options.rb +49 -0
- data/lib/chef/knife/core/node_presenter.rb +0 -25
- data/lib/chef/knife/core/status_presenter.rb +1 -26
- data/lib/chef/knife/core/ui.rb +4 -1
- data/lib/chef/knife/core/windows_bootstrap_context.rb +1 -1
- data/lib/chef/knife/node_show.rb +2 -1
- data/lib/chef/knife/search.rb +2 -1
- data/lib/chef/knife/ssh.rb +3 -1
- data/lib/chef/knife/status.rb +8 -11
- data/lib/chef/mixin/powershell_exec.rb +3 -1
- data/lib/chef/platform/query_helpers.rb +4 -4
- data/lib/chef/policy_builder/policyfile.rb +1 -1
- data/lib/chef/powershell.rb +2 -0
- data/lib/chef/provider/dsc_resource.rb +12 -24
- data/lib/chef/provider/dsc_script.rb +16 -20
- data/lib/chef/provider/git.rb +5 -5
- data/lib/chef/provider/package.rb +53 -19
- data/lib/chef/provider/package/dnf.rb +39 -12
- data/lib/chef/provider/package/dnf/dnf_helper.py +18 -5
- data/lib/chef/provider/package/dnf/python_helper.rb +6 -6
- data/lib/chef/provider/package/freebsd/pkgng.rb +3 -1
- data/lib/chef/provider/yum_repository.rb +2 -2
- data/lib/chef/resource/chef_client_config.rb +1 -1
- data/lib/chef/resource/chef_gem.rb +2 -2
- data/lib/chef/resource/cron/cron_d.rb +1 -0
- data/lib/chef/resource/dsc_script.rb +8 -1
- data/lib/chef/resource/file.rb +1 -1
- data/lib/chef/resource/gem_package.rb +2 -2
- data/lib/chef/resource/homebrew_cask.rb +3 -3
- data/lib/chef/resource/hostname.rb +3 -3
- data/lib/chef/resource/http_request.rb +1 -1
- data/lib/chef/resource/locale.rb +1 -1
- data/lib/chef/resource/mdadm.rb +2 -2
- data/lib/chef/resource/osx_profile.rb +7 -7
- data/lib/chef/resource/remote_directory.rb +1 -1
- data/lib/chef/resource/ruby.rb +1 -5
- data/lib/chef/resource/ruby_block.rb +1 -1
- data/lib/chef/resource/template.rb +2 -2
- data/lib/chef/resource/user/windows_user.rb +5 -0
- data/lib/chef/resource/windows_certificate.rb +9 -13
- data/lib/chef/resource/yum_repository.rb +5 -0
- data/lib/chef/resource_collection/resource_set.rb +1 -1
- data/lib/chef/util/dsc/configuration_generator.rb +52 -11
- data/lib/chef/util/dsc/lcm_output_parser.rb +3 -4
- data/lib/chef/util/dsc/local_configuration_manager.rb +17 -14
- data/lib/chef/util/dsc/resource_store.rb +5 -11
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/api/file.rb +4 -0
- data/spec/data/rubygems.org/latest_specs.4.8.gz +0 -0
- data/spec/data/rubygems.org/nonexistent_gem +0 -0
- data/spec/data/rubygems.org/sexp_processor +0 -0
- data/spec/data/rubygems.org/sexp_processor-4.15.1.gemspec.rz +0 -0
- data/spec/data/ssl/binary/chef-rspec-der.cert +0 -0
- data/spec/data/ssl/binary/chef-rspec-der.key +0 -0
- data/spec/functional/resource/dnf_package_spec.rb +319 -16
- data/spec/functional/resource/dsc_script_spec.rb +3 -6
- data/spec/functional/resource/windows_certificate_spec.rb +204 -384
- data/spec/integration/client/client_spec.rb +2 -1
- data/spec/integration/compliance/compliance_spec.rb +81 -0
- data/spec/integration/recipes/recipe_dsl_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/client_spec.rb +1 -0
- data/spec/unit/compliance/fetcher/automate_spec.rb +134 -0
- data/spec/unit/compliance/fetcher/chef_server_spec.rb +93 -0
- data/spec/unit/compliance/reporter/automate_spec.rb +427 -0
- data/spec/unit/compliance/reporter/chef_server_automate_spec.rb +177 -0
- data/spec/unit/compliance/reporter/compliance_enforcer_spec.rb +48 -0
- data/spec/unit/compliance/runner_spec.rb +167 -0
- data/spec/unit/http/ssl_policies_spec.rb +107 -68
- data/spec/unit/knife/bootstrap_spec.rb +5 -17
- data/spec/unit/knife/core/node_editor_spec.rb +1 -1
- data/spec/unit/knife/core/status_presenter_spec.rb +54 -0
- data/spec/unit/mixin/openssl_helper_spec.rb +0 -7
- data/spec/unit/mixin/powershell_exec_spec.rb +1 -1
- data/spec/unit/platform/query_helpers_spec.rb +11 -12
- data/spec/unit/provider/dsc_resource_spec.rb +10 -27
- data/spec/unit/provider/dsc_script_spec.rb +1 -1
- data/spec/unit/provider/mount/windows_spec.rb +1 -0
- data/spec/unit/provider/package/freebsd/pkgng_spec.rb +1 -1
- data/spec/unit/provider/package/rubygems_spec.rb +39 -7
- data/spec/unit/provider/systemd_unit_spec.rb +1 -1
- data/spec/unit/resource/user/windows_user_spec.rb +36 -0
- data/spec/unit/resource/windows_certificate_spec.rb +12 -0
- data/spec/unit/util/dsc/configuration_generator_spec.rb +79 -0
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +27 -35
- metadata +55 -18
- data/lib/chef/util/powershell/cmdlet.rb +0 -169
- data/lib/chef/util/powershell/cmdlet_result.rb +0 -61
- data/spec/data/trusted_certs_empty/.gitkeep +0 -0
- data/spec/data/trusted_certs_empty/README.md +0 -1
- data/spec/functional/util/powershell/cmdlet_spec.rb +0 -111
- data/spec/scripts/ssl-serve.rb +0 -47
- data/spec/unit/util/powershell/cmdlet_spec.rb +0 -106
data/lib/chef/win32/api/file.rb
CHANGED
@@ -316,6 +316,7 @@ typedef struct _REPARSE_DATA_BUFFER {
|
|
316
316
|
string_pointer.read_wstring(self[:PrintNameLength] / 2)
|
317
317
|
end
|
318
318
|
end
|
319
|
+
|
319
320
|
class REPARSE_DATA_BUFFER_MOUNT_POINT < FFI::Struct
|
320
321
|
layout :SubstituteNameOffset, :ushort,
|
321
322
|
:SubstituteNameLength, :ushort,
|
@@ -333,14 +334,17 @@ typedef struct _REPARSE_DATA_BUFFER {
|
|
333
334
|
string_pointer.read_wstring(self[:PrintNameLength] / 2)
|
334
335
|
end
|
335
336
|
end
|
337
|
+
|
336
338
|
class REPARSE_DATA_BUFFER_GENERIC < FFI::Struct
|
337
339
|
layout :DataBuffer, :uchar
|
338
340
|
end
|
341
|
+
|
339
342
|
class REPARSE_DATA_BUFFER_UNION < FFI::Union
|
340
343
|
layout :SymbolicLinkReparseBuffer, REPARSE_DATA_BUFFER_SYMBOLIC_LINK,
|
341
344
|
:MountPointReparseBuffer, REPARSE_DATA_BUFFER_MOUNT_POINT,
|
342
345
|
:GenericReparseBuffer, REPARSE_DATA_BUFFER_GENERIC
|
343
346
|
end
|
347
|
+
|
344
348
|
class REPARSE_DATA_BUFFER < FFI::Struct
|
345
349
|
layout :ReparseTag, :uint32,
|
346
350
|
:ReparseDataLength, :ushort,
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -91,7 +91,6 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
91
91
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
92
92
|
dnf_package.run_action(:install)
|
93
93
|
expect(dnf_package.updated_by_last_action?).to be false
|
94
|
-
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
95
94
|
end
|
96
95
|
|
97
96
|
it "does not install twice" do
|
@@ -128,6 +127,105 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
128
127
|
end
|
129
128
|
end
|
130
129
|
|
130
|
+
context "expanded idempotency checks with version variants" do
|
131
|
+
%w{1.10 1* 1.10-1 1*-1 1.10-* 1*-* 0:1.10 0:1* 0:1.10-1 0:1*-1 *:1.10-* *:1*-*}.each do |vstring|
|
132
|
+
it "installs the rpm when #{vstring} is in the package_name" do
|
133
|
+
flush_cache
|
134
|
+
dnf_package.package_name("chef_rpm-#{vstring}")
|
135
|
+
dnf_package.run_action(:install)
|
136
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
137
|
+
end
|
138
|
+
|
139
|
+
it "is idempotent when #{vstring} is in the package_name" do
|
140
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
141
|
+
dnf_package.package_name("chef_rpm-#{vstring}")
|
142
|
+
dnf_package.run_action(:install)
|
143
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
144
|
+
end
|
145
|
+
|
146
|
+
it "installs the rpm when #{vstring} is in the version property" do
|
147
|
+
flush_cache
|
148
|
+
dnf_package.package_name("chef_rpm")
|
149
|
+
dnf_package.version(vstring)
|
150
|
+
dnf_package.run_action(:install)
|
151
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
152
|
+
end
|
153
|
+
|
154
|
+
it "is idempotent when #{vstring} is in the version property" do
|
155
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
156
|
+
dnf_package.package_name("chef_rpm")
|
157
|
+
dnf_package.version(vstring)
|
158
|
+
dnf_package.run_action(:install)
|
159
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
160
|
+
end
|
161
|
+
|
162
|
+
it "upgrades the rpm when #{vstring} is in the package_name" do
|
163
|
+
flush_cache
|
164
|
+
dnf_package.package_name("chef_rpm-#{vstring}")
|
165
|
+
dnf_package.run_action(:upgrade)
|
166
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
167
|
+
end
|
168
|
+
|
169
|
+
it "is idempotent when #{vstring} is in the package_name" do
|
170
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
171
|
+
dnf_package.package_name("chef_rpm-#{vstring}")
|
172
|
+
dnf_package.run_action(:upgrade)
|
173
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
174
|
+
end
|
175
|
+
|
176
|
+
it "upgrades the rpm when #{vstring} is in the version property" do
|
177
|
+
flush_cache
|
178
|
+
dnf_package.package_name("chef_rpm")
|
179
|
+
dnf_package.version(vstring)
|
180
|
+
dnf_package.run_action(:upgrade)
|
181
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
182
|
+
end
|
183
|
+
|
184
|
+
it "is idempotent when #{vstring} is in the version property" do
|
185
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
186
|
+
dnf_package.package_name("chef_rpm")
|
187
|
+
dnf_package.version(vstring)
|
188
|
+
dnf_package.run_action(:upgrade)
|
189
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
%w{1.2 1* 1.2-1 1*-1 1.2-* 1*-* 0:1.2 0:1* 0:1.2-1 0:1*-1 *:1.2-* *:1*-*}.each do |vstring|
|
194
|
+
it "is idempotent when #{vstring} is in the version property and there is a candidate version" do
|
195
|
+
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
196
|
+
dnf_package.package_name("chef_rpm")
|
197
|
+
dnf_package.version(vstring)
|
198
|
+
dnf_package.run_action(:install)
|
199
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
200
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
%w{1.2 1.2-1 1.2-* 0:1.2 0:1.2-1 *:1.2-*}.each do |vstring|
|
205
|
+
it "is idempotent when #{vstring} is in the version property on upgrade and it doesn't match the candidate version" do
|
206
|
+
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
207
|
+
dnf_package.package_name("chef_rpm")
|
208
|
+
dnf_package.version(vstring)
|
209
|
+
dnf_package.run_action(:upgrade)
|
210
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
211
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
%w{1* 1*-1 1*-* 0:1* 0:1*-1 *:1*-*}.each do |vstring|
|
216
|
+
it "upgrades when #{vstring} is in the version property on upgrade and it matches the candidate version" do
|
217
|
+
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
218
|
+
dnf_package.package_name("chef_rpm")
|
219
|
+
dnf_package.version(vstring)
|
220
|
+
dnf_package.run_action(:upgrade)
|
221
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
222
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
223
|
+
dnf_package.run_action(:upgrade)
|
224
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
131
229
|
context "with versions or globs in the name" do
|
132
230
|
it "works with a version" do
|
133
231
|
flush_cache
|
@@ -135,6 +233,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
135
233
|
dnf_package.run_action(:install)
|
136
234
|
expect(dnf_package.updated_by_last_action?).to be true
|
137
235
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
236
|
+
dnf_package.run_action(:install)
|
237
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
138
238
|
end
|
139
239
|
|
140
240
|
it "works with an older version" do
|
@@ -143,6 +243,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
143
243
|
dnf_package.run_action(:install)
|
144
244
|
expect(dnf_package.updated_by_last_action?).to be true
|
145
245
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
246
|
+
dnf_package.run_action(:install)
|
247
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
146
248
|
end
|
147
249
|
|
148
250
|
it "works with an evra" do
|
@@ -151,6 +253,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
151
253
|
dnf_package.run_action(:install)
|
152
254
|
expect(dnf_package.updated_by_last_action?).to be true
|
153
255
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
256
|
+
dnf_package.run_action(:install)
|
257
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
154
258
|
end
|
155
259
|
|
156
260
|
it "works with version and release" do
|
@@ -159,6 +263,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
159
263
|
dnf_package.run_action(:install)
|
160
264
|
expect(dnf_package.updated_by_last_action?).to be true
|
161
265
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
266
|
+
dnf_package.run_action(:install)
|
267
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
162
268
|
end
|
163
269
|
|
164
270
|
it "works with a version glob" do
|
@@ -167,6 +273,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
167
273
|
dnf_package.run_action(:install)
|
168
274
|
expect(dnf_package.updated_by_last_action?).to be true
|
169
275
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
276
|
+
dnf_package.run_action(:install)
|
277
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
170
278
|
end
|
171
279
|
|
172
280
|
it "works with a name glob + version glob" do
|
@@ -175,6 +283,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
175
283
|
dnf_package.run_action(:install)
|
176
284
|
expect(dnf_package.updated_by_last_action?).to be true
|
177
285
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
286
|
+
dnf_package.run_action(:install)
|
287
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
178
288
|
end
|
179
289
|
|
180
290
|
it "upgrades when the installed version does not match the version string" do
|
@@ -183,6 +293,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
183
293
|
dnf_package.run_action(:install)
|
184
294
|
expect(dnf_package.updated_by_last_action?).to be true
|
185
295
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}")
|
296
|
+
dnf_package.run_action(:install)
|
297
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
186
298
|
end
|
187
299
|
|
188
300
|
it "downgrades when the installed version is higher than the package_name version" do
|
@@ -191,6 +303,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
191
303
|
dnf_package.run_action(:install)
|
192
304
|
expect(dnf_package.updated_by_last_action?).to be true
|
193
305
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
306
|
+
dnf_package.run_action(:install)
|
307
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
194
308
|
end
|
195
309
|
end
|
196
310
|
|
@@ -203,6 +317,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
203
317
|
dnf_package.run_action(:install)
|
204
318
|
expect(dnf_package.updated_by_last_action?).to be true
|
205
319
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
320
|
+
dnf_package.run_action(:install)
|
321
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
206
322
|
end
|
207
323
|
|
208
324
|
it "matches with a glob" do
|
@@ -212,6 +328,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
212
328
|
dnf_package.run_action(:install)
|
213
329
|
expect(dnf_package.updated_by_last_action?).to be true
|
214
330
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
331
|
+
dnf_package.run_action(:install)
|
332
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
215
333
|
end
|
216
334
|
|
217
335
|
it "matches the vr" do
|
@@ -221,6 +339,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
221
339
|
dnf_package.run_action(:install)
|
222
340
|
expect(dnf_package.updated_by_last_action?).to be true
|
223
341
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
342
|
+
dnf_package.run_action(:install)
|
343
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
224
344
|
end
|
225
345
|
|
226
346
|
it "matches the evr" do
|
@@ -230,6 +350,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
230
350
|
dnf_package.run_action(:install)
|
231
351
|
expect(dnf_package.updated_by_last_action?).to be true
|
232
352
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
353
|
+
dnf_package.run_action(:install)
|
354
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
233
355
|
end
|
234
356
|
|
235
357
|
it "matches with a vr glob", :rhel_gte_8 do
|
@@ -239,6 +361,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
239
361
|
dnf_package.run_action(:install)
|
240
362
|
expect(dnf_package.updated_by_last_action?).to be true
|
241
363
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
364
|
+
dnf_package.run_action(:install)
|
365
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
242
366
|
end
|
243
367
|
|
244
368
|
it "matches with an evr glob", :rhel_gte_8 do
|
@@ -248,6 +372,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
248
372
|
dnf_package.run_action(:install)
|
249
373
|
expect(dnf_package.updated_by_last_action?).to be true
|
250
374
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
375
|
+
dnf_package.run_action(:install)
|
376
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
251
377
|
end
|
252
378
|
end
|
253
379
|
|
@@ -260,6 +386,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
260
386
|
dnf_package.run_action(:install)
|
261
387
|
expect(dnf_package.updated_by_last_action?).to be true
|
262
388
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
389
|
+
dnf_package.run_action(:install)
|
390
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
263
391
|
end
|
264
392
|
end
|
265
393
|
|
@@ -270,6 +398,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
270
398
|
dnf_package.run_action(:install)
|
271
399
|
expect(dnf_package.updated_by_last_action?).to be true
|
272
400
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
401
|
+
dnf_package.run_action(:install)
|
402
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
273
403
|
end
|
274
404
|
|
275
405
|
it "installs with 32-bit arch in the name" do
|
@@ -278,6 +408,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
278
408
|
dnf_package.run_action(:install)
|
279
409
|
expect(dnf_package.updated_by_last_action?).to be true
|
280
410
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
411
|
+
dnf_package.run_action(:install)
|
412
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
281
413
|
end
|
282
414
|
|
283
415
|
it "installs with 64-bit arch in the property" do
|
@@ -287,6 +419,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
287
419
|
dnf_package.run_action(:install)
|
288
420
|
expect(dnf_package.updated_by_last_action?).to be true
|
289
421
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
422
|
+
dnf_package.run_action(:install)
|
423
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
290
424
|
end
|
291
425
|
|
292
426
|
it "installs with 32-bit arch in the property" do
|
@@ -296,6 +430,30 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
296
430
|
dnf_package.run_action(:install)
|
297
431
|
expect(dnf_package.updated_by_last_action?).to be true
|
298
432
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
433
|
+
dnf_package.run_action(:install)
|
434
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
435
|
+
end
|
436
|
+
|
437
|
+
it "installs when the 32-bit arch is in the name and the version is in the property" do
|
438
|
+
flush_cache
|
439
|
+
dnf_package.package_name("chef_rpm.i686")
|
440
|
+
dnf_package.version("1.10-1")
|
441
|
+
dnf_package.run_action(:install)
|
442
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
443
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.i686$")
|
444
|
+
dnf_package.run_action(:install)
|
445
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
446
|
+
end
|
447
|
+
|
448
|
+
it "installs when the 64-bit arch is in the name and the version is in the property" do
|
449
|
+
flush_cache
|
450
|
+
dnf_package.package_name("chef_rpm.#{pkg_arch}")
|
451
|
+
dnf_package.version("1.10-1")
|
452
|
+
dnf_package.run_action(:install)
|
453
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
454
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
455
|
+
dnf_package.run_action(:install)
|
456
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
299
457
|
end
|
300
458
|
end
|
301
459
|
|
@@ -306,6 +464,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
306
464
|
dnf_package.run_action(:install)
|
307
465
|
expect(dnf_package.updated_by_last_action?).to be true
|
308
466
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
467
|
+
dnf_package.run_action(:install)
|
468
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
309
469
|
end
|
310
470
|
|
311
471
|
it "when it is met, it does nothing" do
|
@@ -330,6 +490,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
330
490
|
dnf_package.run_action(:install)
|
331
491
|
expect(dnf_package.updated_by_last_action?).to be true
|
332
492
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
493
|
+
dnf_package.run_action(:install)
|
494
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
333
495
|
end
|
334
496
|
|
335
497
|
it "when it is not met by an installed rpm, it upgrades" do
|
@@ -338,6 +500,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
338
500
|
dnf_package.run_action(:install)
|
339
501
|
expect(dnf_package.updated_by_last_action?).to be true
|
340
502
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
503
|
+
dnf_package.run_action(:install)
|
504
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
341
505
|
end
|
342
506
|
|
343
507
|
it "with an equality constraint, when it is not met by an installed rpm, it upgrades" do
|
@@ -346,6 +510,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
346
510
|
dnf_package.run_action(:install)
|
347
511
|
expect(dnf_package.updated_by_last_action?).to be true
|
348
512
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
513
|
+
dnf_package.run_action(:install)
|
514
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
349
515
|
end
|
350
516
|
|
351
517
|
it "with an equality constraint, when it is met by an installed rpm, it does nothing" do
|
@@ -382,6 +548,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
382
548
|
dnf_package.run_action(:install)
|
383
549
|
expect(dnf_package.updated_by_last_action?).to be true
|
384
550
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
551
|
+
dnf_package.run_action(:install)
|
552
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
385
553
|
end
|
386
554
|
|
387
555
|
it "with a less than constraint, when the install version matches, it does nothing" do
|
@@ -398,6 +566,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
398
566
|
dnf_package.run_action(:install)
|
399
567
|
expect(dnf_package.updated_by_last_action?).to be true
|
400
568
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
569
|
+
dnf_package.run_action(:install)
|
570
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
401
571
|
end
|
402
572
|
end
|
403
573
|
|
@@ -424,6 +594,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
424
594
|
dnf_package.run_action(:install)
|
425
595
|
expect(dnf_package.updated_by_last_action?).to be true
|
426
596
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
597
|
+
dnf_package.run_action(:install)
|
598
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
427
599
|
end
|
428
600
|
|
429
601
|
it "installs the package when the name is a path to a file" do
|
@@ -432,6 +604,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
432
604
|
dnf_package.run_action(:install)
|
433
605
|
expect(dnf_package.updated_by_last_action?).to be true
|
434
606
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
607
|
+
dnf_package.run_action(:install)
|
608
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
435
609
|
end
|
436
610
|
|
437
611
|
it "downgrade on a local file with allow_downgrade true works" do
|
@@ -441,6 +615,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
441
615
|
dnf_package.run_action(:install)
|
442
616
|
expect(dnf_package.updated_by_last_action?).to be true
|
443
617
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
618
|
+
dnf_package.run_action(:install)
|
619
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
444
620
|
end
|
445
621
|
|
446
622
|
it "does not downgrade the package with :install" do
|
@@ -475,15 +651,6 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
475
651
|
expect(dnf_package.updated_by_last_action?).to be false
|
476
652
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
477
653
|
end
|
478
|
-
|
479
|
-
it "is idempotent when the package is already installed and there is a version string with arch" do
|
480
|
-
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
481
|
-
dnf_package.version "1.2-1.#{pkg_arch}"
|
482
|
-
dnf_package.package_name("#{CHEF_SPEC_ASSETS}/yumrepo/chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
483
|
-
dnf_package.run_action(:install)
|
484
|
-
expect(dnf_package.updated_by_last_action?).to be false
|
485
|
-
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
486
|
-
end
|
487
654
|
end
|
488
655
|
|
489
656
|
context "with no available version" do
|
@@ -502,6 +669,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
502
669
|
dnf_package.run_action(:install)
|
503
670
|
expect(dnf_package.updated_by_last_action?).to be true
|
504
671
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
672
|
+
dnf_package.run_action(:install)
|
673
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
505
674
|
end
|
506
675
|
end
|
507
676
|
|
@@ -513,6 +682,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
513
682
|
expect(dnf_package.updated_by_last_action?).to be true
|
514
683
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
515
684
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
685
|
+
dnf_package.run_action(:install)
|
686
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
516
687
|
end
|
517
688
|
|
518
689
|
it "does nothing if both are installed" do
|
@@ -530,6 +701,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
530
701
|
expect(dnf_package.updated_by_last_action?).to be true
|
531
702
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
532
703
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
704
|
+
dnf_package.run_action(:install)
|
705
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
533
706
|
end
|
534
707
|
|
535
708
|
it "installs the first rpm if the second is installed" do
|
@@ -539,6 +712,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
539
712
|
expect(dnf_package.updated_by_last_action?).to be true
|
540
713
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
541
714
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
715
|
+
dnf_package.run_action(:install)
|
716
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
542
717
|
end
|
543
718
|
|
544
719
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
@@ -550,6 +725,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
550
725
|
expect(dnf_package.updated_by_last_action?).to be true
|
551
726
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
552
727
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
728
|
+
dnf_package.run_action(:install)
|
729
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
553
730
|
end
|
554
731
|
|
555
732
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
@@ -561,6 +738,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
561
738
|
expect(dnf_package.updated_by_last_action?).to be true
|
562
739
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
563
740
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
741
|
+
dnf_package.run_action(:install)
|
742
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
564
743
|
end
|
565
744
|
|
566
745
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
@@ -572,6 +751,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
572
751
|
expect(dnf_package.updated_by_last_action?).to be true
|
573
752
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.#{pkg_arch}$/)
|
574
753
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match(/^chef_rpm-1.10-1.i686$/)
|
754
|
+
dnf_package.run_action(:install)
|
755
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
575
756
|
end
|
576
757
|
|
577
758
|
# unlikely to work consistently correct, okay to deprecate the arch-array in favor of the arch in the name
|
@@ -597,6 +778,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
597
778
|
dnf_package.run_action(:install)
|
598
779
|
expect(dnf_package.updated_by_last_action?).to be true
|
599
780
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
781
|
+
dnf_package.run_action(:install)
|
782
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
600
783
|
end
|
601
784
|
|
602
785
|
it "should work to enable a disabled repo" do
|
@@ -608,6 +791,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
608
791
|
dnf_package.run_action(:install)
|
609
792
|
expect(dnf_package.updated_by_last_action?).to be true
|
610
793
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
794
|
+
dnf_package.run_action(:install)
|
795
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
611
796
|
end
|
612
797
|
|
613
798
|
it "when an idempotent install action is run, does not leave repos disabled" do
|
@@ -628,6 +813,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
628
813
|
dnf_package.run_action(:install)
|
629
814
|
expect(dnf_package.updated_by_last_action?).to be true
|
630
815
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
816
|
+
dnf_package.run_action(:install)
|
817
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
631
818
|
end
|
632
819
|
end
|
633
820
|
end
|
@@ -640,6 +827,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
640
827
|
dnf_package.run_action(:install)
|
641
828
|
expect(dnf_package.updated_by_last_action?).to be true
|
642
829
|
expect(shell_out("rpm -q chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}")
|
830
|
+
dnf_package.run_action(:install)
|
831
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
643
832
|
end
|
644
833
|
|
645
834
|
it "throws a deprecation warning with allow_downgrade" do
|
@@ -647,10 +836,12 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
647
836
|
expect(Chef).to receive(:deprecated).with(:dnf_package_allow_downgrade, /^the allow_downgrade property on the dnf_package provider is not used/)
|
648
837
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
649
838
|
dnf_package.version("1.2")
|
650
|
-
dnf_package.run_action(:install)
|
651
839
|
dnf_package.allow_downgrade true
|
840
|
+
dnf_package.run_action(:install)
|
652
841
|
expect(dnf_package.updated_by_last_action?).to be true
|
653
842
|
expect(shell_out("rpm -q chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}")
|
843
|
+
dnf_package.run_action(:install)
|
844
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
654
845
|
end
|
655
846
|
end
|
656
847
|
|
@@ -663,6 +854,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
663
854
|
dnf_package.run_action(:upgrade)
|
664
855
|
expect(dnf_package.updated_by_last_action?).to be true
|
665
856
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
857
|
+
dnf_package.run_action(:upgrade)
|
858
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
666
859
|
end
|
667
860
|
|
668
861
|
it "installs the package when the name is a path to a file" do
|
@@ -671,6 +864,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
671
864
|
dnf_package.run_action(:upgrade)
|
672
865
|
expect(dnf_package.updated_by_last_action?).to be true
|
673
866
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
867
|
+
dnf_package.run_action(:upgrade)
|
868
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
674
869
|
end
|
675
870
|
|
676
871
|
it "downgrades the package when allow_downgrade is true" do
|
@@ -679,6 +874,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
679
874
|
dnf_package.run_action(:upgrade)
|
680
875
|
expect(dnf_package.updated_by_last_action?).to be true
|
681
876
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
877
|
+
dnf_package.run_action(:upgrade)
|
878
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
682
879
|
end
|
683
880
|
|
684
881
|
it "upgrades the package" do
|
@@ -687,6 +884,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
687
884
|
dnf_package.run_action(:upgrade)
|
688
885
|
expect(dnf_package.updated_by_last_action?).to be true
|
689
886
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
887
|
+
dnf_package.run_action(:upgrade)
|
888
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
690
889
|
end
|
691
890
|
|
692
891
|
it "is idempotent when the package is already installed" do
|
@@ -715,32 +914,104 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
715
914
|
dnf_package.run_action(:upgrade)
|
716
915
|
expect(dnf_package.updated_by_last_action?).to be true
|
717
916
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
917
|
+
dnf_package.run_action(:upgrade)
|
918
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
718
919
|
end
|
719
920
|
end
|
720
921
|
|
721
922
|
context "version pinning" do
|
722
|
-
it "with
|
923
|
+
it "with a full version pin it installs a later package" do
|
723
924
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
724
|
-
dnf_package.package_name("chef_rpm
|
925
|
+
dnf_package.package_name("chef_rpm")
|
926
|
+
dnf_package.version("1.10-1")
|
725
927
|
dnf_package.run_action(:upgrade)
|
726
928
|
expect(dnf_package.updated_by_last_action?).to be true
|
727
929
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
930
|
+
dnf_package.run_action(:upgrade)
|
931
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
728
932
|
end
|
729
933
|
|
730
|
-
it "with a
|
934
|
+
it "with a full version pin in the name it downgrades the package" do
|
935
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
936
|
+
dnf_package.package_name("chef_rpm")
|
937
|
+
dnf_package.version("1.2-1")
|
938
|
+
dnf_package.run_action(:upgrade)
|
939
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
940
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
941
|
+
dnf_package.run_action(:upgrade)
|
942
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
943
|
+
end
|
944
|
+
|
945
|
+
it "with a partial (no release) version pin it installs a later package" do
|
731
946
|
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
732
|
-
dnf_package.package_name("chef_rpm
|
947
|
+
dnf_package.package_name("chef_rpm")
|
948
|
+
dnf_package.version("1.10")
|
949
|
+
dnf_package.run_action(:upgrade)
|
950
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
951
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
952
|
+
dnf_package.run_action(:upgrade)
|
953
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
954
|
+
end
|
955
|
+
|
956
|
+
it "with a partial (no release) version pin in the name it downgrades the package" do
|
957
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
958
|
+
dnf_package.package_name("chef_rpm")
|
959
|
+
dnf_package.version("1.2")
|
960
|
+
dnf_package.run_action(:upgrade)
|
961
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
962
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
963
|
+
dnf_package.run_action(:upgrade)
|
964
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
965
|
+
end
|
966
|
+
|
967
|
+
it "with a full version pin it installs a later package" do
|
968
|
+
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
969
|
+
dnf_package.package_name("chef_rpm-1.10-1")
|
970
|
+
dnf_package.run_action(:upgrade)
|
971
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
972
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
973
|
+
dnf_package.run_action(:upgrade)
|
974
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
975
|
+
end
|
976
|
+
|
977
|
+
it "with a full version pin in the name it downgrades the package" do
|
978
|
+
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
979
|
+
dnf_package.package_name("chef_rpm-1.2-1")
|
980
|
+
dnf_package.run_action(:upgrade)
|
981
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
982
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
983
|
+
dnf_package.run_action(:upgrade)
|
984
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
985
|
+
end
|
986
|
+
|
987
|
+
it "with a partial (no release) version pin it installs a later package" do
|
988
|
+
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
989
|
+
dnf_package.package_name("chef_rpm-1.10")
|
733
990
|
dnf_package.run_action(:upgrade)
|
734
991
|
expect(dnf_package.updated_by_last_action?).to be true
|
735
992
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
993
|
+
dnf_package.run_action(:upgrade)
|
994
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
736
995
|
end
|
737
996
|
|
738
|
-
it "with
|
997
|
+
it "with a partial (no release) version pin in the name it downgrades the package" do
|
739
998
|
preinstall("chef_rpm-1.10-1.#{pkg_arch}.rpm")
|
740
999
|
dnf_package.package_name("chef_rpm-1.2")
|
741
1000
|
dnf_package.run_action(:upgrade)
|
742
1001
|
expect(dnf_package.updated_by_last_action?).to be true
|
743
1002
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1003
|
+
dnf_package.run_action(:upgrade)
|
1004
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
it "with a prco equality pin in the name it upgrades a prior package" do
|
1008
|
+
preinstall("chef_rpm-1.2-1.#{pkg_arch}.rpm")
|
1009
|
+
dnf_package.package_name("chef_rpm = 1.10")
|
1010
|
+
dnf_package.run_action(:upgrade)
|
1011
|
+
expect(dnf_package.updated_by_last_action?).to be true
|
1012
|
+
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1013
|
+
dnf_package.run_action(:upgrade)
|
1014
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
744
1015
|
end
|
745
1016
|
|
746
1017
|
it "with a prco equality pin in the name it downgrades a later package" do
|
@@ -749,6 +1020,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
749
1020
|
dnf_package.run_action(:upgrade)
|
750
1021
|
expect(dnf_package.updated_by_last_action?).to be true
|
751
1022
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1023
|
+
dnf_package.run_action(:upgrade)
|
1024
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
752
1025
|
end
|
753
1026
|
|
754
1027
|
it "with a > pin in the name and no rpm installed it installs" do
|
@@ -757,6 +1030,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
757
1030
|
dnf_package.run_action(:upgrade)
|
758
1031
|
expect(dnf_package.updated_by_last_action?).to be true
|
759
1032
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1033
|
+
dnf_package.run_action(:upgrade)
|
1034
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
760
1035
|
end
|
761
1036
|
|
762
1037
|
it "with a < pin in the name and no rpm installed it installs" do
|
@@ -765,6 +1040,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
765
1040
|
dnf_package.run_action(:upgrade)
|
766
1041
|
expect(dnf_package.updated_by_last_action?).to be true
|
767
1042
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1043
|
+
dnf_package.run_action(:upgrade)
|
1044
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
768
1045
|
end
|
769
1046
|
|
770
1047
|
it "with a > pin in the name and matching rpm installed it does nothing" do
|
@@ -789,6 +1066,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
789
1066
|
dnf_package.run_action(:upgrade)
|
790
1067
|
expect(dnf_package.updated_by_last_action?).to be true
|
791
1068
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1069
|
+
dnf_package.run_action(:upgrade)
|
1070
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
792
1071
|
end
|
793
1072
|
|
794
1073
|
it "with a < pin in the name and non-matching rpm installed it downgrades" do
|
@@ -797,6 +1076,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
797
1076
|
dnf_package.run_action(:upgrade)
|
798
1077
|
expect(dnf_package.updated_by_last_action?).to be true
|
799
1078
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.2-1.#{pkg_arch}$")
|
1079
|
+
dnf_package.run_action(:upgrade)
|
1080
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
800
1081
|
end
|
801
1082
|
end
|
802
1083
|
end
|
@@ -833,6 +1114,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
833
1114
|
dnf_package.run_action(:remove)
|
834
1115
|
expect(dnf_package.updated_by_last_action?).to be true
|
835
1116
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1117
|
+
dnf_package.run_action(:remove)
|
1118
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
836
1119
|
end
|
837
1120
|
|
838
1121
|
it "removes the package if the i686 package is installed", :intel_64bit do
|
@@ -841,6 +1124,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
841
1124
|
dnf_package.run_action(:remove)
|
842
1125
|
expect(dnf_package.updated_by_last_action?).to be true
|
843
1126
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1127
|
+
dnf_package.run_action(:remove)
|
1128
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
844
1129
|
end
|
845
1130
|
|
846
1131
|
it "removes the package if the prior version i686 package is installed", :intel_64bit do
|
@@ -849,6 +1134,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
849
1134
|
dnf_package.run_action(:remove)
|
850
1135
|
expect(dnf_package.updated_by_last_action?).to be true
|
851
1136
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1137
|
+
dnf_package.run_action(:remove)
|
1138
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
852
1139
|
end
|
853
1140
|
end
|
854
1141
|
|
@@ -866,6 +1153,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
866
1153
|
dnf_package.run_action(:remove)
|
867
1154
|
expect(dnf_package.updated_by_last_action?).to be true
|
868
1155
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1156
|
+
dnf_package.run_action(:remove)
|
1157
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
869
1158
|
end
|
870
1159
|
|
871
1160
|
it "removes the package if the prior version package is installed" do
|
@@ -873,6 +1162,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
873
1162
|
dnf_package.run_action(:remove)
|
874
1163
|
expect(dnf_package.updated_by_last_action?).to be true
|
875
1164
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1165
|
+
dnf_package.run_action(:remove)
|
1166
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
876
1167
|
end
|
877
1168
|
|
878
1169
|
it "does nothing if the i686 package is installed" do
|
@@ -897,6 +1188,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
897
1188
|
dnf_package.run_action(:remove)
|
898
1189
|
expect(dnf_package.updated_by_last_action?).to be true
|
899
1190
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^chef_rpm-1.10-1.#{pkg_arch}$")
|
1191
|
+
dnf_package.run_action(:remove)
|
1192
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
900
1193
|
end
|
901
1194
|
end
|
902
1195
|
|
@@ -907,6 +1200,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
907
1200
|
dnf_package.run_action(:remove)
|
908
1201
|
expect(dnf_package.updated_by_last_action?).to be true
|
909
1202
|
expect(shell_out("rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' chef_rpm").stdout.chomp).to match("^package chef_rpm is not installed$")
|
1203
|
+
dnf_package.run_action(:remove)
|
1204
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
910
1205
|
end
|
911
1206
|
end
|
912
1207
|
end
|
@@ -926,6 +1221,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
926
1221
|
dnf_package.run_action(:lock)
|
927
1222
|
expect(dnf_package.updated_by_last_action?).to be true
|
928
1223
|
expect(shell_out("dnf versionlock list").stdout.chomp).to match("^chef_rpm-0:")
|
1224
|
+
dnf_package.run_action(:lock)
|
1225
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
929
1226
|
end
|
930
1227
|
|
931
1228
|
it "does not lock if its already locked" do
|
@@ -944,6 +1241,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
944
1241
|
dnf_package.run_action(:unlock)
|
945
1242
|
expect(dnf_package.updated_by_last_action?).to be true
|
946
1243
|
expect(shell_out("dnf versionlock list").stdout.chomp).not_to match("^chef_rpm-0:")
|
1244
|
+
dnf_package.run_action(:unlock)
|
1245
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
947
1246
|
end
|
948
1247
|
|
949
1248
|
it "does not unlock an already locked rpm" do
|
@@ -960,6 +1259,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
960
1259
|
dnf_package.run_action(:lock)
|
961
1260
|
expect(dnf_package.updated_by_last_action?).to be true
|
962
1261
|
expect(shell_out("dnf versionlock list").stdout.chomp).to match("^chef_rpm-0:")
|
1262
|
+
dnf_package.run_action(:lock)
|
1263
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
963
1264
|
end
|
964
1265
|
|
965
1266
|
it "check that we can unlock based on provides" do
|
@@ -969,6 +1270,8 @@ describe Chef::Resource::DnfPackage, :requires_root, external: exclude_test do
|
|
969
1270
|
dnf_package.run_action(:unlock)
|
970
1271
|
expect(dnf_package.updated_by_last_action?).to be true
|
971
1272
|
expect(shell_out("dnf versionlock list").stdout.chomp).not_to match("^chef_rpm-0:")
|
1273
|
+
dnf_package.run_action(:unlock)
|
1274
|
+
expect(dnf_package.updated_by_last_action?).to be false
|
972
1275
|
end
|
973
1276
|
end
|
974
1277
|
end
|