summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-01-19 18:24:11 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-01-19 18:24:11 +1100
commit5195a2fd4327240b2459f22c1eedde4007b98ce5 (patch)
tree31b062315b5276473f737fe58b5bb396b98fbb6b
parent35145f35b3a03a252d49046a67cd4126c850e864 (diff)
parent7ee4746e2228219c03e5117d24860a623031de14 (diff)
downloadpuppet-5195a2fd4327240b2459f22c1eedde4007b98ce5.tar.gz
puppet-5195a2fd4327240b2459f22c1eedde4007b98ce5.tar.xz
puppet-5195a2fd4327240b2459f22c1eedde4007b98ce5.zip
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
-rwxr-xr-xext/puppet-test33
-rwxr-xr-xlib/puppet/type/cron.rb7
2 files changed, 35 insertions, 5 deletions
diff --git a/ext/puppet-test b/ext/puppet-test
index 362a43996..0f33e0cbb 100755
--- a/ext/puppet-test
+++ b/ext/puppet-test
@@ -53,6 +53,9 @@
# list::
# List all available tests.
#
+# pause::
+# Pause before starting test (useful for testing with dtrace).
+#
# repeat::
# How many times to perform the test.
#
@@ -88,7 +91,7 @@
# Do an initial trap, so that cancels don't get a stack trace.
trap(:INT) do
$stderr.puts "Cancelling startup"
- exit(0)
+ exit(1)
end
require 'puppet'
@@ -165,6 +168,12 @@ class Suite
puts "Running %s %s test" % [@name, test]
prepare()
+ if $options[:pause]
+ puts "Hit any key to continue"
+ $stdin.readline
+ puts "Continuing with test"
+ end
+
if $options[:fork] > 0
@forking = true
$options[:fork].times {
@@ -200,6 +209,17 @@ class Suite
end
end
+Suite.new :parser, "Manifest parsing" do
+ def prepare
+ @parser = Puppet::Parser::Parser.new(:environment => Puppet[:environment])
+ @parser.file = Puppet[:manifest]
+ end
+
+ newtest :parse, "Parsed files" do
+ @parser.parse
+ end
+end
+
Suite.new :catalog, "Catalog handling" do
def prepare
$args[:cache] = false
@@ -325,12 +345,13 @@ end
$cmdargs = [
[ "--compile", "-c", GetoptLong::NO_ARGUMENT ],
- [ "--describe", "-D", GetoptLong::REQUIRED_ARGUMENT ],
+ [ "--describe", GetoptLong::REQUIRED_ARGUMENT ],
[ "--retrieve", "-R", GetoptLong::REQUIRED_ARGUMENT ],
[ "--fork", GetoptLong::REQUIRED_ARGUMENT ],
[ "--fqdn", "-F", GetoptLong::REQUIRED_ARGUMENT ],
[ "--suite", "-s", GetoptLong::REQUIRED_ARGUMENT ],
[ "--test", "-t", GetoptLong::REQUIRED_ARGUMENT ],
+ [ "--pause", "-p", GetoptLong::NO_ARGUMENT ],
[ "--repeat", "-r", GetoptLong::REQUIRED_ARGUMENT ],
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
@@ -340,14 +361,14 @@ $cmdargs = [
]
# Add all of the config parameters as valid $options.
-Puppet.config.addargs($cmdargs)
+Puppet.settings.addargs($cmdargs)
Puppet::Util::Log.newdestination(:console)
result = GetoptLong.new(*$cmdargs)
$args = {}
-$options = {:repeat => 1, :fork => 0}
+$options = {:repeat => 1, :fork => 0, :pause => false}
begin
explicit_waitforcert = false
@@ -399,6 +420,8 @@ begin
$options[:test] = arg.intern
when "--file"
$options[:file] = arg
+ when "--pause"
+ $options[:pause] = true
when "--list"
Suite.suites.sort { |a,b| a.to_s <=> b.to_s }.each do |suite_name|
suite = Suite[suite_name]
@@ -407,7 +430,7 @@ begin
end
exit(0)
else
- Puppet.config.handlearg(opt, arg)
+ Puppet.settings.handlearg(opt, arg)
end
}
rescue GetoptLong::InvalidOption => detail
diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb
index 17cb1667f..7882745dc 100755
--- a/lib/puppet/type/cron.rb
+++ b/lib/puppet/type/cron.rb
@@ -8,6 +8,13 @@ Puppet::Type.newtype(:cron) do
fields would result in the command being executed every
minute. While the name of the cron job is not part of the actual
job, it is used by Puppet to store and retrieve it.
+
+ You may specify periodic fields as integers, using the standard cron
+ range syntax (two numbers separated by a hyphen to indicate a range
+ of values), or using the cron step syntax (for example, '*/2' to
+ indicate command execution every other time unit). This type does
+ not yet support the combiantion of these two syntaxes, or lists of
+ ranges.
If you specify a cron job that matches an existing job in every way
except name, then the jobs will be considered equivalent and the