[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Luke Kanies luke at puppetlabs.com
Wed Jul 14 10:32:18 UTC 2010


The following commit has been merged in the upstream branch:
commit 6cd6c47efa75be82a5cb3e366caaa3bccfe33756
Author: Luke Kanies <luke at puppetlabs.com>
Date:   Fri Apr 9 17:03:41 2010 -0700

    Renaming and fixing puppetrun tests.
    
    Signed-off-by: Luke Kanies <luke at puppetlabs.com>

diff --git a/lib/puppet/application/run.rb b/lib/puppet/application/run.rb
index 46d1b19..395ba98 100644
--- a/lib/puppet/application/run.rb
+++ b/lib/puppet/application/run.rb
@@ -126,7 +126,9 @@ Puppet::Application.new(:run) do
                 :ignoreschedules => options[:ignoreschedules]
             }
             run = Puppet::Run.new( run_options ).save( url )
+            puts "Getting status"
             result = run.status
+            puts "status is #{result}"
         rescue => detail
             puts detail.backtrace if Puppet[:trace]
             $stderr.puts "Host %s failed: %s\n" % [host, detail]
@@ -134,7 +136,8 @@ Puppet::Application.new(:run) do
         end
 
         case result
-        when "success"; exit(0)
+        when "success";
+            exit(0)
         when "running"
             $stderr.puts "Host %s is already running" % host
             exit(3)
diff --git a/spec/unit/application/puppetrun.rb b/spec/unit/application/run.rb
similarity index 94%
rename from spec/unit/application/puppetrun.rb
rename to spec/unit/application/run.rb
index f8ca480..bb76c5b 100755
--- a/spec/unit/application/puppetrun.rb
+++ b/spec/unit/application/run.rb
@@ -250,21 +250,21 @@ describe "run" do
                     options = {
                         :background => true, :ignoreschedules => false, :tags => []
                     }
-                    @run = Puppet::Run.new( options.dup )
-                    @run.stubs(:status).returns("success")
+                    @agent_run = Puppet::Run.new( options.dup )
+                    @agent_run.stubs(:status).returns("success")
 
                     Puppet::Run.indirection.expects(:terminus_class=).with( :rest )
-                    Puppet::Run.expects(:new).with( options ).returns(@run)
+                    Puppet::Run.expects(:new).with( options ).returns(@agent_run)
                 end
 
                 it "should call run on a Puppet::Run for the given host" do
-                    @run.expects(:save).with('https://host:8139/production/run/host').returns(@run)
+                    @agent_run.expects(:save).with('https://host:8139/production/run/host').returns(@agent_run)
 
                     @run.run_for_host('host')
                 end
 
                 it "should exit the child with 0 on success" do
-                    @run.stubs(:status).returns("success")
+                    @agent_run.stubs(:status).returns("success")
 
                     @run.expects(:exit).with(0)
 
@@ -272,7 +272,7 @@ describe "run" do
                 end
 
                 it "should exit the child with 3 on running" do
-                    @run.stubs(:status).returns("running")
+                    @agent_run.stubs(:status).returns("running")
 
                     @run.expects(:exit).with(3)
 
@@ -280,7 +280,7 @@ describe "run" do
                 end
 
                 it "should exit the child with 12 on unknown answer" do
-                    @run.stubs(:status).returns("whatever")
+                    @agent_run.stubs(:status).returns("whatever")
 
                     @run.expects(:exit).with(12)
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list