summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-10-04 00:15:04 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-10-04 00:15:04 +0000
commit55d7bbdcbefd550cee46a628da2292be540401ad (patch)
treed46528e0b6ad06e930dfde3a09adcdfa58a484c4 /test
parente563189acd0755a8d32ab956e758405fd3a6f40a (diff)
downloadpuppet-55d7bbdcbefd550cee46a628da2292be540401ad.tar.gz
puppet-55d7bbdcbefd550cee46a628da2292be540401ad.tar.xz
puppet-55d7bbdcbefd550cee46a628da2292be540401ad.zip
adding tag support to scopes and the transportable class
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@715 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/puppettest.rb2
-rw-r--r--test/tagging/tc_tagging.rb79
-rw-r--r--test/types/tc_service.rb28
3 files changed, 94 insertions, 15 deletions
diff --git a/test/puppettest.rb b/test/puppettest.rb
index 1ffad0833..8a93dcb7e 100644
--- a/test/puppettest.rb
+++ b/test/puppettest.rb
@@ -503,7 +503,7 @@ module FileTesting
end
end
-module PuppetTestSuite
+class PuppetTestSuite
attr_accessor :subdir
def self.list
diff --git a/test/tagging/tc_tagging.rb b/test/tagging/tc_tagging.rb
new file mode 100644
index 000000000..ab73ae866
--- /dev/null
+++ b/test/tagging/tc_tagging.rb
@@ -0,0 +1,79 @@
+if __FILE__ == $0
+ $:.unshift '..'
+ $:.unshift '../../lib'
+ $puppetbase = "../.."
+end
+
+require 'puppet'
+require 'puppettest'
+require 'test/unit'
+
+class TestTagging < Test::Unit::TestCase
+ include TestPuppet
+
+ # Make sure the scopes are getting the right tags
+ def test_scopetags
+ scope = nil
+ assert_nothing_raised {
+ scope = Puppet::Parser::Scope.new()
+ scope.name = "yayness"
+ scope.type = "solaris"
+ }
+
+ assert_nothing_raised {
+ assert_equal(%w{solaris}, scope.tags, "Incorrect scope tags")
+ }
+ end
+
+ # Test deeper tags
+ def test_deepscopetags
+ scope = nil
+ assert_nothing_raised {
+ scope = Puppet::Parser::Scope.new()
+ scope.name = "yayness"
+ scope.type = "solaris"
+ scope = scope.newscope
+ scope.name = "booness"
+ scope.type = "apache"
+ }
+
+ assert_nothing_raised {
+ assert_equal(%w{solaris apache}, scope.tags, "Incorrect scope tags")
+ }
+ end
+
+ # Verify that the tags make their way to the objects
+ def test_objecttags
+ scope = nil
+ assert_nothing_raised {
+ scope = Puppet::Parser::Scope.new()
+ scope.name = "yayness"
+ scope.type = "solaris"
+ }
+
+ assert_nothing_raised {
+ scope.setobject(
+ "file",
+ "/etc/passwd",
+ {"owner" => "root"},
+ "/yay",
+ 1
+ )
+ }
+
+ objects = nil
+ assert_nothing_raised {
+ objects = scope.to_trans
+ }
+
+ # There's only one object, so shift it out
+ object = objects.shift
+
+ assert_nothing_raised {
+ assert_equal(%w{solaris file /etc/passwd}, object.tags,
+ "Incorrect tags")
+ }
+ end
+end
+
+# $Id$
diff --git a/test/types/tc_service.rb b/test/types/tc_service.rb
index b2a919478..8f50aa931 100644
--- a/test/types/tc_service.rb
+++ b/test/types/tc_service.rb
@@ -75,18 +75,18 @@ class TestService < Test::Unit::TestCase
assert(sleeper.insync?)
end
- case Puppet::Type::Service.svctype
- when Puppet::ServiceTypes::InitSvc
- def test_processStartWithPattern
- sleeper = mksleeper(:pattern => "bin/sleeper")
-
- cyclesleeper(sleeper)
- end
-
- def test_processStartWithStatus
- sleeper = mksleeper(:hasstatus => true)
- cyclesleeper(sleeper)
- end
- #when Puppet::ServiceTypes::SMFSvc
- end
+ #case Puppet::Type::Service.svctype
+ #when Puppet::ServiceTypes::InitSvc
+ # def test_processStartWithPattern
+ # sleeper = mksleeper(:pattern => "bin/sleeper")
+#
+# cyclesleeper(sleeper)
+# end
+#
+# def test_processStartWithStatus
+# sleeper = mksleeper(:hasstatus => true)
+# cyclesleeper(sleeper)
+# end
+# #when Puppet::ServiceTypes::SMFSvc
+# end
end