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 /test | |
| 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
Diffstat (limited to 'test')
| -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 |
5 files changed, 52 insertions, 6 deletions
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 |
