diff options
author | Claire McQuin <claire@getchef.com> | 2014-10-30 13:43:14 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-10-30 13:43:14 -0700 |
commit | 12df52abfbbcc018350a6caa6a640755611bc199 (patch) | |
tree | ef5c7e525670b684386ce3f17297a2d0ffd6cda3 | |
parent | 26c396f59a0716aa0528ea9731815796ac1856c6 (diff) | |
download | chef-12df52abfbbcc018350a6caa6a640755611bc199.tar.gz |
Fix some Windows specs.
-rw-r--r-- | spec/functional/dsl/reboot_pending_spec.rb | 10 | ||||
-rw-r--r-- | spec/functional/resource/link_spec.rb | 4 | ||||
-rw-r--r-- | spec/functional/resource/registry_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/shared/functional/securable_resource_with_reporting.rb | 18 |
4 files changed, 18 insertions, 16 deletions
diff --git a/spec/functional/dsl/reboot_pending_spec.rb b/spec/functional/dsl/reboot_pending_spec.rb index 35bfe8b918..14dd9412d5 100644 --- a/spec/functional/dsl/reboot_pending_spec.rb +++ b/spec/functional/dsl/reboot_pending_spec.rb @@ -48,14 +48,14 @@ describe Chef::DSL::RebootPending, :windows_only do describe "when there is nothing to indicate a reboot is pending" do it "should return false" do - pending "Found existing registry keys" unless registry_safe? + skip "Found existing registry keys" if registry_unsafe? expect(recipe.reboot_pending?).to be_falsey end end describe 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations' do it "returns true if the registry value exists" do - pending "Found existing registry keys" if registry_unsafe? + skip "Found existing registry keys" if registry_unsafe? registry.set_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations', :type => :multi_string, :data => ['\??\C:\foo.txt|\??\C:\bar.txt'] }) @@ -71,7 +71,7 @@ describe Chef::DSL::RebootPending, :windows_only do describe 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired' do it "returns true if the registry key exists" do - pending "Found existing registry keys" if registry_unsafe? + skip "Found existing registry keys" if registry_unsafe? registry.create_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired', false) expect(recipe.reboot_pending?).to be_truthy @@ -87,7 +87,7 @@ describe Chef::DSL::RebootPending, :windows_only do describe 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired' do it "returns true if the registry key exists" do pending "Permissions are limited to 'TrustedInstaller' by default" - pending "Found existing registry keys" if registry_unsafe? + skip "Found existing registry keys" if registry_unsafe? registry.create_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired', false) expect(recipe.reboot_pending?).to be_truthy @@ -102,7 +102,7 @@ describe Chef::DSL::RebootPending, :windows_only do describe 'HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile\Flags' do it "returns true if the registry key exists" do - pending "Found existing registry keys" if registry_unsafe? + skip "Found existing registry keys" if registry_unsafe? registry.create_key('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', true) registry.set_value('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', { :name => 'Flags', :type => :dword, :data => 3 }) diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb index 9416003660..a27224c94c 100644 --- a/spec/functional/resource/link_spec.rb +++ b/spec/functional/resource/link_spec.rb @@ -562,7 +562,7 @@ describe Chef::Resource::Link do resource.run_action(:create) expect(File.exists?(target_file)).to be_truthy # OS X gets angry about this sort of link. Bug in OS X, IMO. - pending('OS X/FreeBSD/AIX symlink? and readlink working on hard links to symlinks') + pending('OS X/FreeBSD/AIX symlink? and readlink working on hard links to symlinks') if (os_x? or freebsd? or aix?) expect(symlink?(target_file)).to be_truthy paths_eql?(readlink(target_file), @other_target).should be_truthy end @@ -578,7 +578,7 @@ describe Chef::Resource::Link do end context 'and the link does not yet exist' do it 'links to the target file' do - pending('OS X/FreeBSD/AIX fails to create hardlinks to broken symlinks') + pending('OS X/FreeBSD/AIX fails to create hardlinks to broken symlinks') if (os_x? or freebsd? or aix?) resource.run_action(:create) # Windows and Unix have different definitions of exists? here, and that's OK. if windows? diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb index bdd9b00511..d3120ac77c 100644 --- a/spec/functional/resource/registry_spec.rb +++ b/spec/functional/resource/registry_spec.rb @@ -40,7 +40,7 @@ describe Chef::Resource::RegistryKey, :unix_only do end end -describe Chef::Resource::RegistryKey, :windows_only do +describe Chef::Resource::RegistryKey, :windows_only, :pending => "Refactor helper methods" do # parent and key must be single keys, not paths let(:parent) { 'Opscode' } diff --git a/spec/support/shared/functional/securable_resource_with_reporting.rb b/spec/support/shared/functional/securable_resource_with_reporting.rb index 2bcdac5e88..8a2ceed837 100644 --- a/spec/support/shared/functional/securable_resource_with_reporting.rb +++ b/spec/support/shared/functional/securable_resource_with_reporting.rb @@ -268,11 +268,6 @@ shared_examples_for "a securable resource with reporting" do describe "reading file security metadata for reporting on windows", :windows_only do - before do - pending "windows reporting not yet fully supported" - end - - context "when the target file doesn't exist" do # Windows reporting data should look like this (+/- ish): @@ -284,11 +279,16 @@ shared_examples_for "a securable resource with reporting" do end it "has empty values for file metadata in 'current_resource'" do + pending "windows reporting not yet fully supported" expect(current_resource.owner).to be_nil expect(current_resource.expanded_rights).to be_nil end context "and no security metadata is specified in new_resource" do + before do + pending "windows reporting not yet fully supported" + end + it "sets the metadata values on the new_resource as strings after creating" do resource.run_action(:create) # TODO: most stable way to specify? @@ -300,7 +300,7 @@ shared_examples_for "a securable resource with reporting" do end - context "and owner is specified with a string (username) in new_resource" do + context "and owner is specified with a string (username) in new_resource" do # TODO/bug: duplicated from the "securable resource" tests let(:expected_user_name) { 'Guest' } @@ -322,6 +322,7 @@ shared_examples_for "a securable resource with reporting" do let(:expected_user_name) { 'domain\user' } before do + pending "windows reporting not yet fully supported" resource.owner(expected_user_name) resource.run_action(:create) end @@ -335,6 +336,7 @@ shared_examples_for "a securable resource with reporting" do context "when the target file exists" do before do + pending "windows reporting not yet fully supported" FileUtils.touch(resource.path) resource.action(:create) end @@ -378,7 +380,7 @@ shared_examples_for "a securable resource with reporting" do # TODO: before do blah it "sets the expanded_rights on the current resource" do - pending + skip end end @@ -386,7 +388,7 @@ shared_examples_for "a securable resource with reporting" do # TODO: before do blah it "sets the expanded rights on the current resource" do - pending + skip end end |