summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-07-11 20:21:41 +0000
committerLuke Kanies <luke@madstop.com>2005-07-11 20:21:41 +0000
commit0417fb59f4493b98fea9b03a60cb21ffc0f8bed4 (patch)
tree8357acb0051cbd471a64e43d0581329dc7875044 /test
parent6e9975ce229f889784f45d5b5c3434db3e0da30a (diff)
downloadpuppet-0417fb59f4493b98fea9b03a60cb21ffc0f8bed4.tar.gz
puppet-0417fb59f4493b98fea9b03a60cb21ffc0f8bed4.tar.xz
puppet-0417fb59f4493b98fea9b03a60cb21ffc0f8bed4.zip
adding refreshonly parameter
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@358 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/tc_exec.rb50
1 files changed, 46 insertions, 4 deletions
diff --git a/test/types/tc_exec.rb b/test/types/tc_exec.rb
index e714caf82..42256dbcb 100755
--- a/test/types/tc_exec.rb
+++ b/test/types/tc_exec.rb
@@ -28,7 +28,7 @@ class TestExec < Test::Unit::TestCase
)
}
assert_nothing_raised {
- command.retrieve
+ command.evaluate
}
assert_nothing_raised {
output = command.sync
@@ -46,7 +46,7 @@ class TestExec < Test::Unit::TestCase
)
}
assert_nothing_raised {
- command.retrieve
+ command.evaluate
}
assert_nothing_raised {
output = command.sync
@@ -59,7 +59,7 @@ class TestExec < Test::Unit::TestCase
)
}
assert_nothing_raised {
- command.retrieve
+ command.evaluate
}
assert_nothing_raised {
output = command.sync
@@ -131,11 +131,53 @@ class TestExec < Test::Unit::TestCase
)
}
assert_nothing_raised {
- command.retrieve
+ command.evaluate
}
assert_nothing_raised {
command.sync
}
assert_equal("/tmp\n",command.output)
end
+
+ def test_refreshonly
+ file = nil
+ cmd = nil
+ tmpfile = "/tmp/testing"
+ trans = nil
+ File.open(tmpfile, File::WRONLY|File::CREAT|File::APPEND) { |of|
+ of.puts "yayness"
+ }
+ file = Puppet::Type::PFile.new(
+ :path => tmpfile,
+ :checksum => "md5"
+ )
+ assert_nothing_raised {
+ cmd = Puppet::Type::Exec.new(
+ :command => "pwd",
+ :path => "/usr/bin:/bin:/usr/sbin:/sbin",
+ :require => [[file.class.name,file.name]],
+ :refreshonly => true
+ )
+ }
+ comp = Puppet::Component.new(:name => "RefreshTest")
+ [file,cmd].each { |obj|
+ comp.push obj
+ }
+ assert_nothing_raised {
+ trans = comp.evaluate
+ }
+ events = nil
+ assert_nothing_raised {
+ events = trans.evaluate.collect { |event|
+ event.event
+ }
+ }
+
+ # verify that only the file_changed event was kicked off, not the
+ # command_executed
+ assert_equal(
+ ["file_changed"],
+ events
+ )
+ end
end