chef 18.0.169-x64-mingw-ucrt → 18.1.0-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/chef.gemspec +2 -2
  3. data/lib/chef/chef_fs/file_system.rb +21 -7
  4. data/lib/chef/mixin/checksum.rb +6 -0
  5. data/lib/chef/property.rb +8 -3
  6. data/lib/chef/provider/cron.rb +5 -1
  7. data/lib/chef/provider/file.rb +2 -2
  8. data/lib/chef/provider/launchd.rb +1 -0
  9. data/lib/chef/provider/package/snap.rb +1 -1
  10. data/lib/chef/provider/package/windows.rb +1 -1
  11. data/lib/chef/provider/package/yum/yum_helper.py +5 -17
  12. data/lib/chef/provider/yum_repository.rb +13 -1
  13. data/lib/chef/resource/apt_package.rb +2 -0
  14. data/lib/chef/resource/chef_client_config.rb +2 -2
  15. data/lib/chef/resource/dmg_package.rb +2 -0
  16. data/lib/chef/resource/freebsd_package.rb +2 -0
  17. data/lib/chef/resource/gem_package.rb +2 -0
  18. data/lib/chef/resource/homebrew_package.rb +2 -0
  19. data/lib/chef/resource/launchd.rb +3 -0
  20. data/lib/chef/resource/macos_userdefaults.rb +3 -3
  21. data/lib/chef/resource/macports_package.rb +2 -0
  22. data/lib/chef/resource/openbsd_package.rb +2 -0
  23. data/lib/chef/resource/pacman_package.rb +2 -0
  24. data/lib/chef/resource/portage_package.rb +2 -0
  25. data/lib/chef/resource/rhsm_register.rb +2 -1
  26. data/lib/chef/resource/rpm_package.rb +2 -0
  27. data/lib/chef/resource/smartos_package.rb +2 -0
  28. data/lib/chef/resource/snap_package.rb +2 -0
  29. data/lib/chef/resource/solaris_package.rb +2 -0
  30. data/lib/chef/resource/windows_package.rb +3 -3
  31. data/lib/chef/resource/yum_package.rb +2 -0
  32. data/lib/chef/resource/yum_repository.rb +4 -0
  33. data/lib/chef/resource/zypper_package.rb +2 -0
  34. data/lib/chef/version.rb +1 -1
  35. data/spec/functional/assets/yumrepo-empty/repodata/01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2 +0 -0
  36. data/spec/functional/assets/yumrepo-empty/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz +0 -0
  37. data/spec/functional/assets/yumrepo-empty/repodata/5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2 +0 -0
  38. data/spec/functional/assets/yumrepo-empty/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz +0 -0
  39. data/spec/functional/assets/yumrepo-empty/repodata/7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2 +0 -0
  40. data/spec/functional/assets/yumrepo-empty/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz +0 -0
  41. data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +55 -0
  42. data/spec/functional/resource/yum_package_spec.rb +16 -0
  43. data/spec/integration/client/fips_spec.rb +20 -0
  44. data/spec/spec_helper.rb +4 -0
  45. data/spec/support/platform_helpers.rb +4 -0
  46. data/spec/unit/chef_fs/file_system_spec.rb +2 -0
  47. data/spec/unit/mixin/checksum_spec.rb +28 -0
  48. data/spec/unit/property/validation_spec.rb +30 -0
  49. data/spec/unit/provider/cron_spec.rb +36 -0
  50. data/spec/unit/resource/yum_repository_spec.rb +4 -0
  51. metadata +16 -15
  52. data/distro/powershell/chef/chef.psm1 +0 -459
