From 435f1e9b52e11bc558405f2102c61db84fea03c2 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 6 Dec 2008 16:53:03 +0100 Subject: Fix #1483 - use REST to transmit reports over the wire Signed-off-by: Brice Figureau --- ext/puppet-test | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'ext') diff --git a/ext/puppet-test b/ext/puppet-test index dc0aeca92..41759d489 100755 --- a/ext/puppet-test +++ b/ext/puppet-test @@ -364,6 +364,49 @@ Suite.new :rails, "Rails Interactions" do end end +Suite.new :report, "Reports interactions" do + def prepare + Puppet::Transaction::Report.terminus_class = :rest + end + + newtest :empty, "send empty report" do + report = Puppet::Transaction::Report.new + report.time = Time.now + report.save + end + + newtest :fake, "send fake report" do + report = Puppet::Transaction::Report.new + + resourcemetrics = { + :total => 12, + :out_of_sync => 20, + :applied => 45, + :skipped => 1, + :restarted => 23, + :failed_restarts => 1, + :scheduled => 10 + } + report.newmetric(:resources, resourcemetrics) + + timemetrics = { + :resource1 => 10, + :resource2 => 50, + :resource3 => 40, + :resource4 => 20, + } + report.newmetric(:times, timemetrics) + + report.newmetric(:changes, + :total => 20 + ) + + report.time = Time.now + report.save + end +end + + $cmdargs = [ [ "--compile", "-c", GetoptLong::NO_ARGUMENT ], [ "--describe", GetoptLong::REQUIRED_ARGUMENT ], -- cgit