summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-21 13:16:08 -0500
committerLuke Kanies <luke@madstop.com>2008-07-21 13:16:08 -0500
commitd9aa5ab68fb3196f5db526050c440c470b55a5f6 (patch)
tree596e39ce1ddb6d62cadc12432a12cae7d72fc229 /test
parent686ba4d4c21f6f1e073bd845492f2fe3cb4837a2 (diff)
downloadpuppet-d9aa5ab68fb3196f5db526050c440c470b55a5f6.tar.gz
puppet-d9aa5ab68fb3196f5db526050c440c470b55a5f6.tar.xz
puppet-d9aa5ab68fb3196f5db526050c440c470b55a5f6.zip
Fixing a cert test to pass on Darwin.
Darwin has a case-insensitive FS, so the test was failing because it was specifically testing case sensitivity. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/certmgr/support.rb43
1 files changed, 26 insertions, 17 deletions
diff --git a/test/certmgr/support.rb b/test/certmgr/support.rb
index c055cbca1..10d431939 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