@@ -0,0 +1,55 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm">
3
+ <revision>1667508211</revision>
4
+ <data type="filelists">
5
+ <checksum type="sha256">401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93</checksum>
6
+ <open-checksum type="sha256">bf9808b81cb2dbc54b4b8e35adc584ddcaa73bd81f7088d73bf7dbbada961310</open-checksum>
7
+ <location href="repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz"/>
8
+ <timestamp>1667508211</timestamp>
9
+ <size>123</size>
10
+ <open-size>125</open-size>
11
+ </data>
12
+ <data type="primary">
13
+ <checksum type="sha256">dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9</checksum>
14
+ <open-checksum type="sha256">e1e2ffd2fb1ee76f87b70750d00ca5677a252b397ab6c2389137a0c33e7b359f</open-checksum>
15
+ <location href="repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz"/>
16
+ <timestamp>1667508211</timestamp>
17
+ <size>134</size>
18
+ <open-size>167</open-size>
19
+ </data>
20
+ <data type="primary_db">
21
+ <checksum type="sha256">5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945</checksum>
22
+ <open-checksum type="sha256">f0d550414e8f2e960e82e704549364299ca9e3e8664ad4faffd208262c3b6d12</open-checksum>
23
+ <location href="repodata/5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2"/>
24
+ <timestamp>1667508211</timestamp>
25
+ <database_version>10</database_version>
26
+ <size>1131</size>
27
+ <open-size>21504</open-size>
28
+ </data>
29
+ <data type="other_db">
30
+ <checksum type="sha256">7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4</checksum>
31
+ <open-checksum type="sha256">4de0fe7c5dd2674849a7c63c326e42f33af0a0f46219bc6dd59f51dfa2ac8c68</open-checksum>
32
+ <location href="repodata/7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2"/>
33
+ <timestamp>1667508211</timestamp>
34
+ <database_version>10</database_version>
35
+ <size>575</size>
36
+ <open-size>6144</open-size>
37
+ </data>
38
+ <data type="other">
39
+ <checksum type="sha256">6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670</checksum>
40
+ <open-checksum type="sha256">e0ed5e0054194df036cf09c1a911e15bf2a4e7f26f2a788b6f47d53e80717ccc</open-checksum>
41
+ <location href="repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz"/>
42
+ <timestamp>1667508211</timestamp>
43
+ <size>123</size>
44
+ <open-size>121</open-size>
45
+ </data>
46
+ <data type="filelists_db">
47
+ <checksum type="sha256">01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523</checksum>
48
+ <open-checksum type="sha256">c4211f57bdcbb142c9f93a6d32401539f775eb6a670ab7a423e13f435ce94689</open-checksum>
49
+ <location href="repodata/01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2"/>
50
+ <timestamp>1667508211</timestamp>
51
+ <database_version>10</database_version>
52
+ <size>586</size>
53
+ <open-size>7168</open-size>
54
+ </data>
55
+ </repomd>
@@ -57,6 +57,12 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
57
57
  baseurl=file://#{CHEF_SPEC_ASSETS}/yumrepo
58
58
  enable=1
59
59
  gpgcheck=0
60
+ [chef-yum-empty]
61
+ name=Chef DNF spec empty repo
62
+ baseurl=file://#{CHEF_SPEC_ASSETS}/yumrepo-empty
63
+ enable=1
64
+ gpgcheck=0
65
+
60
66
  EOF
61
67
  end
62
68
  # ensure we don't have any stray chef_rpms installed
@@ -1095,6 +1101,16 @@ describe Chef::Resource::YumPackage, :requires_root, external: exclude_test do
1095
1101
  end.should_not_be_updated
1096
1102
  end
1097
1103
 
1104
+ it "should work to disable a repo" do
1105
+ flush_cache
1106
+ expect {
1107
+ yum_package "chef_rpm" do
1108
+ options "--disablerepo=chef-yum-localtesting --enablerepo=chef-yum-empty"
1109
+ action :install
1110
+ end
1111
+ }.to raise_error(Chef::Exceptions::Package, /No candidate version available/)
1112
+ end
1113
+
1098
1114
  it "when an idempotent install action is run, does not leave repos disabled" do
1099
1115
  flush_cache
1100
1116
  # this is a bit tricky -- we need this action to be idempotent, so that it doesn't recycle any
@@ -0,0 +1,20 @@
1
+ require "spec_helper"
2
+
3
+ describe "chef-client fips" do
4
+ def enable_fips
5
+ OpenSSL.fips_mode = true
6
+ end
7
+
8
+ # All tests assume fips mode is off at present
9
+ after { OpenSSL.fips_mode = false }
10
+
11
+ # For non-FIPS OSes/builds of Ruby, enabling FIPS should error
12
+ example "Error enabling fips_mode if FIPS not linked", fips_mode: false do
13
+ expect { enable_fips }.to raise_error(OpenSSL::OpenSSLError)
14
+ end
15
+
16
+ # For FIPS OSes/builds of Ruby, enabling FIPS should not error
17
+ example "Do not error enabling fips_mode if FIPS linked", fips_mode: true do
18
+ expect { enable_fips }.not_to raise_error
19
+ end
20
+ end
data/spec/spec_helper.rb CHANGED
@@ -138,6 +138,10 @@ RSpec.configure do |config|
138
138
 
139
139
  config.filter_run_excluding skip_buildkite: true if ENV["BUILDKITE"]
140
140
 
