summaryrefslogtreecommitdiffstats
path: root/test/executables/puppetca.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-07 23:12:33 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-07 23:12:33 +0000
commitb98e65f1fd858a1d0af415554db49a121a76232c (patch)
tree728f94dd17f88902c6bdf21ff6b17486babb08af /test/executables/puppetca.rb
parentf1ffc34c0927840beeb21e1e2d864ce14de5d15e (diff)
downloadpuppet-b98e65f1fd858a1d0af415554db49a121a76232c.tar.gz
puppet-b98e65f1fd858a1d0af415554db49a121a76232c.tar.xz
puppet-b98e65f1fd858a1d0af415554db49a121a76232c.zip
There is now full support for configuration files, and the entire system has been modified to expect their new behaviour. I have not yet run the test across all test hosts, though.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@873 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/executables/puppetca.rb')
-rwxr-xr-xtest/executables/puppetca.rb27
1 files changed, 15 insertions, 12 deletions
diff --git a/test/executables/puppetca.rb b/test/executables/puppetca.rb
index b69edb314..67df0a6b6 100755
--- a/test/executables/puppetca.rb
+++ b/test/executables/puppetca.rb
@@ -23,17 +23,20 @@ class TestPuppetCA < Test::Unit::TestCase
return cert
end
+
+ def runca(args)
+ return %x{puppetca --confdir=#{Puppet[:confdir]} --user #{Process.uid} --group #{Process.gid} #{args} 2>&1}
+
+ end
def test_signing
ca = nil
- Puppet[:ssldir] = tempfile()
- @@tmpfiles << Puppet[:ssldir]
Puppet[:autosign] = false
assert_nothing_raised {
ca = Puppet::Server::CA.new()
}
- #Puppet.warning "SSLDir is %s" % Puppet[:ssldir]
- #system("find %s" % Puppet[:ssldir])
+ #Puppet.warning "SSLDir is %s" % Puppet[:confdir]
+ #system("find %s" % Puppet[:confdir])
cert = mkcert("host.test.com")
resp = nil
@@ -43,24 +46,24 @@ class TestPuppetCA < Test::Unit::TestCase
resp = ca.getcert(cert.csr.to_pem, "fakename", "127.0.0.1")
}
assert_equal(["",""], resp)
- #Puppet.warning "SSLDir is %s" % Puppet[:ssldir]
- #system("find %s" % Puppet[:ssldir])
+ #Puppet.warning "SSLDir is %s" % Puppet[:confdir]
+ #system("find %s" % Puppet[:confdir])
output = nil
assert_nothing_raised {
- output = %x{puppetca --list --ssldir=#{Puppet[:ssldir]} 2>&1}.chomp.split("\n").reject { |line| line =~ /warning:/ } # stupid ssl.rb
+ output = runca("--list").chomp.split("\n").reject { |line| line =~ /warning:/ } # stupid ssl.rb
}
- #Puppet.warning "SSLDir is %s" % Puppet[:ssldir]
- #system("find %s" % Puppet[:ssldir])
+ #Puppet.warning "SSLDir is %s" % Puppet[:confdir]
+ #system("find %s" % Puppet[:confdir])
assert_equal($?,0)
assert_equal(%w{host.test.com}, output)
assert_nothing_raised {
- output = %x{puppetca --sign -a --ssldir=#{Puppet[:ssldir]}}.chomp.split("\n")
+ output = runca("--sign -a").chomp.split("\n")
}
assert_equal($?,0)
- assert_equal([], output)
+ assert_equal(["Signed host.test.com"], output)
assert_nothing_raised {
- output = %x{puppetca --list --ssldir=#{Puppet[:ssldir]}}.chomp.split("\n")
+ output = runca("--list").chomp.split("\n")
}
assert_equal($?,0)
assert_equal([], output)