diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-09-07 18:13:36 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-09-07 18:13:36 +0000 |
| commit | 923226e7ac5d931dc6b01f5ae1cee3beb24b2fee (patch) | |
| tree | e3d3372bce6fdf719928e51f43fd8248a12241ec | |
| parent | edc392d7f5b8fb59fff17091612da01a5a52891d (diff) | |
| download | puppet-923226e7ac5d931dc6b01f5ae1cee3beb24b2fee.tar.gz puppet-923226e7ac5d931dc6b01f5ae1cee3beb24b2fee.tar.xz puppet-923226e7ac5d931dc6b01f5ae1cee3beb24b2fee.zip | |
all tests now pass on solaris 10x86; i had to do some stupid hacking with base64 for it to work, and i am working getting a much better base class for all test classes
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@635 980ebf18-57e1-0310-9a29-db15c13687c0
| -rwxr-xr-x | bin/puppet | 2 | ||||
| -rwxr-xr-x | bin/puppetca | 2 | ||||
| -rwxr-xr-x | bin/puppetd | 2 | ||||
| -rwxr-xr-x | bin/puppetdoc | 2 | ||||
| -rwxr-xr-x | bin/puppetmasterd | 2 | ||||
| -rwxr-xr-x | lib/puppet/base64.rb | 19 | ||||
| -rw-r--r-- | lib/puppet/client.rb | 1 | ||||
| -rw-r--r-- | lib/puppet/server.rb | 1 | ||||
| -rwxr-xr-x | lib/puppet/server/filebucket.rb | 2 | ||||
| -rwxr-xr-x | test/executables/tc_puppetmasterd.rb | 1 | ||||
| -rw-r--r-- | test/other/tc_state.rb | 18 | ||||
| -rw-r--r-- | test/puppettest.rb | 15 | ||||
| -rw-r--r-- | test/server/tc_bucket.rb | 14 | ||||
| -rw-r--r-- | test/server/tc_server.rb | 10 |
14 files changed, 78 insertions, 13 deletions
diff --git a/bin/puppet b/bin/puppet index d4ad1af8f..cf70a93de 100755 --- a/bin/puppet +++ b/bin/puppet @@ -50,7 +50,7 @@ $haveusage = true begin require 'rdoc/usage' -rescue +rescue LoadError $haveusage = false end diff --git a/bin/puppetca b/bin/puppetca index b28125a72..af04f12a2 100755 --- a/bin/puppetca +++ b/bin/puppetca @@ -73,7 +73,7 @@ $haveusage = true begin require 'rdoc/usage' -rescue +rescue LoadError $haveusage = false end diff --git a/bin/puppetd b/bin/puppetd index 0579002b2..90ffbe816 100755 --- a/bin/puppetd +++ b/bin/puppetd @@ -86,7 +86,7 @@ require 'getoptlong' $haveusage = true begin require 'rdoc/usage' -rescue +rescue LoadError $haveusage = false end diff --git a/bin/puppetdoc b/bin/puppetdoc index bc7146a2d..04af5b35e 100755 --- a/bin/puppetdoc +++ b/bin/puppetdoc @@ -41,7 +41,7 @@ $haveusage = true begin require 'rdoc/usage' -rescue +rescue LoadError $haveusage = false end diff --git a/bin/puppetmasterd b/bin/puppetmasterd index df59e6430..45bd07f1a 100755 --- a/bin/puppetmasterd +++ b/bin/puppetmasterd @@ -104,7 +104,7 @@ $haveusage = true begin require 'rdoc/usage' -rescue +rescue LoadError $haveusage = false end diff --git a/lib/puppet/base64.rb b/lib/puppet/base64.rb new file mode 100755 index 000000000..4030ad358 --- /dev/null +++ b/lib/puppet/base64.rb @@ -0,0 +1,19 @@ +# a stupid hack class to get rid of all of the warnings but +# still make the encode/decode methods available + +# 1.8.2 has a Base64 class, but 1.8.1 just imports the methods directly +# into Object + +require 'base64' + +unless defined? Base64 + class Base64 + def Base64.encode64(*args) + Object.method(:encode64).call(*args) + end + + def Base64.decode64(*args) + Object.method(:decode64).call(*args) + end + end +end diff --git a/lib/puppet/client.rb b/lib/puppet/client.rb index acfa23af4..38b9fa7fa 100644 --- a/lib/puppet/client.rb +++ b/lib/puppet/client.rb @@ -12,6 +12,7 @@ require 'puppet/transportable' require 'puppet/metric' require 'puppet/daemon' require 'puppet/server' +require 'puppet/base64' $noclientnetworking = false begin diff --git a/lib/puppet/server.rb b/lib/puppet/server.rb index d3259e60d..6c9dbf37b 100644 --- a/lib/puppet/server.rb +++ b/lib/puppet/server.rb @@ -142,7 +142,6 @@ module Puppet @name = :Status def status(status = nil, client = nil, clientip = nil) - Puppet.warning "Returning status" return 1 end end diff --git a/lib/puppet/server/filebucket.rb b/lib/puppet/server/filebucket.rb index 4fbf78021..38993362e 100755 --- a/lib/puppet/server/filebucket.rb +++ b/lib/puppet/server/filebucket.rb @@ -13,7 +13,7 @@ require 'xmlrpc/client' #require 'webrick/httpstatus' require 'facter' require 'digest/md5' -require 'base64' +require 'puppet/base64' module Puppet class Server diff --git a/test/executables/tc_puppetmasterd.rb b/test/executables/tc_puppetmasterd.rb index 7f79f3ee5..6d4a58b7b 100755 --- a/test/executables/tc_puppetmasterd.rb +++ b/test/executables/tc_puppetmasterd.rb @@ -61,6 +61,7 @@ class TestPuppetMasterD < Test::Unit::TestCase pid = nil %x{#{ps}}.chomp.split(/\n/).each { |line| if line =~ /ruby.+puppetmasterd/ + next if line =~ /tc_/ # skip the test script itself ary = line.split(" ") pid = ary[1].to_i end diff --git a/test/other/tc_state.rb b/test/other/tc_state.rb index d4262f015..9b2b4c575 100644 --- a/test/other/tc_state.rb +++ b/test/other/tc_state.rb @@ -5,6 +5,7 @@ if __FILE__ == $0 end require 'puppet' +require 'puppettest' require 'puppet/storage' require 'test/unit' @@ -13,15 +14,26 @@ require 'test/unit' class StorageTestingClass end -class TestStorage < Test::Unit::TestCase - def setup +class TestStorage < TestPuppet + def disabled_setup Puppet[:loglevel] = :debug if __FILE__ == $0 Puppet[:checksumfile] = "/var/tmp/puppetteststate" + + @oldconf = Puppet[:puppetconf] + Puppet[:puppetconf] = "/tmp/storagetesting" + @oldvar = Puppet[:puppetvar] + Puppet[:puppetvar] = "/tmp/storagetesting" + + @@tmpfiles << "/tmp/storagetesting" end def teardown - system("rm -f %s" % Puppet[:checksumfile]) + #system("rm -f %s" % Puppet[:checksumfile]) Puppet::Storage.clear + + #Puppet[:puppetconf] = @oldconf + #Puppet[:puppetvar] = @oldvar + super end def test_simple diff --git a/test/puppettest.rb b/test/puppettest.rb index 1543434e9..f4f35bf08 100644 --- a/test/puppettest.rb +++ b/test/puppettest.rb @@ -12,8 +12,15 @@ class TestPuppet < Test::Unit::TestCase end def setup - @@tmpfiles = [] - Puppet[:loglevel] = :debug if __FILE__ == $0 + Puppet[:loglevel] = :debug if __FILE__ =~ /tc_.+\.rb/ + + @configpath = File.join(tmpdir, self.class.to_s + "configdir") + @oldconf = Puppet[:puppetconf] + Puppet[:puppetconf] = @configpath + @oldvar = Puppet[:puppetvar] + Puppet[:puppetvar] = @configpath + + @@tmpfiles = [@configpath] end def teardown @@ -27,6 +34,10 @@ class TestPuppet < Test::Unit::TestCase Puppet::Type.allclear end + def tmpdir + "/tmp" + end + def assert_rollback_events(trans, events, msg) run_events(:rollback, trans, events, msg) end diff --git a/test/server/tc_bucket.rb b/test/server/tc_bucket.rb index 0d81474a3..813ea7a61 100644 --- a/test/server/tc_bucket.rb +++ b/test/server/tc_bucket.rb @@ -50,6 +50,13 @@ class TestBucket < Test::Unit::TestCase @@tmppids = [] @@tmpfiles = [@bucket] + + @oldconf = Puppet[:puppetconf] + Puppet[:puppetconf] = "/tmp/buckettesting" + @oldvar = Puppet[:puppetvar] + Puppet[:puppetvar] = "/tmp/buckettesting" + + @@tmpfiles << "/tmp/buckettesting" end def teardown @@ -61,6 +68,9 @@ class TestBucket < Test::Unit::TestCase @@tmppids.each { |pid| system("kill -INT %s" % pid) } + + Puppet[:puppetconf] = @oldconf + Puppet[:puppetvar] = @oldvar end def test_localserver @@ -170,6 +180,8 @@ class TestBucket < Test::Unit::TestCase tmpdir = File.join(@bucket,"tmpfiledir") Puppet.recmkdir(tmpdir) + asign = Puppet[:autosign] + Puppet[:autosign] = true server = nil client = nil port = Puppet[:masterport] @@ -254,5 +266,7 @@ class TestBucket < Test::Unit::TestCase raise "Uh, we don't have a child pid" end system("kill %s" % pid) + + Puppet[:autosign] = asign end end diff --git a/test/server/tc_server.rb b/test/server/tc_server.rb index 1b7225748..3854f848c 100644 --- a/test/server/tc_server.rb +++ b/test/server/tc_server.rb @@ -30,7 +30,12 @@ class TestServer < Test::Unit::TestCase #Puppet::Type.type(:service).setpath(paths) end - @@tmpfiles = [] + @oldconf = Puppet[:puppetconf] + Puppet[:puppetconf] = "/tmp/servertesting" + @oldvar = Puppet[:puppetvar] + Puppet[:puppetvar] = "/tmp/servertesting" + + @@tmpfiles = ["/tmp/servertesting"] @@tmppids = [] end @@ -55,6 +60,9 @@ class TestServer < Test::Unit::TestCase @@tmppids.each { |pid| system("kill -INT %s" % pid) } + + Puppet[:puppetconf] = @oldconf + Puppet[:puppetvar] = @oldvar end def test_start |
