summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-07 12:57:57 -0600
committerLuke Kanies <luke@madstop.com>2008-02-07 12:57:57 -0600
commitf19e106b5ee0eab0ca0de2f441073b37540f3e8f (patch)
tree7f815b00a67cb120ffeb462c2a1bcc1797b3702b /test
parentb3f67ec4017940a7eb47f3a044fd77c8d32a74cf (diff)
parent8f0d87d498ca12417a7d20b81ba46465658fa210 (diff)
downloadpuppet-f19e106b5ee0eab0ca0de2f441073b37540f3e8f.tar.gz
puppet-f19e106b5ee0eab0ca0de2f441073b37540f3e8f.tar.xz
puppet-f19e106b5ee0eab0ca0de2f441073b37540f3e8f.zip
Merge commit 'plathrop/fix-1007' 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