+1 (and tested on my Mac)

On Mon, Jul 21, 2008 at 11:58 AM, Luke Kanies <[EMAIL PROTECTED]> wrote:
>
> Darwin has a case-insensitive FS, so the test was failing
> because it was specifically testing case sensitivity.
>
> Signed-off-by: Luke Kanies <[EMAIL PROTECTED]>
> ---
>  lib/puppet/sslcertificates/support.rb |    1 +
>  test/certmgr/support.rb               |   43 
> ++++++++++++++++++++-------------
>  2 files changed, 27 insertions(+), 17 deletions(-)
>
> diff --git a/lib/puppet/sslcertificates/support.rb 
> b/lib/puppet/sslcertificates/support.rb
> index 95f15f0..bab250d 100644
> --- a/lib/puppet/sslcertificates/support.rb
> +++ b/lib/puppet/sslcertificates/support.rb
> @@ -28,6 +28,7 @@ module Puppet::SSLCertificates::Support
>
>         # Define the reading method.
>         define_method(reader) do
> +            p Puppet[param]
>             return nil unless FileTest.exists?(Puppet[param]) or 
> rename_files_with_uppercase(Puppet[param])
>
>             begin
> diff --git a/test/certmgr/support.rb b/test/certmgr/support.rb
> index c055cbc..10d4319 100755
> --- a/test/certmgr/support.rb
> +++ b/test/certmgr/support.rb
> @@ -79,22 +79,31 @@ class TestCertSupport < Test::Unit::TestCase
>         end
>     end
>
> -    # Fixing #1382.
> -    def test_uppercase_files_are_renamed_and_read
> -        # Write a key out to disk in a file containing upper-case.
> -        key = OpenSSL::PKey::RSA.new(32)
> -        should_path = Puppet[:hostprivkey]
> -
> -        dir, file = File.split(should_path)
> -        newfile = file.sub(/^([a-z.]+)\./) { $1.upcase + "."}
> -        upper_path = File.join(dir, newfile)
> -        File.open(upper_path, "w") { |f| f.print key.to_s }
> -
> -        user = CertUser.new
> -
> -        assert_equal(key.to_s, user.read_key.to_s, "Did not read key in from 
> disk")
> -        assert(! FileTest.exist?(upper_path), "Upper case file was not 
> removed")
> -        assert(FileTest.exist?(should_path), "File was not renamed to 
> lower-case file")
> -        assert_equal(key.to_s, user.read_key.to_s, "Did not read key in from 
> disk")
> +    # Fixing #1382.  This test will always fail on Darwin, because its
> +    # FS is case-insensitive.
> +    unless Facter.value(:operatingsystem) == "Darwin"
> +        def test_uppercase_files_are_renamed_and_read
> +            # Write a key out to disk in a file containing upper-case.
> +            key = OpenSSL::PKey::RSA.new(32)
> +            should_path = Puppet[:hostprivkey]
> +            puts "%s: %s" % [should_path, 
> FileTest.exist?(should_path).inspect]
> +
> +            dir, file = File.split(should_path)
> +            newfile = file.sub(/^([a-z.]+)\./) { $1.upcase + "."}
> +            puts "%s: %s" % [should_path, 
> FileTest.exist?(should_path).inspect]
> +            upper_path = File.join(dir, newfile)
> +            puts "%s: %s" % [should_path, 
> FileTest.exist?(should_path).inspect]
> +            puts "%s: %s" % [upper_path, FileTest.exist?(upper_path).inspect]
> +            File.open(upper_path, "w") { |f| f.print key.to_s }
> +            puts "%s: %s" % [should_path, 
> FileTest.exist?(should_path).inspect]
> +            puts "%s: %s" % [upper_path, FileTest.exist?(upper_path).inspect]
> +
> +            user = CertUser.new
> +
> +            assert_equal(key.to_s, user.read_key.to_s, "Did not read key in 
> from disk")
> +            assert(! FileTest.exist?(upper_path), "Upper case file was not 
> removed")
> +            assert(FileTest.exist?(should_path), "File was not renamed to 
> lower-case file")
> +            assert_equal(key.to_s, user.read_key.to_s, "Did not read key in 
> from disk")
> +        end
>     end
>  end
> --
> 1.5.3.7
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to