summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-07-20 16:34:25 +0000
committerLuke Kanies <luke@madstop.com>2005-07-20 16:34:25 +0000
commit973385f67a47b4dcc46da5022285025f3a7457ab (patch)
treee06b765cda2646c9ad957b8ab5ab196a64262731
parentc577e57871837b50d8b98c9031b23ab72c0ff119 (diff)
first versions
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@429 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-xlib/puppet/type/filebucket.rb37
-rwxr-xr-xtest/other/tc_relationships.rb74
2 files changed, 111 insertions, 0 deletions
diff --git a/lib/puppet/type/filebucket.rb b/lib/puppet/type/filebucket.rb
new file mode 100755
index 000000000..e1b390e4d
--- /dev/null
+++ b/lib/puppet/type/filebucket.rb
@@ -0,0 +1,37 @@
+#!/usr/local/bin/ruby -w
+# An interface for managing filebuckets from puppet
+
+require 'puppet/filebucket'
+
+module Puppet
+ class Type
+ class FileBucket < Type
+ attr_reader :bucket
+
+ @states = []
+
+ @parameters = [
+ :name,
+ :path
+ ]
+
+ @name = :filebucket
+ @namevar = :name
+
+ def initialize(hash)
+ super
+
+ unless self[:path]
+ self[:path] = File.join(Puppet[:puppetroot], "bucket")
+ end
+
+ @bucket = FileBucket::Bucket.new(
+ :Bucket => self[:path]
+ )
+ end
+
+ end # Puppet::Type::Service
+ end # Puppet::Type
+end
+
+# $Id$
diff --git a/test/other/tc_relationships.rb b/test/other/tc_relationships.rb
new file mode 100755
index 000000000..9b3270cfe
--- /dev/null
+++ b/test/other/tc_relationships.rb
@@ -0,0 +1,74 @@
+if __FILE__ == $0
+ $:.unshift '..'
+ $:.unshift '../../lib'
+ $puppetbase = "../../../../language/trunk"
+end
+
+require 'puppet'
+require 'test/unit'
+
+# $Id$
+
+class TestRelationships < Test::Unit::TestCase
+ def setup
+ Puppet[:loglevel] = :debug if __FILE__ == $0
+
+ @groups = %x{groups}.chomp.split(/ /)
+ unless @groups.length > 1
+ p @groups
+ raise "You must be a member of more than one group to test this"
+ end
+ end
+
+ def teardown
+ assert_nothing_raised() {
+ Puppet::Type.allclear
+ }
+
+ print "\n\n" if Puppet[:debug]
+ end
+
+ def newfile
+ assert_nothing_raised() {
+ cfile = File.join($puppetbase,"examples/root/etc/configfile")
+ unless Puppet::Type::PFile.has_key?(cfile)
+ Puppet::Type::PFile.new(
+ :path => cfile,
+ :check => [:mode, :owner, :group]
+ )
+ end
+ return Puppet::Type::PFile[cfile]
+ }
+ end
+
+ def newservice
+ assert_nothing_raised() {
+ unless Puppet::Type::Service.has_key?("sleeper")
+ Puppet::Type::Service.new(
+ :name => "sleeper",
+ :path => File.join($puppetbase,"examples/root/etc/init.d"),
+ :check => [:running]
+ )
+ end
+ return Puppet::Type::Service["sleeper"]
+ }
+ end
+
+ def newcomp(name,*args)
+ comp = nil
+ assert_nothing_raised() {
+ comp = Puppet::Component.new(:name => name)
+ }
+
+ args.each { |arg|
+ assert_nothing_raised() {
+ comp.push arg
+ }
+ }
+
+ return comp
+ end
+
+ def test_simplerel
+ end
+end