summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-02-08 16:35:06 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-02-08 16:35:06 +1100
commitc3ead0331adba5f60ea7d508775a89de68e26caa (patch)
treeaf3e519a74c3d93986bbad2428a343d7b9bf0b30 /test
parentf7b0ca9e9475d4b6a9138d70256f143b8ba31f1a (diff)
parent084d0fb6351ed54ff4c052cff20f21e89063620c (diff)
downloadpuppet-c3ead0331adba5f60ea7d508775a89de68e26caa.tar.gz
puppet-c3ead0331adba5f60ea7d508775a89de68e26caa.tar.xz
puppet-c3ead0331adba5f60ea7d508775a89de68e26caa.zip
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'test')
-rwxr-xr-xtest/ral/types/exec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/ral/types/exec.rb b/test/ral/types/exec.rb
index f718f944e..4133d8519 100755
--- a/test/ral/types/exec.rb
+++ b/test/ral/types/exec.rb
@@ -587,6 +587,46 @@ and stuff"
assert_equal("A B\n", output)
end
+ def test_environmentparam
+ exec = Puppet::Type.newexec(
+ :command => "echo $environmenttest",
+ :path => ENV["PATH"],
+ :environment => "environmenttest=yayness"
+ )
+
+ assert(exec, "Could not make exec")
+
+ output = status = nil
+ assert_nothing_raised {
+ output, status = exec.run("echo $environmenttest")
+ }
+
+ assert_equal("yayness\n", output)
+
+ # Now check whether we can do multiline settings
+ assert_nothing_raised do
+ exec[:environment] = "environmenttest=a list of things
+and stuff"
+ end
+
+ output = status = nil
+ assert_nothing_raised {
+ output, status = exec.run('echo "$environmenttest"')
+ }
+ assert_equal("a list of things\nand stuff\n", output)
+
+ # Now test arrays
+ assert_nothing_raised do
+ exec[:environment] = ["funtest=A", "yaytest=B"]
+ end
+
+ output = status = nil
+ assert_nothing_raised {
+ output, status = exec.run('echo "$funtest" "$yaytest"')
+ }
+ assert_equal("A B\n", output)
+ end
+
def test_timeout
exec = Puppet::Type.type(:exec).create(:command => "sleep 1", :path => ENV["PATH"], :timeout => "0.2")
time = Time.now