141
+ config.filter_run_excluding fips_mode: !fips_mode_build? unless opensuse?
142
+ # RubyDistros OpenSUSE docker images have a broken fips
143
+ config.filter_run_excluding :fips_mode if opensuse?
144
+
141
145
  config.filter_run_excluding windows_only: true unless windows?
142
146
  config.filter_run_excluding not_supported_on_windows: true if windows?
143
147
  config.filter_run_excluding not_supported_on_macos: true if macos?
@@ -223,6 +223,10 @@ def aes_256_gcm?
223
223
  OpenSSL::Cipher.ciphers.include?("aes-256-gcm")
224
224
  end
225
225
 
226
+ def fips_mode_build?
227
+ OpenSSL::OPENSSL_FIPS
228
+ end
229
+
226
230
  def fips?
227
231
  ENV["CHEF_FIPS"] == "1"
228
232
  end
@@ -145,4 +145,6 @@ describe Chef::ChefFS::FileSystem, ruby: ">= 3.0" do
145
145
  end
146
146
  end
147
147
  end
148
+
149
+ # Need to add the test case for copy_to method - not able to do the implimentation with Dir.mktmpdir
148
150
  end
@@ -51,4 +51,32 @@ describe Chef::Mixin::Checksum do
51
51
  end
52
52
  end
53
53
 
54
+ describe "checksum_match?" do
55
+ context "when checksum cases match" do
56
+ it "returns true" do
57
+ expect(@checksum_user.checksum_match?("u7ghbxikk3i9blsimmy2y2ionmxx", "u7ghbxikk3i9blsimmy2y2ionmxx")).to be true
58
+ end
59
+ end
60
+
61
+ context "when one checksum is uppercase and other is lowercase" do
62
+ it "returns true" do
63
+ expect(@checksum_user.checksum_match?("U7GHBXIKK3I9BLSIMMY2Y2IONMXX", "u7ghbxikk3i9blsimmy2y2ionmxx")).to be true
64
+ end
65
+ end
66
+
67
+ context "when checksums do not match" do
68
+ it "returns false" do
69
+ expect(@checksum_user.checksum_match?("u7ghbxikk3i9blsimmy2y2ionmxx", "09ee9c8cc70501763563bcf9c218")).to be false
70
+ end
71
+ end
72
+
73
+ context "when checksum is nil" do
74
+ it "returns false" do
75
+ expect(@checksum_user.checksum_match?("u7ghbxikk3i9blsimmy2y2ionmxx", nil)).to be false
76
+ expect(@checksum_user.checksum_match?(nil, "09ee9c8cc70501763563bcf9c218")).to be false
77
+ expect(@checksum_user.checksum_match?(nil, nil)).to be false
78
+ end
79
+ end
80
+ end
81
+
54
82
  end
@@ -600,6 +600,36 @@ describe "Chef::Resource.property validation" do
600
600
  it "does not fail if it is not specified, on running the doit2 action" do
601
601
  expect { resource.run_action(:doit2) }.not_to raise_error
602
602
  end
603
+
604
+ context "when an action does not require it" do
605
+ before do
606
+ resource.action(:doit2)
607
+ end
608
+
609
+ it "retrieval succeeds if x is not set when resource uses the doit2 action" do
610
+ expect { resource.x }.not_to raise_error
611
+ end
612
+
613
+ it "succeeds with set to nil when resource uses the doit2 action" do
614
+ expect { resource.x nil }.not_to raise_error
615
+ end
616
+ end
617
+
618
+ context "when an action requires it" do
619
+ before do
620
+ # NOTE: this is already the default action, but it doesn't
621
+ # hurt to be clear about the situation.
622
+ resource.action(:doit)
623
+ end
624
+
625
+ it "if x is not specified, retrieval fails for the doit action" do
626
+ expect { resource.x }.to raise_error Chef::Exceptions::ValidationFailed
627
+ end
628
+
629
+ it "value nil is not valid for the doit action (required means 'not nil')" do
630
+ expect { resource.x nil }.to raise_error Chef::Exceptions::ValidationFailed
631
+ end
632
+ end
603
633
  end
604
634
 
605
635
  with_property ":x, String, required: true" do
@@ -769,6 +769,42 @@ describe Chef::Provider::Cron do
769
769
  end
770
770
  end
771
771
 
