diff options
author | Luke Kanies <luke@madstop.com> | 2005-06-27 21:47:06 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-06-27 21:47:06 +0000 |
commit | 60783f0777eb5dd89d44a8dfd2ced49f06a32d8f (patch) | |
tree | d1cf67771de26cd49d98fff28d2e7aa89cbf63e0 /test | |
parent | 8f95084cd854aef4e3493854e58cefd352cdc68d (diff) | |
download | puppet-60783f0777eb5dd89d44a8dfd2ced49f06a32d8f.tar.gz puppet-60783f0777eb5dd89d44a8dfd2ced49f06a32d8f.tar.xz puppet-60783f0777eb5dd89d44a8dfd2ced49f06a32d8f.zip |
renaming blink to puppet
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@305 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r-- | test/blinktest.rb | 8 | ||||
-rw-r--r-- | test/client/tc_client.rb | 14 | ||||
-rw-r--r-- | test/other/tc_fact.rb | 10 | ||||
-rw-r--r-- | test/other/tc_function.rb | 10 | ||||
-rw-r--r-- | test/other/tc_selector.rb | 14 | ||||
-rw-r--r-- | test/other/tc_state.rb | 26 | ||||
-rw-r--r-- | test/other/tc_transactions.rb | 32 | ||||
-rw-r--r-- | test/types/tc_basic.rb | 20 | ||||
-rw-r--r-- | test/types/tc_file.rb | 22 | ||||
-rw-r--r-- | test/types/tc_filetype.rb | 20 | ||||
-rw-r--r-- | test/types/tc_package.rb | 12 | ||||
-rw-r--r-- | test/types/tc_query.rb | 28 | ||||
-rw-r--r-- | test/types/tc_service.rb | 18 | ||||
-rw-r--r-- | test/types/tc_symlink.rb | 14 | ||||
-rw-r--r-- | test/types/tc_type.rb | 10 |
15 files changed, 129 insertions, 129 deletions
diff --git a/test/blinktest.rb b/test/blinktest.rb index 73a6d560e..a20e35079 100644 --- a/test/blinktest.rb +++ b/test/blinktest.rb @@ -1,14 +1,14 @@ # $Id$ -unless defined? BlinkTestSuite +unless defined? PuppetTestSuite $VERBOSE = true $:.unshift File.join(Dir.getwd, '../lib') - class BlinkTestSuite + class PuppetTestSuite attr_accessor :subdir - def BlinkTestSuite.list + def PuppetTestSuite.list Dir.entries(".").find_all { |file| FileTest.directory?(file) and file !~ /^\./ } @@ -37,7 +37,7 @@ unless defined? BlinkTestSuite end def textfiles - textdir = File.join($blinkbase,"examples","code") + textdir = File.join($puppetbase,"examples","code") # only parse this one file now yield File.join(textdir,"head") return diff --git a/test/client/tc_client.rb b/test/client/tc_client.rb index 4586ea111..17cee1c9b 100644 --- a/test/client/tc_client.rb +++ b/test/client/tc_client.rb @@ -1,14 +1,14 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk/" + $puppetbase = "../../../../language/trunk/" end -require 'blink' -require 'blink/client' -require 'blink/fact' +require 'puppet' +require 'puppet/client' +require 'puppet/fact' require 'test/unit' -require 'blinktest.rb' +require 'puppettest.rb' # $Id$ @@ -16,13 +16,13 @@ class TestClient < Test::Unit::TestCase def test_local client = nil assert_nothing_raised() { - client = Blink::Client.new(:Listen => false) + client = Puppet::Client.new(:Listen => false) } facts = %w{operatingsystem operatingsystemrelease} facts.each { |fact| assert_equal( - Blink::Fact[fact], + Puppet::Fact[fact], client.callfunc("fact",fact) ) } diff --git a/test/other/tc_fact.rb b/test/other/tc_fact.rb index 439f3312d..f0a2cc223 100644 --- a/test/other/tc_fact.rb +++ b/test/other/tc_fact.rb @@ -1,20 +1,20 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk/" + $puppetbase = "../../../../language/trunk/" end -require 'blink/fact' +require 'puppet/fact' require 'test/unit' # $Id$ class TestFacts < Test::Unit::TestCase def test_newfact - Blink[:debug] = true if __FILE__ == $0 + Puppet[:debug] = true if __FILE__ == $0 fact = nil assert_nothing_raised() { - fact = Blink::Fact.new( + fact = Puppet::Fact.new( :name => "funtest", :code => "echo funtest", :interpreter => "/bin/sh" @@ -22,7 +22,7 @@ class TestFacts < Test::Unit::TestCase } assert_equal( "funtest", - Blink::Fact["funtest"] + Puppet::Fact["funtest"] ) end end diff --git a/test/other/tc_function.rb b/test/other/tc_function.rb index 5fa3698cc..e35abddd6 100644 --- a/test/other/tc_function.rb +++ b/test/other/tc_function.rb @@ -1,11 +1,11 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink/function' -require 'blink/fact' +require 'puppet/function' +require 'puppet/fact' require 'test/unit' # $Id$ @@ -17,11 +17,11 @@ class TestFunctions < Test::Unit::TestCase vars.each { |var| value = nil assert_nothing_raised() { - value = Blink::Function["fact"].call(var) + value = Puppet::Function["fact"].call(var) } assert_equal( - Blink::Fact[var], + Puppet::Fact[var], value ) } diff --git a/test/other/tc_selector.rb b/test/other/tc_selector.rb index cd786fd1a..1f01ea87a 100644 --- a/test/other/tc_selector.rb +++ b/test/other/tc_selector.rb @@ -1,28 +1,28 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink/selector' +require 'puppet/selector' require 'test/unit' # $Id$ class TestSelector < Test::Unit::TestCase def setup - @os = Blink::Fact["operatingsystem"] - @hostname = Blink::Fact["hostname"] + @os = Puppet::Fact["operatingsystem"] + @hostname = Puppet::Fact["hostname"] end def test_values - Blink[:debug] = 1 + Puppet[:debug] = 1 selector = nil assert_nothing_raised() { - selector = Blink::Selector.new { |select| + selector = Puppet::Selector.new { |select| select.add("value1") { - Blink::Fact["hostname"] == @hostname + Puppet::Fact["hostname"] == @hostname } } } diff --git a/test/other/tc_state.rb b/test/other/tc_state.rb index ab496299e..bd8d1c24e 100644 --- a/test/other/tc_state.rb +++ b/test/other/tc_state.rb @@ -1,39 +1,39 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ class TestStorage < Test::Unit::TestCase def setup - Blink[:debug] = true - Blink[:statefile] = "/var/tmp/blinkteststate" + Puppet[:debug] = true + Puppet[:statefile] = "/var/tmp/puppetteststate" end def test_simple state = nil assert_nothing_raised { - Blink::Storage.load + Puppet::Storage.load } assert_nothing_raised { - state = Blink::Storage.state(Blink::Type) + state = Puppet::Storage.state(Puppet::Type) } assert(state) state["/etc/passwd"] = ["md5","9ebebe0c02445c40b9dc6871b64ee416"] assert_nothing_raised { - Blink::Storage.store + Puppet::Storage.store } assert_nothing_raised { - Blink::Storage.load + Puppet::Storage.load } assert_equal( ["md5","9ebebe0c02445c40b9dc6871b64ee416"], - Blink::Storage.state(Blink::Type)["/etc/passwd"] + Puppet::Storage.state(Puppet::Type)["/etc/passwd"] ) end @@ -41,20 +41,20 @@ class TestStorage < Test::Unit::TestCase file = nil state = nil assert_nothing_raised { - file = Blink::Type::File.new( + file = Puppet::Type::File.new( :path => "/etc/passwd" ) } assert_nothing_raised { - Blink::Storage.load + Puppet::Storage.load } assert_nothing_raised { - state = Blink::Storage.state(file) + state = Puppet::Storage.state(file) } assert(state) end def teardown - system("rm -f %s" % Blink[:statefile]) + system("rm -f %s" % Puppet[:statefile]) end end diff --git a/test/other/tc_transactions.rb b/test/other/tc_transactions.rb index 47094b078..d5f2c5da7 100644 --- a/test/other/tc_transactions.rb +++ b/test/other/tc_transactions.rb @@ -1,17 +1,17 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ class TestTransactions < Test::Unit::TestCase def setup - Blink[:debug] = true + Puppet[:debug] = true @groups = %x{groups}.chomp.split(/ /) unless @groups.length > 1 @@ -22,7 +22,7 @@ class TestTransactions < Test::Unit::TestCase def teardown assert_nothing_raised() { - Blink::Type.allclear + Puppet::Type.allclear } print "\n\n" @@ -30,36 +30,36 @@ class TestTransactions < Test::Unit::TestCase def newfile assert_nothing_raised() { - cfile = File.join($blinkbase,"examples/root/etc/configfile") - unless Blink::Type::File.has_key?(cfile) - Blink::Type::File.new( + cfile = File.join($puppetbase,"examples/root/etc/configfile") + unless Puppet::Type::File.has_key?(cfile) + Puppet::Type::File.new( :path => cfile, :check => [:mode, :owner, :group] ) end - return Blink::Type::File[cfile] + return Puppet::Type::File[cfile] } end def newservice assert_nothing_raised() { - unless Blink::Type::Service.has_key?("sleeper") - Blink::Type::Service.new( + unless Puppet::Type::Service.has_key?("sleeper") + Puppet::Type::Service.new( :name => "sleeper", :check => [:running] ) - Blink::Type::Service.setpath( - File.join($blinkbase,"examples/root/etc/init.d") + Puppet::Type::Service.setpath( + File.join($puppetbase,"examples/root/etc/init.d") ) end - return Blink::Type::Service["sleeper"] + return Puppet::Type::Service["sleeper"] } end def newcomp(name,*args) comp = nil assert_nothing_raised() { - comp = Blink::Component.new(:name => name) + comp = Puppet::Component.new(:name => name) } args.each { |arg| @@ -179,7 +179,7 @@ class TestTransactions < Test::Unit::TestCase transaction.evaluate } - fakevent = Blink::Event.new( + fakevent = Puppet::Event.new( :event => :ALL_EVENTS, :object => self, :transaction => transaction, @@ -252,7 +252,7 @@ class TestTransactions < Test::Unit::TestCase transaction.evaluate } - fakevent = Blink::Event.new( + fakevent = Puppet::Event.new( :event => :ALL_EVENTS, :object => self, :transaction => transaction, diff --git a/test/types/tc_basic.rb b/test/types/tc_basic.rb index a100f3fa5..0e54cb3b7 100644 --- a/test/types/tc_basic.rb +++ b/test/types/tc_basic.rb @@ -1,10 +1,10 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ @@ -18,28 +18,28 @@ class TestBasic < Test::Unit::TestCase @configfile = nil @sleeper = nil - Blink[:debug] = 1 + Puppet[:debug] = 1 assert_nothing_raised() { - @component = Blink::Component.new(:name => "yaytest") + @component = Puppet::Component.new(:name => "yaytest") } assert_nothing_raised() { @filepath = "/tmp/testfile" system("rm -f %s" % @filepath) - @configfile = Blink::Type::File.new( + @configfile = Puppet::Type::File.new( :path => @filepath, :create => true, :checksum => "md5" ) } assert_nothing_raised() { - @sleeper = Blink::Type::Service.new( + @sleeper = Puppet::Type::Service.new( :name => "sleeper", :running => 1 ) - Blink::Type::Service.setpath( - File.join($blinkbase,"examples/root/etc/init.d") + Puppet::Type::Service.setpath( + File.join($puppetbase,"examples/root/etc/init.d") ) } assert_nothing_raised() { @@ -54,13 +54,13 @@ class TestBasic < Test::Unit::TestCase end def teardown - Blink::Type.allclear + Puppet::Type.allclear system("rm -f %s" % @filepath) end def test_name_calls [@sleeper,@configfile].each { |obj| - Blink.error "obj is %s" % obj + Puppet.error "obj is %s" % obj assert_nothing_raised(){ obj.name } diff --git a/test/types/tc_file.rb b/test/types/tc_file.rb index fdc009a16..9f7214e99 100644 --- a/test/types/tc_file.rb +++ b/test/types/tc_file.rb @@ -1,10 +1,10 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ @@ -15,19 +15,19 @@ class TestFile < Test::Unit::TestCase # objects in a central store def setup @file = nil - @path = File.join($blinkbase,"examples/root/etc/configfile") - Blink[:debug] = 1 - Blink[:statefile] = "/var/tmp/blinkstate" + @path = File.join($puppetbase,"examples/root/etc/configfile") + Puppet[:debug] = 1 + Puppet[:statefile] = "/var/tmp/puppetstate" assert_nothing_raised() { - @file = Blink::Type::File.new( + @file = Puppet::Type::File.new( :path => @path ) } end def teardown - Blink::Type::File.clear - system("rm -f %s" % Blink[:statefile]) + Puppet::Type::File.clear + system("rm -f %s" % Puppet[:statefile]) end def test_owner @@ -84,7 +84,7 @@ class TestFile < Test::Unit::TestCase %w{a b c d}.collect { |name| "/tmp/createst%s" % name }.each { |path| file =nil assert_nothing_raised() { - file = Blink::Type::File.new( + file = Puppet::Type::File.new( :path => path, :create => true ) @@ -142,7 +142,7 @@ class TestFile < Test::Unit::TestCase } # okay, we now know that we have a file... assert_nothing_raised() { - file = Blink::Type::File.new( + file = Puppet::Type::File.new( :path => path, :checksum => type ) @@ -177,7 +177,7 @@ class TestFile < Test::Unit::TestCase events.include?(:file_modified) ) assert_nothing_raised() { - Blink::Type::File.clear + Puppet::Type::File.clear } assert_nothing_raised() { system("rm -f %s" % path) diff --git a/test/types/tc_filetype.rb b/test/types/tc_filetype.rb index e1083a3ab..fcab4b6f8 100644 --- a/test/types/tc_filetype.rb +++ b/test/types/tc_filetype.rb @@ -1,12 +1,12 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' -require 'blink/type/typegen/filetype' -require 'blink/type/typegen/filerecord' +require 'puppet' +require 'puppet/type/typegen/filetype' +require 'puppet/type/typegen/filerecord' require 'test/unit' # $Id$ @@ -14,12 +14,12 @@ require 'test/unit' #class TestFileType < Test::Unit::TestCase class TestFileType def disabled_setup - Blink[:debug] = 1 + Puppet[:debug] = 1 - @passwdtype = Blink::Type::FileType["passwd"] + @passwdtype = Puppet::Type::FileType["passwd"] if @passwdtype.nil? assert_nothing_raised() { - @passwdtype = Blink::Type::FileType.newtype( + @passwdtype = Puppet::Type::FileType.newtype( :name => "passwd" ) @passwdtype.addrecord( @@ -30,10 +30,10 @@ class TestFileType } end - @syslogtype = Blink::Type::FileType["syslog"] + @syslogtype = Puppet::Type::FileType["syslog"] if @syslogtype.nil? assert_nothing_raised() { - @syslogtype = Blink::Type::FileType.newtype( + @syslogtype = Puppet::Type::FileType.newtype( :escapednewlines => true, :name => "syslog" ) @@ -137,7 +137,7 @@ class TestFileType def disabled_test_syslog_nochange file = nil type = nil - syslog = File.join($blinkbase, "examples/root/etc/debian-syslog.conf") + syslog = File.join($puppetbase, "examples/root/etc/debian-syslog.conf") assert_nothing_raised() { file = @syslogtype.new(syslog) } diff --git a/test/types/tc_package.rb b/test/types/tc_package.rb index 369ea2520..38669e467 100644 --- a/test/types/tc_package.rb +++ b/test/types/tc_package.rb @@ -1,10 +1,10 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' require 'facter' @@ -24,7 +24,7 @@ class TestPackagingType < Test::Unit::TestCase end assert_nothing_raised() { - Blink::PackagingType[type].list + Puppet::PackagingType[type].list } end end @@ -34,7 +34,7 @@ class TestPackageSource < Test::Unit::TestCase system("touch /tmp/fakepackage") assert_equal( "/tmp/fakepackage", - Blink::PackageSource.get("file:///tmp/fakepackage") + Puppet::PackageSource.get("file:///tmp/fakepackage") ) system("rm -f /tmp/fakepackage") end @@ -42,11 +42,11 @@ end class TestPackages < Test::Unit::TestCase def setup - @list = Blink::Type::Package.getpkglist + @list = Puppet::Type::Package.getpkglist end def teardown - Blink::Type::Package.clear + Puppet::Type::Package.clear end def test_checking diff --git a/test/types/tc_query.rb b/test/types/tc_query.rb index cd53fcdac..b00bf549b 100644 --- a/test/types/tc_query.rb +++ b/test/types/tc_query.rb @@ -1,22 +1,22 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ class TestQuery < Test::Unit::TestCase def setup - Blink[:debug] = true + Puppet[:debug] = true end def teardown assert_nothing_raised() { - Blink::Type.allclear + Puppet::Type.allclear } end @@ -25,30 +25,30 @@ class TestQuery < Test::Unit::TestCase # objects in a central store def file assert_nothing_raised() { - cfile = File.join($blinkbase,"examples/root/etc/configfile") - unless Blink::Type::File.has_key?(cfile) - Blink::Type::File.new( + cfile = File.join($puppetbase,"examples/root/etc/configfile") + unless Puppet::Type::File.has_key?(cfile) + Puppet::Type::File.new( :path => cfile, :check => [:mode, :owner] ) end - @configfile = Blink::Type::File[cfile] + @configfile = Puppet::Type::File[cfile] } return @configfile end def service assert_nothing_raised() { - unless Blink::Type::Service.has_key?("sleeper") - Blink::Type::Service.new( + unless Puppet::Type::Service.has_key?("sleeper") + Puppet::Type::Service.new( :name => "sleeper", :check => [:running] ) - Blink::Type::Service.setpath( - File.join($blinkbase,"examples/root/etc/init.d") + Puppet::Type::Service.setpath( + File.join($puppetbase,"examples/root/etc/init.d") ) end - @sleeper = Blink::Type::Service["sleeper"] + @sleeper = Puppet::Type::Service["sleeper"] } return @sleeper @@ -56,7 +56,7 @@ class TestQuery < Test::Unit::TestCase def component(name,*args) assert_nothing_raised() { - @component = Blink::Component.new(:name => name) + @component = Puppet::Component.new(:name => name) } args.each { |arg| diff --git a/test/types/tc_service.rb b/test/types/tc_service.rb index 287f23178..96a14dbee 100644 --- a/test/types/tc_service.rb +++ b/test/types/tc_service.rb @@ -1,10 +1,10 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ @@ -15,21 +15,21 @@ class TestService < Test::Unit::TestCase # objects in a central store def setup @sleeper = nil - script = File.join($blinkbase,"examples/root/etc/init.d/sleeper") + script = File.join($puppetbase,"examples/root/etc/init.d/sleeper") @status = script + " status" - Blink[:debug] = 1 + Puppet[:debug] = 1 assert_nothing_raised() { - unless Blink::Type::Service.has_key?("sleeper") - Blink::Type::Service.new( + unless Puppet::Type::Service.has_key?("sleeper") + Puppet::Type::Service.new( :name => "sleeper", :running => 1 ) - Blink::Type::Service.setpath( - File.join($blinkbase,"examples/root/etc/init.d") + Puppet::Type::Service.setpath( + File.join($puppetbase,"examples/root/etc/init.d") ) end - @sleeper = Blink::Type::Service["sleeper"] + @sleeper = Puppet::Type::Service["sleeper"] } end diff --git a/test/types/tc_symlink.rb b/test/types/tc_symlink.rb index 6991f532b..36a1ed28f 100644 --- a/test/types/tc_symlink.rb +++ b/test/types/tc_symlink.rb @@ -1,10 +1,10 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end -require 'blink' +require 'puppet' require 'test/unit' # $Id$ @@ -15,17 +15,17 @@ class TestSymlink < Test::Unit::TestCase # objects in a central store def setup @symlink = nil - @path = File.join($blinkbase,"examples/root/etc/symlink") + @path = File.join($puppetbase,"examples/root/etc/symlink") Kernel.system("rm -f %s" % @path) - Blink[:debug] = 1 + Puppet[:debug] = 1 assert_nothing_raised() { - unless Blink::Type::Symlink.has_key?(@path) - Blink::Type::Symlink.new( + unless Puppet::Type::Symlink.has_key?(@path) + Puppet::Type::Symlink.new( :path => @path ) end - @symlink = Blink::Type::Symlink[@path] + @symlink = Puppet::Type::Symlink[@path] } end diff --git a/test/types/tc_type.rb b/test/types/tc_type.rb index cd36a4ec0..59073376c 100644 --- a/test/types/tc_type.rb +++ b/test/types/tc_type.rb @@ -1,21 +1,21 @@ if __FILE__ == $0 $:.unshift '..' $:.unshift '../../lib' - $blinkbase = "../../../../language/trunk" + $puppetbase = "../../../../language/trunk" end # $Id$ -require 'blink/type' +require 'puppet/type' require 'test/unit' class TestType < Test::Unit::TestCase def test_typemethods assert_nothing_raised() { - Blink::Type.buildstatehash + Puppet::Type.buildstatehash } - Blink::Type.eachtype { |type| + Puppet::Type.eachtype { |type| name = nil assert_nothing_raised() { name = type.name @@ -27,7 +27,7 @@ class TestType < Test::Unit::TestCase assert_equal( type, - Blink::Type.type(name) + Puppet::Type.type(name) ) assert( |