[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.4-89-gcbbd363

James Turnbull james at lovedthanlost.net
Tue May 18 09:03:22 UTC 2010


The following commit has been merged in the upstream branch:
commit 10becce443741511ff216c98f6f460513a615cdb
Author: Markus Roberts <Markus at reality.com>
Date:   Fri Jan 15 09:13:10 2010 -0800

    Fix for #3077 (unit tests broken in 0.25.1-->0.25.4)
    
    Most of these were caused by alias --> host_aliases; one was
    caused by the canonicalization of resource references and one
    by the removal of puppet_module.

diff --git a/test/executables/puppetmodule.rb b/test/executables/puppetmodule.rb
deleted file mode 100755
index ce28796..0000000
--- 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 6cb772d..57a3a1c 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 28b5533..ce70f5c 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 868640a..cad7585 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 537adc7..dce882b 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 74dd812..b528317 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
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list