summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-10-04 12:22:44 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-10-04 12:22:47 -0700
commit1a00c07971c4297bce1b3e0edee3b6b3399e17bb (patch)
tree0a8b1f1be1eddcb31e1b0ff7d69dbb60bd1c7e81 /test
parentd43f7996b93c394df0bd0994ae7298fb35ad2c5e (diff)
parent66cf3a925b4b6d9b40cbdf95f2be6575bb05a881 (diff)
downloadpuppet-1a00c07971c4297bce1b3e0edee3b6b3399e17bb.tar.gz
puppet-1a00c07971c4297bce1b3e0edee3b6b3399e17bb.tar.xz
puppet-1a00c07971c4297bce1b3e0edee3b6b3399e17bb.zip
Partial merge to 2.6.2rc1 : Merge commit '66cf3a9' into next
There are test failures in commits following this one.
Diffstat (limited to 'test')
-rwxr-xr-xtest/certmgr/ca.rb87
1 files changed, 0 insertions, 87 deletions
diff --git a/test/certmgr/ca.rb b/test/certmgr/ca.rb
deleted file mode 100755
index 7e0498dfb..000000000
--- a/test/certmgr/ca.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../lib/puppettest'
-
-require 'puppet'
-require 'puppet/sslcertificates/ca.rb'
-require 'puppettest'
-require 'puppettest/certificates'
-require 'mocha'
-
-class TestCA < Test::Unit::TestCase
- include PuppetTest
-
- def setup
- super
- Puppet::Util::SUIDManager.stubs(:asuser).yields
- end
-
- def hosts
- %w{host.domain.com Other.Testing.Com}
- end
- def mkca
- Puppet::SSLCertificates::CA.new
- end
-
- def test_clean
- dirs = [:csrdir, :signeddir, :publickeydir, :privatekeydir, :certdir]
- ca = mkca
-
- hosts.each do |host|
- files = []
- dirs.each do |dir|
- dir = Puppet[dir]
- # We handle case insensitivity through downcasing
- file = File.join(dir, host.downcase + ".pem")
- File.open(file, "w") do |f|
- f.puts "testing"
- end
- files << file
- end
- assert_nothing_raised do
- ca.clean(host)
- end
- files.each do |f|
- assert(! FileTest.exists?(f), "File #{f} was not deleted")
- end
- end
- end
-
- def test_host2Xfile
- ca = mkca
- hosts.each do |host|
- {:signeddir => :host2certfile, :csrdir => :host2csrfile}.each do |dir, method|
- val = nil
- assert_nothing_raised do
- val = ca.send(method, host)
- end
- assert_equal(File.join(Puppet[dir], host.downcase + ".pem"), val,
- "incorrect response from #{method}")
- end
- end
- end
-
- def test_list
- ca = mkca
- # Make a fake csr
- dir = Puppet[:csrdir]
- list = []
- hosts.each do |host|
- file = File.join(dir, host.downcase + ".pem")
- File.open(file, "w") { |f| f.puts "yay" }
- list << host.downcase
- end
-
- assert_equal(list.sort, ca.list.sort, "list was not correct")
- end
-
- # #142 - test storing the public key
- def test_store_public_key
- ca = mkca
- assert_nothing_raised do
- ca.mkrootcert
- end
- assert(FileTest.exists?(Puppet[:capub]), "did not store public key")
- end
-end
-