0
@@ -79,22 +79,31 @@ class TestCertSupport < Test::Unit::TestCase
0
- def test_uppercase_files_are_renamed_and_read
0
- # Write a key out to disk in a file containing upper-case.
0
- key = OpenSSL::PKey::RSA.new(32)
0
- should_path = Puppet[:hostprivkey]
0
- dir, file = File.split(should_path)
0
- newfile = file.sub(/^([a-z.]+)\./) { $1.upcase + "."}
0
- upper_path = File.join(dir, newfile)
0
- File.open(upper_path, "w") { |f| f.print key.to_s }
0
- assert_equal(key.to_s, user.read_key.to_s, "Did not read key in from disk")
0
- assert(! FileTest.exist?(upper_path), "Upper case file was not removed")
0
- assert(FileTest.exist?(should_path), "File was not renamed to lower-case file")
0
- assert_equal(key.to_s, user.read_key.to_s, "Did not read key in from disk")
0
+ # Fixing #1382. This test will always fail on Darwin, because its
0
+ # FS is case-insensitive.
0
+ unless Facter.value(:operatingsystem) == "Darwin"
0
+ def test_uppercase_files_are_renamed_and_read
0
+ # Write a key out to disk in a file containing upper-case.
0
+ key = OpenSSL::PKey::RSA.new(32)
0
+ should_path = Puppet[:hostprivkey]
0
+ puts "%s: %s" % [should_path, FileTest.exist?(should_path).inspect]
0
+ dir, file = File.split(should_path)
0
+ newfile = file.sub(/^([a-z.]+)\./) { $1.upcase + "."}
0
+ puts "%s: %s" % [should_path, FileTest.exist?(should_path).inspect]
0
+ upper_path = File.join(dir, newfile)
0
+ puts "%s: %s" % [should_path, FileTest.exist?(should_path).inspect]
0
+ puts "%s: %s" % [upper_path, FileTest.exist?(upper_path).inspect]
0
+ File.open(upper_path, "w") { |f| f.print key.to_s }
0
+ puts "%s: %s" % [should_path, FileTest.exist?(should_path).inspect]
0
+ puts "%s: %s" % [upper_path, FileTest.exist?(upper_path).inspect]
0
+ assert_equal(key.to_s, user.read_key.to_s, "Did not read key in from disk")
0
+ assert(! FileTest.exist?(upper_path), "Upper case file was not removed")
0
+ assert(FileTest.exist?(should_path), "File was not renamed to lower-case file")
0
+ assert_equal(key.to_s, user.read_key.to_s, "Did not read key in from disk")
Comments
No one has commented yet.