summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-05-30 02:29:23 +0000
committerLuke Kanies <luke@madstop.com>2005-05-30 02:29:23 +0000
commit0ab9685383bc21d9903a06d62a01f6cb72d25610 (patch)
treead8d5dac1e252b2e5a056d5665a751f9737108e3 /test
parent2b97b479688e987a8d9e663fd926108e7c02e7e4 (diff)
downloadpuppet-0ab9685383bc21d9903a06d62a01f6cb72d25610.tar.gz
puppet-0ab9685383bc21d9903a06d62a01f6cb72d25610.tar.xz
puppet-0ab9685383bc21d9903a06d62a01f6cb72d25610.zip
dependencies now work, although you cannot yet specify them for components
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@283 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/other/tc_transactions.rb50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/other/tc_transactions.rb b/test/other/tc_transactions.rb
index 48d0028b5..710ee5a16 100644
--- a/test/other/tc_transactions.rb
+++ b/test/other/tc_transactions.rb
@@ -138,4 +138,54 @@ class TestTransactions < Test::Unit::TestCase
transaction.evaluate
}
end
+
+ def test_both
+ transaction = nil
+ file = newfile()
+ service = newservice()
+ states = {}
+ check = [:group,:mode]
+ file[:check] = check
+
+ service[:running] = 1
+ service.sync
+
+ component = newcomp(file,service)
+
+ # 'requires' expects an array of arrays
+ service[:require] = [[file.class.name,file.name]]
+
+ assert_nothing_raised() {
+ file.retrieve
+ service.retrieve
+ }
+
+ check.each { |state|
+ states[state] = file[state]
+ }
+ assert_nothing_raised() {
+ file[:group] = @groups[1]
+ file[:mode] = "755"
+ }
+ assert_nothing_raised() {
+ transaction = component.evaluate
+ }
+
+ # this should cause a restart of the service
+ assert_nothing_raised() {
+ transaction.evaluate
+ }
+
+ # now set everything back to how it was
+ assert_nothing_raised() {
+ service[:running] = 0
+ service.sync
+ check.each { |state|
+ file[state] = states[state]
+ }
+ file.sync
+ }
+
+ end
+
end