chef 18.7.10-universal-mingw-ucrt → 18.8.9-universal-mingw-ucrt
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +4 -3
- data/Rakefile +1 -0
- data/chef.gemspec +10 -2
- data/lib/chef/cookbook_version.rb +34 -0
- data/lib/chef/http/basic_client.rb +1 -0
- data/lib/chef/http.rb +1 -0
- data/lib/chef/provider/package/apt.rb +1 -1
- data/lib/chef/provider/package/bff.rb +5 -0
- data/lib/chef/provider/package/cab.rb +9 -0
- data/lib/chef/provider/package/chocolatey.rb +6 -1
- data/lib/chef/provider/package/deb.rb +1 -1
- data/lib/chef/provider/package/dnf.rb +3 -3
- data/lib/chef/provider/package/habitat.rb +9 -0
- data/lib/chef/provider/package/homebrew.rb +9 -0
- data/lib/chef/provider/package/ips.rb +5 -0
- data/lib/chef/provider/package/macports.rb +9 -0
- data/lib/chef/provider/package/msu.rb +9 -0
- data/lib/chef/provider/package/openbsd.rb +7 -2
- data/lib/chef/provider/package/pacman.rb +9 -0
- data/lib/chef/provider/package/paludis.rb +9 -0
- data/lib/chef/provider/package/portage.rb +9 -0
- data/lib/chef/provider/package/powershell.rb +6 -1
- data/lib/chef/provider/package/rpm.rb +3 -3
- data/lib/chef/provider/package/rubygems.rb +9 -0
- data/lib/chef/provider/package/smartos.rb +9 -0
- data/lib/chef/provider/package/snap.rb +6 -1
- data/lib/chef/provider/package/solaris.rb +5 -0
- data/lib/chef/provider/package/windows.rb +5 -0
- data/lib/chef/provider/package/yum.rb +3 -3
- data/lib/chef/provider/package/zypper.rb +5 -0
- data/lib/chef/recipe.rb +20 -0
- data/lib/chef/resource/apt_package.rb +5 -0
- data/lib/chef/resource/apt_repository.rb +44 -27
- data/lib/chef/resource/archive_file.rb +49 -2
- data/lib/chef/resource/dnf_package.rb +5 -0
- data/lib/chef/resource/dpkg_package.rb +5 -0
- data/lib/chef/resource/ohai.rb +10 -0
- data/lib/chef/resource/package.rb +5 -0
- data/lib/chef/resource/rpm_package.rb +5 -0
- data/lib/chef/resource/yum_package.rb +5 -0
- data/lib/chef/shell.rb +13 -4
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/version.rb +2 -1
- data/spec/functional/resource/git_spec.rb +2 -1
- data/spec/integration/client/open_ssl_spec.rb +7 -2
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/cookbook_version_spec.rb +39 -0
- data/spec/unit/node/attribute_spec.rb +1 -1
- data/spec/unit/provider/apt_repository_spec.rb +85 -8
- data/spec/unit/provider/package/rpm_spec.rb +10 -10
- data/spec/unit/recipe_spec.rb +51 -0
- data/spec/unit/resource/apt_package_spec.rb +5 -0
- data/spec/unit/resource/dnf_package_spec.rb +6 -0
- data/spec/unit/resource/ohai_spec.rb +73 -0
- data/spec/unit/resource/yum_package_spec.rb +9 -0
- data/spec/unit/resource_reporter_spec.rb +0 -58
- data/spec/unit/shell_spec.rb +31 -11
- data/tasks/rspec.rb +1 -1
- metadata +42 -8
@@ -151,7 +151,7 @@ describe Chef::Provider::Package::Rpm do
|
|
151
151
|
|
152
152
|
context "when at the desired version already" do
|
153
153
|
it "does nothing when the correct version is installed" do
|
154
|
-
expect(provider).to_not receive(:shell_out_compacted!).with("rpm", "-i", "/tmp/imagemagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
154
|
+
expect(provider).to_not receive(:shell_out_compacted!).with("rpm", "-i", "/tmp/imagemagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
155
155
|
|
156
156
|
provider.action_install
|
157
157
|
end
|
@@ -162,7 +162,7 @@ describe Chef::Provider::Package::Rpm do
|
|
162
162
|
let(:rpm_q_stdout) { "imagemagick-c++ 0.5.4.7-7.el6_5" }
|
163
163
|
|
164
164
|
it "runs rpm -u with the package source to upgrade" do
|
165
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
165
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
166
166
|
provider.action_install
|
167
167
|
end
|
168
168
|
end
|
@@ -177,7 +177,7 @@ describe Chef::Provider::Package::Rpm do
|
|
177
177
|
let(:rpm_q_stdout) { "imagemagick-c++ 21.4-19.el6_5" }
|
178
178
|
|
179
179
|
it "should run rpm -u --oldpackage with the package source to downgrade" do
|
180
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
180
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
181
181
|
provider.action_install
|
182
182
|
end
|
183
183
|
|
@@ -208,7 +208,7 @@ describe Chef::Provider::Package::Rpm do
|
|
208
208
|
let(:rpm_q_stdout) { "imagemagick-c++ 0.5.4.7-7.el6_5" }
|
209
209
|
|
210
210
|
it "runs rpm -u with the package source to upgrade" do
|
211
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
211
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
212
212
|
provider.action_upgrade
|
213
213
|
end
|
214
214
|
end
|
@@ -224,7 +224,7 @@ describe Chef::Provider::Package::Rpm do
|
|
224
224
|
let(:rpm_q_stdout) { "imagemagick-c++ 21.4-19.el6_5" }
|
225
225
|
|
226
226
|
it "should run rpm -u --oldpackage with the package source to downgrade" do
|
227
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
227
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
228
228
|
provider.action_upgrade
|
229
229
|
end
|
230
230
|
|
@@ -368,7 +368,7 @@ describe Chef::Provider::Package::Rpm do
|
|
368
368
|
describe "action install" do
|
369
369
|
|
370
370
|
it "installs the package" do
|
371
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-i", package_source, timeout: 900)
|
371
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-i", package_source, env: {}, timeout: 900)
|
372
372
|
|
373
373
|
provider.action_install
|
374
374
|
end
|
@@ -376,7 +376,7 @@ describe Chef::Provider::Package::Rpm do
|
|
376
376
|
context "when custom resource options are given" do
|
377
377
|
it "installs with custom options specified in the resource" do
|
378
378
|
new_resource.options("--dbpath /var/lib/rpm")
|
379
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "--dbpath", "/var/lib/rpm", "-i", package_source, timeout: 900)
|
379
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "--dbpath", "/var/lib/rpm", "-i", package_source, env: {}, timeout: 900)
|
380
380
|
provider.action_install
|
381
381
|
end
|
382
382
|
end
|
@@ -387,7 +387,7 @@ describe Chef::Provider::Package::Rpm do
|
|
387
387
|
let(:action) { :upgrade }
|
388
388
|
|
389
389
|
it "installs the package" do
|
390
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-i", package_source, timeout: 900)
|
390
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-i", package_source, env: {}, timeout: 900)
|
391
391
|
|
392
392
|
provider.action_upgrade
|
393
393
|
end
|
@@ -424,7 +424,7 @@ describe Chef::Provider::Package::Rpm do
|
|
424
424
|
it "should install from a path when the package is a path and the source is nil" do
|
425
425
|
expect(new_resource.source).to eq("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
|
426
426
|
provider.current_resource = current_resource
|
427
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-i", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
427
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-i", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
428
428
|
provider.install_package("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", "6.5.4.7-7.el6_5")
|
429
429
|
end
|
430
430
|
|
@@ -432,7 +432,7 @@ describe Chef::Provider::Package::Rpm do
|
|
432
432
|
expect(new_resource.source).to eq("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
|
433
433
|
current_resource.version("21.4-19.el5")
|
434
434
|
provider.current_resource = current_resource
|
435
|
-
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", timeout: 900)
|
435
|
+
expect(provider).to receive(:shell_out_compacted!).with("rpm", "-U", "--oldpackage", "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", env: {}, timeout: 900)
|
436
436
|
provider.upgrade_package("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", "6.5.4.7-7.el6_5")
|
437
437
|
end
|
438
438
|
end
|
data/spec/unit/recipe_spec.rb
CHANGED
@@ -630,6 +630,57 @@ describe Chef::Recipe do
|
|
630
630
|
end
|
631
631
|
end
|
632
632
|
|
633
|
+
describe "from_json_file" do
|
634
|
+
it "raises IOError if the file does not exist" do
|
635
|
+
filename = "/nonexistent"
|
636
|
+
allow(File).to receive(:file?).and_call_original
|
637
|
+
allow(File).to receive(:file?).with(filename).and_return(false)
|
638
|
+
expect { recipe.from_json_file(filename) }.to raise_error(IOError, /Cannot open or read/)
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
describe "from_json" do
|
643
|
+
it "raises ArgumentError if the JSON is not a top-level hash" do
|
644
|
+
json = <<~JSON
|
645
|
+
[
|
646
|
+
"one",
|
647
|
+
"resources",
|
648
|
+
"three"
|
649
|
+
]
|
650
|
+
JSON
|
651
|
+
expect { recipe.from_json(json) }.to raise_error(ArgumentError, /must contain a top-level 'resources' hash/)
|
652
|
+
end
|
653
|
+
|
654
|
+
it "raises ArgumentError if the JSON does not contain a resources hash" do
|
655
|
+
json = <<~JSON
|
656
|
+
{
|
657
|
+
"airplanes": [
|
658
|
+
{
|
659
|
+
"type": "execute",
|
660
|
+
"command": "whoami"
|
661
|
+
}
|
662
|
+
]
|
663
|
+
}
|
664
|
+
JSON
|
665
|
+
expect { recipe.from_json(json) }.to raise_error(ArgumentError, /must contain a top-level 'resources' hash/)
|
666
|
+
end
|
667
|
+
|
668
|
+
it "does not raise if the JSON contains a resources hash" do
|
669
|
+
json = <<~JSON
|
670
|
+
{
|
671
|
+
"resources": [
|
672
|
+
{
|
673
|
+
"type": "execute",
|
674
|
+
"command": "whoami"
|
675
|
+
}
|
676
|
+
]
|
677
|
+
}
|
678
|
+
JSON
|
679
|
+
expect(recipe).to receive(:from_hash).with({ "resources" => [{ "command" => "whoami", "type" => "execute" }] })
|
680
|
+
recipe.from_json(json)
|
681
|
+
end
|
682
|
+
end
|
683
|
+
|
633
684
|
describe "from_hash" do
|
634
685
|
it "declares resources from a hash" do
|
635
686
|
resources = { "resources" => [
|
@@ -63,4 +63,9 @@ describe Chef::Resource::AptPackage, "initialize" do
|
|
63
63
|
resource.response_file_variables({ variables: true })
|
64
64
|
expect(resource.response_file_variables).to eql({ variables: true })
|
65
65
|
end
|
66
|
+
|
67
|
+
it "accepts a hash for environment variables" do
|
68
|
+
resource.environment({ variables: true })
|
69
|
+
expect(resource.environment).to eql({ variables: true })
|
70
|
+
end
|
66
71
|
end
|
@@ -53,6 +53,12 @@ describe Chef::Resource::DnfPackage, "defaults" do
|
|
53
53
|
expect { resource.action :unlock }.not_to raise_error
|
54
54
|
expect { resource.action :upgrade }.not_to raise_error
|
55
55
|
end
|
56
|
+
|
57
|
+
it "accepts a hash for environment variables" do
|
58
|
+
resource.environment({ variables: true })
|
59
|
+
expect(resource.environment).to eql({ variables: true })
|
60
|
+
end
|
61
|
+
|
56
62
|
end
|
57
63
|
|
58
64
|
describe Chef::Resource::DnfPackage, "flush_cache" do
|
@@ -108,5 +108,78 @@ describe Chef::Resource::Ohai do
|
|
108
108
|
expect(node[:origdata]).to eq("somevalue")
|
109
109
|
expect(node[:newdata]).to eq("somevalue")
|
110
110
|
end
|
111
|
+
|
112
|
+
it "loads cookbook plugins when the ohai_segment_plugin_path directory exists and has content" do
|
113
|
+
# Setup mock plugin path
|
114
|
+
plugin_path = "/tmp/chef/ohai/cookbook_plugins"
|
115
|
+
Chef::Config[:ohai_segment_plugin_path] = plugin_path
|
116
|
+
|
117
|
+
# Mock that the directory exists and has content
|
118
|
+
allow(Dir).to receive(:exist?).with(plugin_path).and_return(true)
|
119
|
+
allow(Dir).to receive(:empty?).with(plugin_path).and_return(false)
|
120
|
+
|
121
|
+
# Mock the ohai system
|
122
|
+
ohai_mock = double("Ohai::System")
|
123
|
+
config_mock = double("config")
|
124
|
+
plugin_path_array = []
|
125
|
+
|
126
|
+
allow(ohai_mock).to receive(:config).and_return(config_mock)
|
127
|
+
allow(config_mock).to receive(:[]).with(:plugin_path).and_return(plugin_path_array)
|
128
|
+
allow(ohai_mock).to receive(:all_plugins).with(nil)
|
129
|
+
allow(ohai_mock).to receive(:data).and_return({})
|
130
|
+
allow(Ohai::System).to receive(:new).and_return(ohai_mock)
|
131
|
+
|
132
|
+
provider.run_action(:reload)
|
133
|
+
|
134
|
+
# Verify that the plugin path was added to the ohai config
|
135
|
+
expect(plugin_path_array).to include(plugin_path)
|
136
|
+
end
|
137
|
+
|
138
|
+
it "does not attempt to load cookbook plugins when the ohai_segment_plugin_path directory does not exist" do
|
139
|
+
# Setup mock plugin path that doesn't exist
|
140
|
+
plugin_path = "/tmp/chef/ohai/cookbook_plugins"
|
141
|
+
Chef::Config[:ohai_segment_plugin_path] = plugin_path
|
142
|
+
|
143
|
+
# Mock that the directory doesn't exist
|
144
|
+
allow(Dir).to receive(:exist?).with(plugin_path).and_return(false)
|
145
|
+
|
146
|
+
# Mock the ohai system
|
147
|
+
ohai_mock = double("Ohai::System")
|
148
|
+
config_mock = spy("config")
|
149
|
+
|
150
|
+
allow(ohai_mock).to receive(:config).and_return(config_mock)
|
151
|
+
allow(ohai_mock).to receive(:all_plugins).with(nil)
|
152
|
+
allow(ohai_mock).to receive(:data).and_return({})
|
153
|
+
allow(Ohai::System).to receive(:new).and_return(ohai_mock)
|
154
|
+
|
155
|
+
provider.run_action(:reload)
|
156
|
+
|
157
|
+
# Verify that the plugin path configuration was not accessed since directory doesn't exist
|
158
|
+
expect(config_mock).not_to have_received(:[]).with(:additional_plugin_path)
|
159
|
+
end
|
160
|
+
|
161
|
+
it "does not attempt to load cookbook plugins when the ohai_segment_plugin_path directory is empty" do
|
162
|
+
# Setup mock plugin path that exists but is empty
|
163
|
+
plugin_path = "/tmp/chef/ohai/cookbook_plugins"
|
164
|
+
Chef::Config[:ohai_segment_plugin_path] = plugin_path
|
165
|
+
|
166
|
+
# Mock that the directory exists but is empty
|
167
|
+
allow(Dir).to receive(:exist?).with(plugin_path).and_return(true)
|
168
|
+
allow(Dir).to receive(:empty?).with(plugin_path).and_return(true)
|
169
|
+
|
170
|
+
# Mock the ohai system
|
171
|
+
ohai_mock = double("Ohai::System")
|
172
|
+
config_mock = spy("config")
|
173
|
+
|
174
|
+
allow(ohai_mock).to receive(:config).and_return(config_mock)
|
175
|
+
allow(ohai_mock).to receive(:all_plugins).with(nil)
|
176
|
+
allow(ohai_mock).to receive(:data).and_return({})
|
177
|
+
allow(Ohai::System).to receive(:new).and_return(ohai_mock)
|
178
|
+
|
179
|
+
provider.run_action(:reload)
|
180
|
+
|
181
|
+
# Verify that the plugin path configuration was not accessed since directory is empty
|
182
|
+
expect(config_mock).not_to have_received(:[]).with(:additional_plugin_path)
|
183
|
+
end
|
111
184
|
end
|
112
185
|
end
|
@@ -148,3 +148,12 @@ describe Chef::Resource::YumPackage, "yum_binary" do
|
|
148
148
|
expect(resource.yum_binary).to eql("/usr/bin/yum-something")
|
149
149
|
end
|
150
150
|
end
|
151
|
+
|
152
|
+
describe Chef::Resource::YumPackage, "environment" do
|
153
|
+
let(:resource) { Chef::Resource::YumPackage.new("foo") }
|
154
|
+
|
155
|
+
it "should allow you to specify the environment" do
|
156
|
+
resource.environment({ variables: true })
|
157
|
+
expect(resource.environment).to eql({ variables: true })
|
158
|
+
end
|
159
|
+
end
|
@@ -507,65 +507,7 @@ describe Chef::ResourceReporter do
|
|
507
507
|
it_should_behave_like "a successful client run"
|
508
508
|
end
|
509
509
|
|
510
|
-
context "windows registry_key resource" do
|
511
|
-
let(:current_resource) do
|
512
|
-
resource = Chef::Resource::RegistryKey.new('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager')
|
513
|
-
resource.values([{ name: "PendingFileRenameOperations", type: :multi_string, data: 10000.times.map { |n| "C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Temp\\2\\Chef-20140107123456-1234-#{n}" } } ])
|
514
|
-
resource
|
515
|
-
end
|
516
|
-
|
517
|
-
let(:new_resource) do
|
518
|
-
resource = Chef::Resource::RegistryKey.new('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager')
|
519
|
-
resource.values([ { name: "ProtectionMode", type: :dword, data: 1 } ])
|
520
|
-
allow(resource).to receive(:cookbook_name).and_return(cookbook_name)
|
521
|
-
allow(resource).to receive(:cookbook_version).and_return(cookbook_version)
|
522
|
-
resource
|
523
|
-
end
|
524
|
-
|
525
|
-
it "should raise an error when the data is too large" do
|
526
|
-
pending "Need to test truncation properly"
|
527
|
-
# Start the run
|
528
|
-
resource_reporter.run_started(run_status)
|
529
|
-
run_status.start_clock
|
530
|
-
|
531
|
-
# These 4 event callbacks are essential to populate resource state:
|
532
|
-
events.resource_action_start(new_resource, :create)
|
533
|
-
events.resource_current_state_loaded(new_resource, :create, current_resource)
|
534
|
-
events.resource_updated(new_resource, :create)
|
535
|
-
events.resource_completed(new_resource)
|
536
|
-
|
537
|
-
# Stop the run
|
538
|
-
run_status.stop_clock
|
539
|
-
|
540
|
-
# Prepare the run data - this will include the resource states
|
541
|
-
report_data = resource_reporter.prepare_run_data
|
542
|
-
|
543
|
-
# Verify the report includes our resource
|
544
|
-
expect(report_data["resources"].length).to eq(1)
|
545
|
-
expect(report_data["resources"][0]["before"]).to eq(current_resource.state_for_resource_reporter)
|
546
|
-
expect(report_data["resources"][0]["after"]).to eq(new_resource.state_for_resource_reporter)
|
547
|
-
|
548
|
-
expect(rest_client).to receive(:post) do |path, data, headers|
|
549
|
-
expect(path).to eq("reports/nodes/spitfire/runs")
|
550
|
-
raise Chef::Exceptions::ValidationFailed, "data too large" if data.length > 10000
|
551
|
-
end
|
552
|
-
|
553
|
-
# Now mock the actual post request to fail due to size
|
554
|
-
expect(rest_client).to receive(:raw_request) do |method, url, headers, data|
|
555
|
-
data_stream = Zlib::GzipReader.new(StringIO.new(data))
|
556
|
-
data = data_stream.read
|
557
|
-
expect(data).to include('"before":') # Verify current_resource state is included
|
558
|
-
expect(data).to include('"after":') # Verify new_resource state is included
|
559
|
-
raise Chef::Exceptions::ValidationFailed, "data too large"
|
560
|
-
end
|
561
|
-
|
562
|
-
# Assert that the post fails due to validation
|
563
|
-
expect { resource_reporter.run_completed(node) }.to raise_error(Chef::Exceptions::ValidationFailed)
|
564
|
-
end
|
565
|
-
end
|
566
|
-
|
567
510
|
context "for an unsuccessful run" do
|
568
|
-
|
569
511
|
before do
|
570
512
|
@backtrace = ["foo.rb:1 in `foo!'", "bar.rb:2 in `bar!", "'baz.rb:3 in `baz!'"]
|
571
513
|
node = Chef::Node.new
|
data/spec/unit/shell_spec.rb
CHANGED
@@ -65,11 +65,17 @@ describe Shell do
|
|
65
65
|
conf.main = Object.new
|
66
66
|
conf.main.instance_eval(&object_test_harness)
|
67
67
|
Shell.irb_conf[:IRB_RC].call(conf)
|
68
|
-
|
68
|
+
if RUBY_VERSION >= "3.3.0"
|
69
|
+
expect(conf.prompt_c).to eq("chef > ")
|
70
|
+
expect(conf.prompt_n).to eq("chef ?> ")
|
71
|
+
expect(conf.prompt_s).to eq("chef%l> ")
|
72
|
+
else
|
73
|
+
expect(conf.prompt_c).to eq("chef (#{Chef::VERSION})> ")
|
74
|
+
expect(conf.prompt_n).to eq("chef(#{Chef::VERSION})?> ")
|
75
|
+
expect(conf.prompt_s).to eq("chef(#{Chef::VERSION})%l> ")
|
76
|
+
end
|
69
77
|
expect(conf.return_format).to eq(" => %s \n")
|
70
78
|
expect(conf.prompt_i).to eq("chef (#{Chef::VERSION})> ")
|
71
|
-
expect(conf.prompt_n).to eq("chef ?> ")
|
72
|
-
expect(conf.prompt_s).to eq("chef%l> ")
|
73
79
|
expect(conf.use_tracer).to eq(false)
|
74
80
|
end
|
75
81
|
|
@@ -80,10 +86,17 @@ describe Shell do
|
|
80
86
|
events = Chef::EventDispatch::Dispatcher.new
|
81
87
|
conf.main = Chef::Recipe.new(nil, nil, Chef::RunContext.new(Chef::Node.new, {}, events))
|
82
88
|
Shell.irb_conf[:IRB_RC].call(conf)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
if RUBY_VERSION >= "3.3.0"
|
90
|
+
expect(conf.prompt_c).to eq("chef:recipe > ")
|
91
|
+
expect(conf.prompt_n).to eq("chef:recipe ?> ")
|
92
|
+
expect(conf.prompt_s).to eq("chef:recipe%l> ")
|
93
|
+
else
|
94
|
+
expect(conf.prompt_c).to eq("chef:recipe (#{Chef::VERSION})> ")
|
95
|
+
expect(conf.prompt_n).to eq("chef:recipe(#{Chef::VERSION})?> ")
|
96
|
+
expect(conf.prompt_s).to eq("chef:recipe(#{Chef::VERSION})%l> ")
|
97
|
+
end
|
98
|
+
|
99
|
+
expect(conf.prompt_i).to eq("chef:recipe (#{Chef::VERSION})> ")
|
87
100
|
end
|
88
101
|
|
89
102
|
it "has a prompt like ``chef:attributes > '' in attributes/node context" do
|
@@ -92,10 +105,17 @@ describe Shell do
|
|
92
105
|
conf = OpenStruct.new
|
93
106
|
conf.main = Chef::Node.new
|
94
107
|
Shell.irb_conf[:IRB_RC].call(conf)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
108
|
+
|
109
|
+
if RUBY_VERSION >= "3.3.0"
|
110
|
+
expect(conf.prompt_c).to eq("chef:attributes > ")
|
111
|
+
expect(conf.prompt_n).to eq("chef:attributes ?> ")
|
112
|
+
expect(conf.prompt_s).to eq("chef:attributes%l> ")
|
113
|
+
else
|
114
|
+
expect(conf.prompt_c).to eq("chef:attributes (#{Chef::VERSION})> ")
|
115
|
+
expect(conf.prompt_n).to eq("chef:attributes(#{Chef::VERSION})?> ")
|
116
|
+
expect(conf.prompt_s).to eq("chef:attributes(#{Chef::VERSION})%l> ")
|
117
|
+
end
|
118
|
+
expect(conf.prompt_i).to eq("chef:attributes (#{Chef::VERSION})> ")
|
99
119
|
end
|
100
120
|
|
101
121
|
end
|
data/tasks/rspec.rb
CHANGED
@@ -67,7 +67,7 @@ begin
|
|
67
67
|
desc "Run chef's node and role unit specs with activesupport loaded"
|
68
68
|
RSpec::Core::RakeTask.new(:activesupport) do |t|
|
69
69
|
t.verbose = false
|
70
|
-
t.rspec_opts = %w{--
|
70
|
+
t.rspec_opts = %w{--profile}
|
71
71
|
# Only node_spec and role_spec specifically have issues, target those tests
|
72
72
|
t.pattern = FileList["spec/unit/node_spec.rb", "spec/unit/role_spec.rb"]
|
73
73
|
end
|
metadata
CHANGED
@@ -1,43 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 18.
|
4
|
+
version: 18.8.9
|
5
5
|
platform: universal-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.7.1
|
20
|
+
- - "<="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 7.1.3.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 4.2.7.1
|
30
|
+
- - "<="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 7.1.3.2
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: chef-config
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
16
36
|
requirements:
|
17
37
|
- - '='
|
18
38
|
- !ruby/object:Gem::Version
|
19
|
-
version: 18.
|
39
|
+
version: 18.8.9
|
20
40
|
type: :runtime
|
21
41
|
prerelease: false
|
22
42
|
version_requirements: !ruby/object:Gem::Requirement
|
23
43
|
requirements:
|
24
44
|
- - '='
|
25
45
|
- !ruby/object:Gem::Version
|
26
|
-
version: 18.
|
46
|
+
version: 18.8.9
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: chef-utils
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
30
50
|
requirements:
|
31
51
|
- - '='
|
32
52
|
- !ruby/object:Gem::Version
|
33
|
-
version: 18.
|
53
|
+
version: 18.8.9
|
34
54
|
type: :runtime
|
35
55
|
prerelease: false
|
36
56
|
version_requirements: !ruby/object:Gem::Requirement
|
37
57
|
requirements:
|
38
58
|
- - '='
|
39
59
|
- !ruby/object:Gem::Version
|
40
|
-
version: 18.
|
60
|
+
version: 18.8.9
|
41
61
|
- !ruby/object:Gem::Dependency
|
42
62
|
name: train-core
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -374,14 +394,14 @@ dependencies:
|
|
374
394
|
requirements:
|
375
395
|
- - ">="
|
376
396
|
- !ruby/object:Gem::Version
|
377
|
-
version: 15.0.
|
397
|
+
version: 15.0.21
|
378
398
|
type: :runtime
|
379
399
|
prerelease: false
|
380
400
|
version_requirements: !ruby/object:Gem::Requirement
|
381
401
|
requirements:
|
382
402
|
- - ">="
|
383
403
|
- !ruby/object:Gem::Version
|
384
|
-
version: 15.0.
|
404
|
+
version: 15.0.21
|
385
405
|
- !ruby/object:Gem::Dependency
|
386
406
|
name: chef-vault
|
387
407
|
requirement: !ruby/object:Gem::Requirement
|
@@ -486,6 +506,20 @@ dependencies:
|
|
486
506
|
- - "~>"
|
487
507
|
- !ruby/object:Gem::Version
|
488
508
|
version: 0.0.8.2
|
509
|
+
- !ruby/object:Gem::Dependency
|
510
|
+
name: uri
|
511
|
+
requirement: !ruby/object:Gem::Requirement
|
512
|
+
requirements:
|
513
|
+
- - "~>"
|
514
|
+
- !ruby/object:Gem::Version
|
515
|
+
version: 1.0.3
|
516
|
+
type: :runtime
|
517
|
+
prerelease: false
|
518
|
+
version_requirements: !ruby/object:Gem::Requirement
|
519
|
+
requirements:
|
520
|
+
- - "~>"
|
521
|
+
- !ruby/object:Gem::Version
|
522
|
+
version: 1.0.3
|
489
523
|
- !ruby/object:Gem::Dependency
|
490
524
|
name: corefoundation
|
491
525
|
requirement: !ruby/object:Gem::Requirement
|