summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-04-17 19:46:23 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit8b99367ccedefe0e341a79487ccea2a95f2720a3 (patch)
tree4dca9eeeda8be43006eda6acf0d66aa7a874560e /ext
parent748aed9a4fe70cc2ecc0c782b694114356d9eb25 (diff)
downloadpuppet-8b99367ccedefe0e341a79487ccea2a95f2720a3.tar.gz
puppet-8b99367ccedefe0e341a79487ccea2a95f2720a3.tar.xz
puppet-8b99367ccedefe0e341a79487ccea2a95f2720a3.zip
Adding indirector support to Resource Types
Also adding JSON support. This is so that we can remotely retrieve information about resource types and classes, such as what arguments are required. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'ext')
-rwxr-xr-xext/puppet-test24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/puppet-test b/ext/puppet-test
index 53333076f..61397e74b 100755
--- a/ext/puppet-test
+++ b/ext/puppet-test
@@ -229,6 +229,30 @@ Suite.new :local_catalog, "Local catalog handling" do
end
end
+Suite.new :resource_type, "Managing resource types" do
+ newtest :find, "Find a type" do
+ Puppet::Resource::Type.terminus_class = :parser
+ ARGV.each do |name|
+ json = Puppet::Resource::Type.find(name).to_pson
+ data = PSON.parse(json)
+ p Puppet::Resource::Type.from_pson(data)
+ end
+ end
+
+ newtest :search_types, "Find all types" do
+ Puppet::Resource::Type.terminus_class = :rest
+ result = Puppet::Resource::Type.search("*")
+ result.each { |r| p r }
+ end
+
+ newtest :restful_type, "Find a type and return it via REST" do
+ Puppet::Resource::Type.terminus_class = :rest
+ ARGV.each do |name|
+ p Puppet::Resource::Type.find(name)
+ end
+ end
+end
+
Suite.new :remote_catalog, "Remote catalog handling" do
def prepare
$args[:cache] = false