|
5 | 5 | proxy_env_vars = "HTTP_PROXY=foo http_proxy=foo HTTPS_PROXY=foo https_proxy=foo NO_PROXY=foo no_proxy=foo" |
6 | 6 |
|
7 | 7 | step "ruby: Check that PATH, HOME, GEM_HOME JARS_REQUIRE and JARS_NO_REQUIRE are present" |
8 | | -on(master, "puppetserver ruby -rjson -e 'puts JSON.pretty_generate(ENV.to_hash)'") do |
9 | | - env = JSON.parse(stdout) |
| 8 | +on(master, "puppetserver ruby -rjson -e 'puts JSON.pretty_generate(ENV.to_hash)'") do |result| |
| 9 | + env = JSON.parse(result.stdout) |
10 | 10 | assert(env['PATH'], "PATH missing") |
11 | 11 | assert(env['HOME'], "HOME missing") |
12 | 12 | assert(env['GEM_HOME'], "GEM_HOME missing") |
|
15 | 15 | end |
16 | 16 |
|
17 | 17 | step "ruby: Check that proxy env-variables are present" |
18 | | -on(master, "#{proxy_env_vars} puppetserver ruby -rjson -e 'puts JSON.pretty_generate(ENV.to_hash)'") do |
19 | | - env = JSON.parse(stdout) |
| 18 | +on(master, "#{proxy_env_vars} puppetserver ruby -rjson -e 'puts JSON.pretty_generate(ENV.to_hash)'") do |result| |
| 19 | + env = JSON.parse(result.stdout) |
20 | 20 | assert_equal(env['HTTP_PROXY'], "foo", |
21 | 21 | "HTTP_PROXY is missing or has wrong value: '#{env['HTTP_PROXY']}'") |
22 | 22 | assert_equal(env['http_proxy'], "foo", |
|
32 | 32 | end |
33 | 33 |
|
34 | 34 | step "irb: Check that PATH, HOME, GEM_HOME JARS_REQUIRE and JARS_NO_REQUIRE are present" |
35 | | -on(master, "echo 'puts JSON.pretty_generate(ENV.to_hash)' | puppetserver irb -f -rjson") do |
36 | | - assert_match(/\bPATH\b/, stdout, "PATH missing") |
37 | | - assert_match(/\bHOME\b/, stdout, "HOME missing") |
38 | | - assert_match(/\bGEM_HOME\b/, stdout, "GEM_HOME missing") |
39 | | - assert_match(/\bJARS_REQUIRE\b/, stdout, "JARS_REQUIRE missing") |
40 | | - assert_match(/\bJARS_NO_REQUIRE\b/, stdout, "JARS_NO_REQUIRE missing") |
| 35 | +on(master, "echo 'puts JSON.pretty_generate(ENV.to_hash)' | puppetserver irb -f -rjson") do |result| |
| 36 | + assert_match(/\bPATH\b/, result.stdout, "PATH missing") |
| 37 | + assert_match(/\bHOME\b/, result.stdout, "HOME missing") |
| 38 | + assert_match(/\bGEM_HOME\b/, result.stdout, "GEM_HOME missing") |
| 39 | + assert_match(/\bJARS_REQUIRE\b/, result.stdout, "JARS_REQUIRE missing") |
| 40 | + assert_match(/\bJARS_NO_REQUIRE\b/, result.stdout, "JARS_NO_REQUIRE missing") |
41 | 41 | end |
42 | 42 |
|
43 | 43 | step "irb: Check that proxy env-variables are present" |
44 | | -on(master, "echo 'puts JSON.pretty_generate(ENV.to_hash)' | #{proxy_env_vars} puppetserver irb -f -rjson") do |
45 | | - assert_match(/\bHTTP_PROXY\b\W\W\s\W\bfoo\b/, stdout, "HTTP_PROXY missing or has wrong value") |
46 | | - assert_match(/\bhttp_proxy\b\W\W\s\W\bfoo\b/, stdout, "http_proxy missing or has wrong value") |
47 | | - assert_match(/\bHTTPS_PROXY\b\W\W\s\W\bfoo\b/, stdout, "HTTPS_PROXY missing or has wrong value") |
48 | | - assert_match(/\bhttps_proxy\b\W\W\s\W\bfoo\b/, stdout, "https_proxy missing or has wrong value") |
49 | | - assert_match(/\bNO_PROXY\b\W\W\s\W\bfoo\b/, stdout, "NO_PROXY missing or has wrong value") |
50 | | - assert_match(/\bno_proxy\b\W\W\s\W\bfoo\b/, stdout, "no_proxy missing or has wrong value") |
| 44 | +on(master, "echo 'puts JSON.pretty_generate(ENV.to_hash)' | #{proxy_env_vars} puppetserver irb -f -rjson") do |result| |
| 45 | + assert_match(/\bHTTP_PROXY\b\W\W\s\W\bfoo\b/, result.stdout, "HTTP_PROXY missing or has wrong value") |
| 46 | + assert_match(/\bhttp_proxy\b\W\W\s\W\bfoo\b/, result.stdout, "http_proxy missing or has wrong value") |
| 47 | + assert_match(/\bHTTPS_PROXY\b\W\W\s\W\bfoo\b/, result.stdout, "HTTPS_PROXY missing or has wrong value") |
| 48 | + assert_match(/\bhttps_proxy\b\W\W\s\W\bfoo\b/, result.stdout, "https_proxy missing or has wrong value") |
| 49 | + assert_match(/\bNO_PROXY\b\W\W\s\W\bfoo\b/, result.stdout, "NO_PROXY missing or has wrong value") |
| 50 | + assert_match(/\bno_proxy\b\W\W\s\W\bfoo\b/, result.stdout, "no_proxy missing or has wrong value") |
51 | 51 | end |
0 commit comments