From 9e502ed121847fe4fcca90453c0520b53103d17d Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 27 Jul 2011 15:28:21 -0700 Subject: (#8663) Reenable spec tests on Windows that now pass The cacher was causing spec tests to fail due to Time.now not having millisecond resolution on Windows. Now that usage of the cacher has been removed from many places, these tests now pass. Reviewed-by: Jacob Helwig --- spec/integration/parser/ruby_manifest_spec.rb | 2 +- spec/integration/resource/type_collection_spec.rb | 2 +- spec/unit/indirector/file_bucket_file/file_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/integration/parser/ruby_manifest_spec.rb b/spec/integration/parser/ruby_manifest_spec.rb index b04baf5e0..7f3bb71e9 100755 --- a/spec/integration/parser/ruby_manifest_spec.rb +++ b/spec/integration/parser/ruby_manifest_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'tempfile' require 'puppet_spec/files' -describe "Pure ruby manifests", :fails_on_windows => true do +describe "Pure ruby manifests" do include PuppetSpec::Files before do diff --git a/spec/integration/resource/type_collection_spec.rb b/spec/integration/resource/type_collection_spec.rb index 0852a9850..6ea2e7fe7 100755 --- a/spec/integration/resource/type_collection_spec.rb +++ b/spec/integration/resource/type_collection_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'puppet_spec/files' require 'puppet/resource/type_collection' -describe Puppet::Resource::TypeCollection, :fails_on_windows => true do +describe Puppet::Resource::TypeCollection do describe "when autoloading from modules" do include PuppetSpec::Files diff --git a/spec/unit/indirector/file_bucket_file/file_spec.rb b/spec/unit/indirector/file_bucket_file/file_spec.rb index ee0b61af1..eb86eee85 100755 --- a/spec/unit/indirector/file_bucket_file/file_spec.rb +++ b/spec/unit/indirector/file_bucket_file/file_spec.rb @@ -14,7 +14,7 @@ describe Puppet::FileBucketFile::File do Puppet::FileBucketFile::File.doc.should be_instance_of(String) end - describe "non-stubbing tests", :fails_on_windows => true do + describe "non-stubbing tests" do include PuppetSpec::Files before do -- cgit From 6bd8aaa8a8307913eb20afc4e57551e2dfd4822e Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 27 Jul 2011 15:30:49 -0700 Subject: (#8663) The ssh_authorized_key type is not supported on Windows We are not supporting the ssh_authorized_key type on Windows at this time, since Windows does not ship with an ssh server (though there are third-party versions available). As a result these spec tests have been disabled. Reviewed-by: Jacob Helwig --- spec/unit/type/ssh_authorized_key_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/type/ssh_authorized_key_spec.rb b/spec/unit/type/ssh_authorized_key_spec.rb index 9b3760b71..41413763c 100755 --- a/spec/unit/type/ssh_authorized_key_spec.rb +++ b/spec/unit/type/ssh_authorized_key_spec.rb @@ -228,7 +228,7 @@ describe ssh_authorized_key do end - describe "when user is specified", :fails_on_windows => true do + describe "when user is specified", :unless => Puppet.features.microsoft_windows? do it "should determine target" do resource = @class.create( -- cgit From f883648d2f6e4c357263c0cf3aa39afd63d852d7 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 27 Jul 2011 15:36:20 -0700 Subject: (#8663) Update the run_mode spec test on Windows to match the code When running as root, the default conf and var directories on Windows are currently puppet/etc and puppet/var within the windows directory. Updated the spec tests to match what the code does on Windows. Whether or not this is the correct behavior is something that will be addressed in the future. See #8660. Reviewed-by: Jacob Helwig --- spec/unit/util/run_mode_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/unit/util/run_mode_spec.rb b/spec/unit/util/run_mode_spec.rb index 883ee1206..5d9a3d058 100755 --- a/spec/unit/util/run_mode_spec.rb +++ b/spec/unit/util/run_mode_spec.rb @@ -1,14 +1,16 @@ #!/usr/bin/env rspec require 'spec_helper' -describe Puppet::Util::RunMode, :fails_on_windows => true do +describe Puppet::Util::RunMode do before do @run_mode = Puppet::Util::RunMode.new('fake') end it "should have confdir /etc/puppet when run as root" do Puppet.features.stubs(:root?).returns(true) - @run_mode.conf_dir.should == '/etc/puppet' + etcdir = Puppet.features.microsoft_windows? ? File.join(Dir::WINDOWS, "puppet", "etc") : '/etc/puppet' + # REMIND: issue with windows backslashes + @run_mode.conf_dir.should == File.expand_path(etcdir) end it "should have confdir ~/.puppet when run as non-root" do @@ -19,7 +21,9 @@ describe Puppet::Util::RunMode, :fails_on_windows => true do it "should have vardir /var/lib/puppet when run as root" do Puppet.features.stubs(:root?).returns(true) - @run_mode.var_dir.should == '/var/lib/puppet' + vardir = Puppet.features.microsoft_windows? ? File.join(Dir::WINDOWS, "puppet", "var") : '/var/lib/puppet' + # REMIND: issue with windows backslashes + @run_mode.var_dir.should == File.expand_path(vardir) end it "should have vardir ~/.puppet/var when run as non-root" do -- cgit From e0d3f11fc7b580aedec5350dc41a01417d6acd8d Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 27 Jul 2011 15:46:43 -0700 Subject: (#8663) Drive letters are not valid absolute paths on Windows One of the file spec tests was attempting to use X: as a fully qualified file path, and the file type was correctly rejecting it, since it is a relative path. This commit changes the spec test to expect the file type to raise an exception. Reviewed-by: Jacob Helwig --- spec/unit/type/file_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb index f416e987a..6be8acfca 100755 --- a/spec/unit/type/file_spec.rb +++ b/spec/unit/type/file_spec.rb @@ -305,9 +305,8 @@ describe Puppet::Type.type(:file) do file[:path].should == "X:/" end - it "should add a slash to a drive letter", :'fails_on_windows' => true, :'fails_on_ruby_1.9.2' => true do - file = Puppet::Type::File.new(:path => "X:") - file[:path].should == "X:/" + it "should not accept a drive letter without a slash", :'fails_on_ruby_1.9.2' => true do + lambda { Puppet::Type::File.new(:path => "X:") }.should raise_error(/File paths must be fully qualified/) end end -- cgit