summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-28 17:44:47 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-28 17:44:47 +0000
commita96bdac66ba703736afa7155f4d31cbe3e9fc0ef (patch)
treeb8d5099055087c5702a55bee75d5753b41258eac /test
parent47ba186922d5034274e871a5dfa307dd33ba9ee5 (diff)
Okay, services are now managed, um, entirely differently. I have the beginnings of a system for supporting different service management frameworks, although I currently only support <nothing> and init scripts
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@709 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/types/tc_service.rb35
1 files changed, 14 insertions, 21 deletions
diff --git a/test/types/tc_service.rb b/test/types/tc_service.rb
index ecacc77d7..c0df3419f 100644
--- a/test/types/tc_service.rb
+++ b/test/types/tc_service.rb
@@ -28,22 +28,16 @@ class TestService < TestPuppet
super
end
- def mksleeper
+ def mksleeper(hash = {})
+ hash[:name] = "sleeper"
+ hash[:path] = File.join($puppetbase,"examples/root/etc/init.d")
+ hash[:running] = true
assert_nothing_raised() {
- return Puppet::Type::Service.create(
- :name => "sleeper",
- :path => File.join($puppetbase,"examples/root/etc/init.d"),
- :running => 1
- )
+ return Puppet::Type::Service.create(hash)
}
end
- def test_process_start
- sleeper = mksleeper
- # start it
- assert_nothing_raised() {
- sleeper[:running] = 1
- }
+ def cyclesleeper(sleeper)
assert_nothing_raised() {
sleeper.retrieve
}
@@ -80,15 +74,14 @@ class TestService < TestPuppet
assert(sleeper.insync?)
end
- def test_FailOnNoPath
- serv = nil
- assert_nothing_raised {
- serv = Puppet::Type::Service.create(
- :name => "sleeper"
- )
- }
+ def test_processStartWithPattern
+ sleeper = mksleeper(:pattern => "bin/sleeper")
+
+ cyclesleeper(sleeper)
+ end
- assert_nil(serv)
- assert_nil(Puppet::Type::Service["sleeper"])
+ def test_processStartWithStatus
+ sleeper = mksleeper(:hasstatus => true)
+ cyclesleeper(sleeper)
end
end