772
+ context "when integers are provided to the resource to express time values" do
773
+ it "should not report any difference" do
774
+ @new_resource.minute(1)
775
+ @new_resource.hour(1)
776
+ @new_resource.day(1)
777
+ @new_resource.month(1)
778
+ @new_resource.weekday(1)
779
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
780
+ # Chef Name: cronhole some stuff
781
+ 1 1 1 1 1 /bin/true
782
+
783
+ CRONTAB
784
+
785
+ @provider.run_action(:create)
786
+ expect(@new_resource).not_to be_updated_by_last_action
787
+ end
788
+ end
789
+
790
+ context "when strings are provided to the resource to express time values" do
791
+ it "should not report any difference" do
792
+ @new_resource.minute("1")
793
+ @new_resource.hour("1")
794
+ @new_resource.day("1")
795
+ @new_resource.month("1")
796
+ @new_resource.weekday("1")
797
+ allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
798
+ # Chef Name: cronhole some stuff
799
+ 1 1 1 1 1 /bin/true
800
+
801
+ CRONTAB
802
+
803
+ @provider.run_action(:create)
804
+ expect(@new_resource).not_to be_updated_by_last_action
805
+ end
806
+ end
807
+
772
808
  context "when environment variable is used" do
773
809
  before :each do
774
810
  @provider.cron_exists = true
@@ -68,6 +68,10 @@ describe Chef::Resource::YumRepository do
68
68
  expect(resource.make_cache).to eql(true)
69
69
  end
70
70
 
71
+ it "makecache_fast property defaults to false" do
72
+ expect(resource.makecache_fast).to eql(false)
73
+ end
74
+
71
75
  it "mode property defaults to '0644'" do
72
76
  expect(resource.mode).to eql("0644")
73
77
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.0.169
4
+ version: 18.1.0
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-27 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 18.0.169
19
+ version: 18.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 18.0.169
26
+ version: 18.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: chef-utils
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 18.0.169
33
+ version: 18.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 18.0.169
40
+ version: 18.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -45,9 +45,6 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.10'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 3.2.28
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,9 +52,6 @@ dependencies:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
54
  version: '3.10'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 3.2.28
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: train-winrm
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -271,7 +265,7 @@ dependencies:
271
265
  version: 2.1.2
272
266
  - - "<"
273
267
  - !ruby/object:Gem::Version
274
- version: '4.0'
268
+ version: '5.0'
275
269
  type: :runtime
276
270
  prerelease: false
277
271
  version_requirements: !ruby/object:Gem::Requirement
@@ -281,7 +275,7 @@ dependencies:
281
275
  version: 2.1.2
282
276
  - - "<"
283
277
  - !ruby/object:Gem::Version
284
- version: '4.0'
278
+ version: '5.0'
285
279
  - !ruby/object:Gem::Dependency
286
280
  name: net-ftp
287
281
  requirement: !ruby/object:Gem::Requirement
@@ -740,7 +734,6 @@ files:
740
734
  - Rakefile
741
735
  - chef-universal-mingw-ucrt.gemspec
742
736
  - chef.gemspec
743
- - distro/powershell/chef/chef.psm1
744
737
  - distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
745
738
  - distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll
746
739
  - distro/ruby_bin_folder/AMD64/Ijwhost.dll
@@ -2521,6 +2514,13 @@ files:
2521
2514
  - spec/functional/assets/mytest-1.0-1.noarch.rpm
2522
2515
  - spec/functional/assets/mytest-2.0-1.noarch.rpm
2523
2516
  - spec/functional/assets/testchefsubsys
2517
+ - spec/functional/assets/yumrepo-empty/repodata/01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2
2518
+ - spec/functional/assets/yumrepo-empty/repodata/401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz
2519
+ - spec/functional/assets/yumrepo-empty/repodata/5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2
2520
+ - spec/functional/assets/yumrepo-empty/repodata/6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz
2521
+ - spec/functional/assets/yumrepo-empty/repodata/7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2
2522
+ - spec/functional/assets/yumrepo-empty/repodata/dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz
2523
+ - spec/functional/assets/yumrepo-empty/repodata/repomd.xml
2524
2524
  - spec/functional/assets/yumrepo/chef_rpm-1.10-1.aarch64.rpm
2525
2525
  - spec/functional/assets/yumrepo/chef_rpm-1.10-1.i686.rpm
2526
2526
  - spec/functional/assets/yumrepo/chef_rpm-1.10-1.ppc64.rpm
@@ -2641,6 +2641,7 @@ files:
2641
2641
  - spec/functional/win32/versions_spec.rb
2642
2642
  - spec/integration/client/client_spec.rb
2643
2643
  - spec/integration/client/exit_code_spec.rb
2644
+ - spec/integration/client/fips_spec.rb
2644
2645
  - spec/integration/client/ipv6_spec.rb
2645
2646
  - spec/integration/compliance/compliance_spec.rb
2646
2647
  - spec/integration/ohai/ohai_spec.rb