diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-07 23:12:33 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-07 23:12:33 +0000 |
| commit | b98e65f1fd858a1d0af415554db49a121a76232c (patch) | |
| tree | 728f94dd17f88902c6bdf21ff6b17486babb08af /test/executables | |
| parent | f1ffc34c0927840beeb21e1e2d864ce14de5d15e (diff) | |
| download | puppet-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')
| -rwxr-xr-x | test/executables/puppetbin.rb | 4 | ||||
| -rwxr-xr-x | test/executables/puppetca.rb | 27 | ||||
| -rwxr-xr-x | test/executables/puppetd.rb | 9 | ||||
| -rwxr-xr-x | test/executables/puppetmasterd.rb | 4 | ||||
| -rwxr-xr-x | test/executables/puppetmodule.rb | 4 |
5 files changed, 25 insertions, 23 deletions
diff --git a/test/executables/puppetbin.rb b/test/executables/puppetbin.rb index 9fb4dbd11..39814769c 100755 --- a/test/executables/puppetbin.rb +++ b/test/executables/puppetbin.rb @@ -30,8 +30,8 @@ class TestPuppetBin < Test::Unit::TestCase cmd += " --debug" end #cmd += " --fqdn %s" % fqdn - cmd += " --confdir %s" % Puppet[:puppetconf] - cmd += " --vardir %s" % Puppet[:puppetvar] + cmd += " --confdir %s" % Puppet[:confdir] + cmd += " --vardir %s" % Puppet[:vardir] cmd += " --logdest %s" % "/dev/null" assert_nothing_raised { 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) diff --git a/test/executables/puppetd.rb b/test/executables/puppetd.rb index 90733ed19..1ac53db16 100755 --- a/test/executables/puppetd.rb +++ b/test/executables/puppetd.rb @@ -27,15 +27,14 @@ class TestPuppetDExe < Test::Unit::TestCase cmd += " --verbose" cmd += " --onetime" #cmd += " --fqdn %s" % fqdn - cmd += " --port %s" % @@port - cmd += " --confdir %s" % Puppet[:puppetconf] - cmd += " --vardir %s" % Puppet[:puppetvar] + cmd += " --masterport %s" % @@port + cmd += " --confdir %s" % Puppet[:confdir] + cmd += " --vardir %s" % Puppet[:vardir] cmd += " --server localhost" # and verify our daemon runs assert_nothing_raised { - output = %x{#{cmd}}.chomp - puts output + system cmd } sleep 1 assert($? == 0, "Puppetd exited with code %s" % $?) diff --git a/test/executables/puppetmasterd.rb b/test/executables/puppetmasterd.rb index e1f48c11b..691e27070 100755 --- a/test/executables/puppetmasterd.rb +++ b/test/executables/puppetmasterd.rb @@ -27,7 +27,7 @@ class TestPuppetMasterD < Test::Unit::TestCase def test_normalstart startmasterd - pidfile = File.join(Puppet[:puppetvar], "run", "puppetmasterd.pid") + pidfile = File.join(Puppet[:vardir], "run", "puppetmasterd.pid") assert(FileTest.exists?(pidfile), "PID file does not exist") sleep(1) @@ -92,7 +92,7 @@ class TestPuppetMasterD < Test::Unit::TestCase pid = nil ps = Facter["ps"].value || "ps -ef" %x{#{ps}}.chomp.split(/\n/).each { |line| - if line =~ /puppetmasterd --manifest/ + if line =~ /puppetmasterd.+--manifest/ ary = line.split(" ") pid = ary[1].to_i end diff --git a/test/executables/puppetmodule.rb b/test/executables/puppetmodule.rb index 56173c4b6..fcd85f42c 100755 --- a/test/executables/puppetmodule.rb +++ b/test/executables/puppetmodule.rb @@ -32,8 +32,8 @@ class TestPuppetModule < Test::Unit::TestCase cmd = $module cmd += " --verbose" #cmd += " --fqdn %s" % fqdn - cmd += " --confdir %s" % Puppet[:puppetconf] - cmd += " --vardir %s" % Puppet[:puppetvar] + cmd += " --confdir %s" % Puppet[:confdir] + cmd += " --vardir %s" % Puppet[:vardir] if Puppet[:debug] cmd += " --logdest %s" % "console" cmd += " --debug" |
