From 26f18a2ae5ca7e4447a80c5ae59df756e77ea6f9 Mon Sep 17 00:00:00 2001 From: luke Date: Wed, 12 Apr 2006 17:36:14 +0000 Subject: Fixing puppetca so it does not call chuser; instead, it is configured to create all of the files with the correct permissions and ownership (using Config#write and Config#writesub). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1111 980ebf18-57e1-0310-9a29-db15c13687c0 --- test/executables/puppetca.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/executables') diff --git a/test/executables/puppetca.rb b/test/executables/puppetca.rb index 67df0a6b6..a38296a54 100755 --- a/test/executables/puppetca.rb +++ b/test/executables/puppetca.rb @@ -25,7 +25,7 @@ class TestPuppetCA < Test::Unit::TestCase end def runca(args) - return %x{puppetca --confdir=#{Puppet[:confdir]} --user #{Process.uid} --group #{Process.gid} #{args} 2>&1} + return %x{puppetca --confdir=#{Puppet[:confdir]} #{args} 2>&1} end @@ -60,8 +60,17 @@ class TestPuppetCA < Test::Unit::TestCase assert_nothing_raised { output = runca("--sign -a").chomp.split("\n") } + + assert_equal($?,0) assert_equal(["Signed host.test.com"], output) + + signedfile = File.join(Puppet[:signeddir], "host.test.com.pem") + assert(FileTest.exists?(signedfile), "cert does not exist") + assert(! FileTest.executable?(signedfile), "cert is executable") + if Process.uid == 0 + assert(! FileTest.owned?(signedfile), "cert is owned by root") + end assert_nothing_raised { output = runca("--list").chomp.split("\n") } -- cgit