diff options
-rwxr-xr-x | test/executables/puppetmodule.rb | 55 | ||||
-rwxr-xr-x | test/other/transactions.rb | 2 | ||||
-rwxr-xr-x | test/ral/providers/host/parsed.rb | 12 | ||||
-rwxr-xr-x | test/ral/providers/sshkey/parsed.rb | 10 | ||||
-rwxr-xr-x | test/ral/type/host.rb | 8 | ||||
-rwxr-xr-x | test/ral/type/sshkey.rb | 4 |
6 files changed, 18 insertions, 73 deletions
diff --git a/test/executables/puppetmodule.rb b/test/executables/puppetmodule.rb deleted file mode 100755 index ce28796d7..000000000 --- a/test/executables/puppetmodule.rb +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/../lib/puppettest' - -require 'puppettest' - -class TestPuppetModule < Test::Unit::TestCase - include PuppetTest::ExeTest - - - def setup - super - @module = File.join(basedir, "ext", "module_puppet") - end - - def test_existence - assert(FileTest.exists?(@module), "Module does not exist") - end - - def test_execution - file = tempfile() - - createdfile = tempfile() - - File.open(file, "w") { |f| - f.puts "class yaytest { file { \"#{createdfile}\": ensure => file } }" - } - - output = nil - cmd = @module - cmd += " --verbose" - #cmd += " --fqdn %s" % fqdn - cmd += " --confdir %s" % Puppet[:confdir] - cmd += " --vardir %s" % Puppet[:vardir] - if Puppet[:debug] - cmd += " --logdest %s" % "console" - cmd += " --debug" - cmd += " --trace" - else - cmd += " --logdest %s" % "/dev/null" - end - - ENV["CFALLCLASSES"] = "yaytest:all" - libsetup - - out = nil - assert_nothing_raised { - out = %x{#{cmd + " " + file} 2>&1} - } - assert($? == 0, "Puppet module exited with code %s: %s" % [$?.to_i, out]) - - assert(FileTest.exists?(createdfile), "Failed to create config'ed file") - end -end - diff --git a/test/other/transactions.rb b/test/other/transactions.rb index 6cb772d88..57a3a1cd8 100755 --- a/test/other/transactions.rb +++ b/test/other/transactions.rb @@ -368,7 +368,7 @@ class TestTransactions < Test::Unit::TestCase # 'subscribe' expects an array of arrays #component[:require] = [[file.class.name,file.name]] - ecomp[:subscribe] = fcomp + ecomp[:subscribe] = fcomp.ref exec[:refreshonly] = true trans = assert_events([], config) diff --git a/test/ral/providers/host/parsed.rb b/test/ral/providers/host/parsed.rb index 28b553356..ce70f5c9f 100755 --- a/test/ral/providers/host/parsed.rb +++ b/test/ral/providers/host/parsed.rb @@ -45,7 +45,7 @@ class TestParsedHostProvider < Test::Unit::TestCase return { :name => "fakehost%s" % @hcount, :ip => "192.168.27.%s" % @hcount, - :alias => ["alias%s" % @hcount], + :host_aliases => ["alias%s" % @hcount], :ensure => :present } end @@ -67,7 +67,7 @@ class TestParsedHostProvider < Test::Unit::TestCase # Make sure we convert both directlys correctly using a simple host. def test_basic_isomorphism - hash = {:record_type => :parsed, :name => "myhost", :ip => "192.168.43.56", :alias => %w{another host}} + hash = {:record_type => :parsed, :name => "myhost", :ip => "192.168.43.56", :host_aliases => %w{another host}} str = nil assert_nothing_raised do @@ -103,7 +103,7 @@ class TestParsedHostProvider < Test::Unit::TestCase assert_equal([ {:record_type => :comment, :line => "# comment one"}, {:record_type => :blank, :line => ""}, - {:record_type => :parsed, :name => "myhost", :ip => "192.168.43.56", :alias => %w{another host}}, + {:record_type => :parsed, :name => "myhost", :ip => "192.168.43.56", :host_aliases => %w{another host}}, {:record_type => :blank, :line => " "}, {:record_type => :comment, :line => "# another comment"}, {:record_type => :parsed, :name => "anotherhost", :ip => "192.168.43.57"} @@ -150,13 +150,13 @@ class TestParsedHostProvider < Test::Unit::TestCase } # Remove a single field and make sure it gets tossed - name = host.alias - host.alias = [:absent] + name = host.host_aliases + host.host_aliases = [:absent] assert_nothing_raised { host.flush assert(! file.read.include?(name[0]), - "Did not remove alias from disk") + "Did not remove host_aliases from disk") } # Make sure it throws up if we remove a required field diff --git a/test/ral/providers/sshkey/parsed.rb b/test/ral/providers/sshkey/parsed.rb index 868640a10..cad758568 100755 --- a/test/ral/providers/sshkey/parsed.rb +++ b/test/ral/providers/sshkey/parsed.rb @@ -32,7 +32,7 @@ class TestParsedSSHKey < Test::Unit::TestCase args = { :name => name || "/fspuppet%s" % @pcount, :key => "thisismykey%s" % @pcount, - :alias => ["host1.domain.com","192.168.0.1"], + :host_aliases => ["host1.domain.com","192.168.0.1"], :type => "dss", :ensure => :present } @@ -68,11 +68,11 @@ class TestParsedSSHKey < Test::Unit::TestCase key.flush end - assert(key.alias, "No alias set for key") + assert(key.host_aliases, "No host_aliases set for key") hash = key.property_hash.dup text = @provider.target_object(file).read - names = [key.name, key.alias].flatten.join(",") + names = [key.name, key.host_aliases].flatten.join(",") assert_equal("#{names} #{key.type} #{key.key}\n", text) @@ -94,12 +94,12 @@ class TestParsedSSHKey < Test::Unit::TestCase result = @provider.parse_line("one,two type key") end assert_equal("one", result[:name], "Did not call post hook") - assert_equal(%w{two}, result[:alias], "Did not call post hook") + assert_equal(%w{two}, result[:host_aliases], "Did not call post hook") assert_equal("one,two type key", @provider.to_line(:record_type => :parsed, :name => "one", - :alias => %w{two}, + :host_aliases => %w{two}, :type => "type", :key => "key"), "Did not use pre-hook when generating line" diff --git a/test/ral/type/host.rb b/test/ral/type/host.rb index 537adc717..dce882b96 100755 --- a/test/ral/type/host.rb +++ b/test/ral/type/host.rb @@ -108,7 +108,7 @@ class TestHost < Test::Unit::TestCase # This was a hard bug to track down. assert_instance_of(String, current_values[host.property(:ip)]) - host[:alias] = %w{madstop kirby yayness} + host[:host_aliases] = %w{madstop kirby yayness} assert_events([:host_changed], host) @@ -117,7 +117,7 @@ class TestHost < Test::Unit::TestCase } assert_equal(%w{madstop kirby yayness}, - current_values[host.property(:alias)]) + current_values[host.property(:host_aliases)]) host[:ensure] = :absent assert_events([:host_removed], host) @@ -184,13 +184,13 @@ class TestHost < Test::Unit::TestCase end def test_aliasisproperty - assert_equal(:property, @hosttype.attrtype(:alias)) + assert_equal(:property, @hosttype.attrtype(:host_aliases)) end def test_multivalues host = mkhost assert_raise(Puppet::Error) { - host[:alias] = "puppetmasterd yayness" + host[:host_aliases] = "puppetmasterd yayness" } end diff --git a/test/ral/type/sshkey.rb b/test/ral/type/sshkey.rb index 74dd812bb..b528317a3 100755 --- a/test/ral/type/sshkey.rb +++ b/test/ral/type/sshkey.rb @@ -116,13 +116,13 @@ class TestSSHKey < Test::Unit::TestCase end def test_aliasisproperty - assert_equal(:property, @sshkeytype.attrtype(:alias)) + assert_equal(:property, @sshkeytype.attrtype(:host_aliases)) end def test_multivalues key = mkkey assert_raise(Puppet::Error) { - key[:alias] = "puppetmasterd yayness" + key[:host_aliases] = "puppetmasterd yayness" } end |