diff options
| author | Luke Kanies <luke@madstop.com> | 2005-08-02 00:24:18 +0000 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2005-08-02 00:24:18 +0000 |
| commit | 74dac8fd6f46c35cf79b15f1f7358bc32d4c7716 (patch) | |
| tree | 8b123cbd0b481d443cb882c704e7f2e16934d702 /test | |
| parent | 8bf85e2faeb8a4776b64cf6cebac4733ff3739d5 (diff) | |
| download | puppet-74dac8fd6f46c35cf79b15f1f7358bc32d4c7716.tar.gz puppet-74dac8fd6f46c35cf79b15f1f7358bc32d4c7716.tar.xz puppet-74dac8fd6f46c35cf79b15f1f7358bc32d4c7716.zip | |
adding some consistency and tests to the whole puppet defaults system
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@485 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rw-r--r-- | test/other/tc_metrics.rb | 2 | ||||
| -rw-r--r-- | test/other/tc_state.rb | 6 | ||||
| -rw-r--r-- | test/other/tc_transactions.rb | 4 | ||||
| -rwxr-xr-x | test/puppet/tc_defaults.rb | 10 | ||||
| -rw-r--r-- | test/types/tc_file.rb | 6 | ||||
| -rwxr-xr-x | test/types/tc_filebucket.rb | 6 |
6 files changed, 18 insertions, 16 deletions
diff --git a/test/other/tc_metrics.rb b/test/other/tc_metrics.rb index 24be0f9b1..7ba03d554 100644 --- a/test/other/tc_metrics.rb +++ b/test/other/tc_metrics.rb @@ -54,7 +54,7 @@ if $haverrd end def setup - Puppet[:rrddir] = "/tmp/rrdtests" + Puppet[:rrddir] = File.join(Puppet[:puppetvar], "rrdtesting") Puppet[:rrdgraph] = true Puppet[:loglevel] = :debug if __FILE__ == $0 end diff --git a/test/other/tc_state.rb b/test/other/tc_state.rb index e98c21b67..d4262f015 100644 --- a/test/other/tc_state.rb +++ b/test/other/tc_state.rb @@ -16,11 +16,11 @@ end class TestStorage < Test::Unit::TestCase def setup Puppet[:loglevel] = :debug if __FILE__ == $0 - Puppet[:statefile] = "/var/tmp/puppetteststate" + Puppet[:checksumfile] = "/var/tmp/puppetteststate" end def teardown - system("rm -f %s" % Puppet[:statefile]) + system("rm -f %s" % Puppet[:checksumfile]) Puppet::Storage.clear end @@ -73,7 +73,7 @@ class TestStorage < Test::Unit::TestCase state = Puppet::Storage.state(StorageTestingClass) state["testing"] = "yayness" Puppet::Storage.store - assert(FileTest.exists?(Puppet[:statefile])) + assert(FileTest.exists?(Puppet[:checksumfile])) end def test_hashstorage diff --git a/test/other/tc_transactions.rb b/test/other/tc_transactions.rb index 8b0ab1f93..3383b3b34 100644 --- a/test/other/tc_transactions.rb +++ b/test/other/tc_transactions.rb @@ -29,7 +29,7 @@ class TestTransactions < Test::Unit::TestCase Puppet::Type.allclear @@tmpfiles = [] Puppet[:loglevel] = :debug if __FILE__ == $0 - Puppet[:statefile] = "/var/tmp/puppetstate" + Puppet[:checksumfile] = File.join(Puppet[:statedir], "checksumtestfile") @groups = %x{groups}.chomp.split(/ /) unless @groups.length > 1 p @groups @@ -46,7 +46,7 @@ class TestTransactions < Test::Unit::TestCase end } @@tmpfiles.clear - system("rm -f %s" % Puppet[:statefile]) + system("rm -f %s" % Puppet[:checksumfile]) print "\n\n" if Puppet[:debug] end diff --git a/test/puppet/tc_defaults.rb b/test/puppet/tc_defaults.rb index 1fc45a89e..d6fe09146 100755 --- a/test/puppet/tc_defaults.rb +++ b/test/puppet/tc_defaults.rb @@ -10,9 +10,9 @@ require 'test/unit' # $Id$ class TestPuppetDefaults < Test::Unit::TestCase - @@dirs = %w{rrddir puppetconf puppetvar logdir statedir certdir} + @@dirs = %w{rrddir puppetconf puppetvar logdir statedir certdir bucketdir} @@files = %w{logfile checksumfile localcert localkey localpub mastercert masterkey masterpub} - @@booleans = %w{rrdgraph} + @@booleans = %w{rrdgraph noop} def testStringOrParam [@@dirs,@@files,@@booleans].flatten.each { |param| assert_nothing_raised { Puppet[param] } @@ -40,7 +40,8 @@ class TestPuppetDefaults < Test::Unit::TestCase value = Puppet[param] unless value =~ confdir or value =~ vardir - assert_nothing_raised { raise "%s is in wrong dir" % value } + assert_nothing_raised { raise "%s is in wrong dir: %s" % + [param,value] } end } end @@ -68,7 +69,8 @@ class TestPuppetDefaults < Test::Unit::TestCase value = Puppet[param] unless value !~ notval - assert_nothing_raised { raise "%s is in wrong dir" % value } + assert_nothing_raised { raise "%s is in wrong dir: %s" % + [param,value] } end } end diff --git a/test/types/tc_file.rb b/test/types/tc_file.rb index 1e7b8ade3..fa25972ff 100644 --- a/test/types/tc_file.rb +++ b/test/types/tc_file.rb @@ -36,11 +36,11 @@ class TestFile < Test::Unit::TestCase def setup @@tmpfiles = [] Puppet[:loglevel] = :debug if __FILE__ == $0 - Puppet[:statefile] = "/var/tmp/puppetstate" + Puppet[:checksumfile] = File.join(Puppet[:statedir], "checksumtestfile") begin initstorage rescue - system("rm -rf %s" % Puppet[:statefile]) + system("rm -rf %s" % Puppet[:checksumfile]) end end @@ -54,7 +54,7 @@ class TestFile < Test::Unit::TestCase end } @@tmpfiles.clear - system("rm -f %s" % Puppet[:statefile]) + system("rm -f %s" % Puppet[:checksumfile]) end def initstorage diff --git a/test/types/tc_filebucket.rb b/test/types/tc_filebucket.rb index b8568ae77..091ff3af3 100755 --- a/test/types/tc_filebucket.rb +++ b/test/types/tc_filebucket.rb @@ -50,11 +50,11 @@ class TestFileBucket < Test::Unit::TestCase def setup @@tmpfiles = [] Puppet[:loglevel] = :debug if __FILE__ == $0 - Puppet[:statefile] = "/var/tmp/puppetstate" + Puppet[:checksumfile] = File.join(Puppet[:statedir], "checksumtestfile") begin initstorage rescue - system("rm -rf %s" % Puppet[:statefile]) + system("rm -rf %s" % Puppet[:checksumfile]) end end @@ -68,7 +68,7 @@ class TestFileBucket < Test::Unit::TestCase end } @@tmpfiles.clear - system("rm -f %s" % Puppet[:statefile]) + system("rm -f %s" % Puppet[:checksumfile]) end def initstorage |
