diff options
author | Tim Smith <tsmith@chef.io> | 2018-03-05 10:54:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-05 10:54:08 -0800 |
commit | c70692dd8c030ac33b3b4071a0ec0515e94b89f5 (patch) | |
tree | 62e2304c3595e506a89761122319f80ab6a8e631 /spec/unit | |
parent | 8a53dbeb261a69f7b740b36ac737085a2c13d546 (diff) | |
parent | 8f8e43e410d558b03850fc81d8ed11286d8ea1dd (diff) | |
download | chef-c70692dd8c030ac33b3b4071a0ec0515e94b89f5.tar.gz |
Merge pull request #6923 from chef/2k3
Remove support for Windows 2003
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/dsl/reboot_pending_spec.rb | 13 | ||||
-rw-r--r-- | spec/unit/platform/query_helpers_spec.rb | 13 | ||||
-rw-r--r-- | spec/unit/provider/link_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/remote_directory_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/win32/security_spec.rb | 8 |
5 files changed, 2 insertions, 36 deletions
diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb index 5cd7c7794f..2a12e27610 100644 --- a/spec/unit/dsl/reboot_pending_spec.rb +++ b/spec/unit/dsl/reboot_pending_spec.rb @@ -49,19 +49,6 @@ describe Chef::DSL::RebootPending do allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending').and_return(true) expect(recipe.reboot_pending?).to be_truthy end - - context "version is server 2003" do - before do - allow(Chef::Platform).to receive(:windows_server_2003?).and_return(true) - end - - it 'should return true if value "HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile" contains specific data on 2k3' do - allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(true) - allow(recipe).to receive(:registry_get_values).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return( - [{ :name => "Flags", :type => :dword, :data => 3 }]) - expect(recipe.reboot_pending?).to be_truthy - end - end end context "platform is ubuntu" do diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb index aa2b3c1f11..ac5158e913 100644 --- a/spec/unit/platform/query_helpers_spec.rb +++ b/spec/unit/platform/query_helpers_spec.rb @@ -18,19 +18,6 @@ require "spec_helper" -describe "Chef::Platform#windows_server_2003?" do - it "returns false early when not on windows" do - allow(ChefConfig).to receive(:windows?).and_return(false) - expect(Chef::Platform).not_to receive(:require) - expect(Chef::Platform.windows_server_2003?).to be_falsey - end - - # CHEF-4888: Need to call WIN32OLE.ole_initialize in new threads - it "does not raise an exception" do - expect { Thread.fork { Chef::Platform.windows_server_2003? }.join }.not_to raise_error - end -end - describe "Chef::Platform#windows_nano_server?" do include_context "Win32" diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb index 9426cf41dc..b233fac72b 100644 --- a/spec/unit/provider/link_spec.rb +++ b/spec/unit/provider/link_spec.rb @@ -25,7 +25,7 @@ if Chef::Platform.windows? require "chef/win32/file" #probably need this in spec_helper end -describe Chef::Resource::Link, :not_supported_on_win2k3 do +describe Chef::Resource::Link do let(:provider) do node = Chef::Node.new @events = Chef::EventDispatch::Dispatcher.new diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb index cb1b6e3cd8..d391da3010 100644 --- a/spec/unit/provider/remote_directory_spec.rb +++ b/spec/unit/provider/remote_directory_spec.rb @@ -193,7 +193,7 @@ describe Chef::Provider::RemoteDirectory do expect(::File.exist?(@destination_dir + "/a/multiply/nested/directory/qux.txt")).to be_falsey end - it "removes directory symlinks properly", :not_supported_on_win2k3 do + it "removes directory symlinks properly" do symlinked_dir_path = @destination_dir + "/symlinked_dir" @provider.action = :create @provider.run_action diff --git a/spec/unit/win32/security_spec.rb b/spec/unit/win32/security_spec.rb index 6e4441a482..9d98ccdf49 100644 --- a/spec/unit/win32/security_spec.rb +++ b/spec/unit/win32/security_spec.rb @@ -65,14 +65,8 @@ describe "Chef::Win32::Security", :windows_only do end describe "self.has_admin_privileges?" do - it "returns true for windows server 2003" do - allow(Chef::Platform).to receive(:windows_server_2003?).and_return(true) - expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to be true - end - context "when the user doesn't have admin privileges" do it "returns false" do - allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false) allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_raise("Access is denied.") expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to be false end @@ -80,7 +74,6 @@ describe "Chef::Win32::Security", :windows_only do context "when open_current_process_token fails with some other error than `Access is Denied`" do it "raises error" do - allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false) allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token).and_raise("boom") expect { Chef::ReservedNames::Win32::Security.has_admin_privileges? }.to raise_error(Chef::Exceptions::Win32APIError) end @@ -88,7 +81,6 @@ describe "Chef::Win32::Security", :windows_only do context "when the user has admin privileges" do it "returns true" do - allow(Chef::Platform).to receive(:windows_server_2003?).and_return(false) allow(Chef::ReservedNames::Win32::Security).to receive(:open_current_process_token) token = Chef::ReservedNames::Win32::Security.open_current_process_token allow(token).to receive_message_chain(:handle, :handle) |