diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-01 04:11:11 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-01 04:11:11 +0000 |
| commit | f3a0c488b884b59df790fce0192dd1a2d735ad7c (patch) | |
| tree | 2efc2f2398d9ed2df6a8cb72a0db9ee01035433f /test/lib/puppettest/support | |
| parent | a7354d0e3bd77625de9da5f5846bfefbc6d88121 (diff) | |
| download | puppet-f3a0c488b884b59df790fce0192dd1a2d735ad7c.tar.gz puppet-f3a0c488b884b59df790fce0192dd1a2d735ad7c.tar.xz puppet-f3a0c488b884b59df790fce0192dd1a2d735ad7c.zip | |
Most of the graphing work is now done. I have also added the generator work in transactions, but I need to migrate files to using it. Until that migration is done, files will not work correctly for many cases.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1896 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/lib/puppettest/support')
| -rwxr-xr-x | test/lib/puppettest/support/resources.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/lib/puppettest/support/resources.rb b/test/lib/puppettest/support/resources.rb new file mode 100755 index 000000000..45d89c5fb --- /dev/null +++ b/test/lib/puppettest/support/resources.rb @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby +# +# Created by Luke A. Kanies on 2006-11-29. +# Copyright (c) 2006. All rights reserved. + +module PuppetTest::Support::Resources + def treefile(name) + Puppet::Type.type(:file).create :path => "/tmp/#{name}", :mode => 0755 + end + + def treecomp(name) + Puppet::Type::Component.create :name => name, :type => "yay" + end + + def treenode(name, *children) + comp = treecomp name + children.each do |c| + if c.is_a?(String) + comp.push treefile(c) + else + comp.push c + end + end + return comp + end + + def mktree + one = treenode("one", "a", "b") + two = treenode("two", "c", "d") + middle = treenode("middle", "e", "f", two) + top = treenode("top", "g", "h", middle, one) + + return one, two, middle, top + end +end + +# $Id$
\ No newline at end of file |
