[prev in list] [next in list] [prev in thread] [next in thread] 

List:       puppet-commit
Subject:    [Puppet-commit] puppet revision 2624
From:       svn () madstop ! com
Date:       2007-06-19 1:49:19
Message-ID: 20070619014919.CF38C160060 () puppet ! reductivelabs ! com
[Download RAW message or body]

luke 2007-06-19 03:49:19 +0200 (Tue, 19 Jun 2007)
More test fixes.  I seem to be getting very close.
Modified: trunk/lib/puppet/parser/interpreter.rb
===================================================================
--- trunk/lib/puppet/parser/interpreter.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/lib/puppet/parser/interpreter.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -810,6 +810,8 @@
 
         unless ActiveRecord::Base.connected?
             Puppet::Rails.connect
+        else
+            Puppet.warning "Already connected"
         end
 
         # Fork the storage, since we don't need the client waiting

Modified: trunk/lib/puppet/provider/cron/crontab.rb
===================================================================
--- trunk/lib/puppet/provider/cron/crontab.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/lib/puppet/provider/cron/crontab.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -86,7 +86,6 @@
     # See if we can match the hash against an existing cron job.
     def self.match(hash, resources)
         resources.each do |name, obj|
-            p hash
             # we now have a cron job whose command exactly matches
             # let's see if the other fields match
 
@@ -151,7 +150,11 @@
                     record[:name] = name
                     name = nil
                 end
-                record[:environment] = envs
+                if envs.empty?
+                    record[:environment] = :absent
+                else
+                    record[:environment] = envs
+                end
             end
         }.reject { |record| record[:skip] }
     end

Modified: trunk/test/network/xmlrpc/client.rb
===================================================================
--- trunk/test/network/xmlrpc/client.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/network/xmlrpc/client.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -7,6 +7,7 @@
 require 'mocha'
 
 class TestXMLRPCClient < Test::Unit::TestCase
+    include PuppetTest
     def test_set_backtrace
         error = Puppet::Network::XMLRPCClientError.new("An error")
         assert_nothing_raised do

Modified: trunk/test/network/xmlrpc/processor.rb
===================================================================
--- trunk/test/network/xmlrpc/processor.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/network/xmlrpc/processor.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -7,6 +7,7 @@
 require 'mocha'
 
 class TestXMLRPCProcessor < Test::Unit::TestCase
+    include PuppetTest
     class BaseProcessor
         def add_handler(interface, handler)
             @handlers ||= {}

Modified: trunk/test/ral/providers/cron/crontab.rb
===================================================================
--- trunk/test/ral/providers/cron/crontab.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/ral/providers/cron/crontab.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -91,6 +91,7 @@
                 # Make the values a bit more equal.
                 should[:target] = @me
                 should[:ensure] = :present
+                #should[:environment] ||= []
                 should[:on_disk] = true
                 is = sis.dup
                 sis.dup.each do |p,v|
@@ -270,7 +271,7 @@
         hash = @provider.parse_line(str)
         hash[:user] = @me
 
-        instance = @provider.match(hash)
+        instance = @provider.match(hash, "yaycron" => cron)
         assert(instance, "did not match cron")
         assert_equal(cron, instance,
             "Did not match cron job")

Modified: trunk/test/ral/providers/mount/parsed.rb
===================================================================
--- trunk/test/ral/providers/mount/parsed.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/ral/providers/mount/parsed.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -124,7 +124,7 @@
                 assert(root, "Could not retrieve root mount")
 
                 assert_nothing_raised("Could not rewrite file") do
-                    puts @provider.to_file(hashes)
+                    @provider.to_file(hashes)
                 end
             end
         end


[Attachment #3 (text/html)]

<p><b>luke</b> 2007-06-19 03:49:19 +0200 (Tue, 19 Jun 2007)</p><p>More test fixes.  I \
seem to be getting very close.<br> </p><hr noshade><pre><font color="gray">Modified: \
trunk/lib/puppet/parser/interpreter.rb \
                ===================================================================
--- trunk/lib/puppet/parser/interpreter.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/lib/puppet/parser/interpreter.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -810,6 +810,8 @@
 
         unless ActiveRecord::Base.connected?
             Puppet::Rails.connect
+        else
+            Puppet.warning &quot;Already connected&quot;
         end
 
         # Fork the storage, since we don't need the client waiting

Modified: trunk/lib/puppet/provider/cron/crontab.rb
===================================================================
--- trunk/lib/puppet/provider/cron/crontab.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/lib/puppet/provider/cron/crontab.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -86,7 +86,6 @@
     # See if we can match the hash against an existing cron job.
     def self.match(hash, resources)
         resources.each do |name, obj|
-            p hash
             # we now have a cron job whose command exactly matches
             # let's see if the other fields match
 
@@ -151,7 +150,11 @@
                     record[:name] = name
                     name = nil
                 end
-                record[:environment] = envs
+                if envs.empty?
+                    record[:environment] = :absent
+                else
+                    record[:environment] = envs
+                end
             end
         }.reject { |record| record[:skip] }
     end

Modified: trunk/test/network/xmlrpc/client.rb
===================================================================
--- trunk/test/network/xmlrpc/client.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/network/xmlrpc/client.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -7,6 +7,7 @@
 require 'mocha'
 
 class TestXMLRPCClient &lt; Test::Unit::TestCase
+    include PuppetTest
     def test_set_backtrace
         error = Puppet::Network::XMLRPCClientError.new(&quot;An error&quot;)
         assert_nothing_raised do

Modified: trunk/test/network/xmlrpc/processor.rb
===================================================================
--- trunk/test/network/xmlrpc/processor.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/network/xmlrpc/processor.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -7,6 +7,7 @@
 require 'mocha'
 
 class TestXMLRPCProcessor &lt; Test::Unit::TestCase
+    include PuppetTest
     class BaseProcessor
         def add_handler(interface, handler)
             @handlers ||= {}

Modified: trunk/test/ral/providers/cron/crontab.rb
===================================================================
--- trunk/test/ral/providers/cron/crontab.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/ral/providers/cron/crontab.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -91,6 +91,7 @@
                 # Make the values a bit more equal.
                 should[:target] = @me
                 should[:ensure] = :present
+                #should[:environment] ||= []
                 should[:on_disk] = true
                 is = sis.dup
                 sis.dup.each do |p,v|
@@ -270,7 +271,7 @@
         hash = @provider.parse_line(str)
         hash[:user] = @me
 
-        instance = @provider.match(hash)
+        instance = @provider.match(hash, &quot;yaycron&quot; =&gt; cron)
         assert(instance, &quot;did not match cron&quot;)
         assert_equal(cron, instance,
             &quot;Did not match cron job&quot;)

Modified: trunk/test/ral/providers/mount/parsed.rb
===================================================================
--- trunk/test/ral/providers/mount/parsed.rb	2007-06-19 00:27:52 UTC (rev 2623)
+++ trunk/test/ral/providers/mount/parsed.rb	2007-06-19 01:49:19 UTC (rev 2624)
@@ -124,7 +124,7 @@
                 assert(root, &quot;Could not retrieve root mount&quot;)
 
                 assert_nothing_raised(&quot;Could not rewrite file&quot;) do
-                    puts @provider.to_file(hashes)
+                    @provider.to_file(hashes)
                 end
             end
         end

</font>
</pre>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic