diff --git a/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb b/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb index c1d773d6b..35014162c 100644 --- a/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb +++ b/acceptance/tests/environment/use_agent_environment_when_enc_doesnt_specify.rb @@ -1,58 +1,58 @@ test_name "Agent should use agent environment if there is an enc that does not specify the environment" require 'puppet/acceptance/classifier_utils' extend Puppet::Acceptance::ClassifierUtils classify_nodes_as_agent_specified_if_classifer_present testdir = create_tmpdir_for_user master, 'use_agent_env' create_remote_file master, "#{testdir}/enc.rb", < true) File { ensure => directory, - mode => 770, + mode => "0770", owner => #{master.puppet['user']}, group => #{master.puppet['group']}, } file { '#{testdir}/environments':; '#{testdir}/environments/production':; '#{testdir}/environments/production/manifests':; '#{testdir}/environments/more_different/':; '#{testdir}/environments/more_different/manifests':; } file { '#{testdir}/environments/production/manifests/site.pp': ensure => file, - mode => 640, + mode => "0640", content => 'notify { "production environment": }', } file { '#{testdir}/environments/more_different/manifests/more_different.pp': ensure => file, - mode => 640, + mode => "0640", content => 'notify { "more_different_string": }', } MANIFEST master_opts = { 'main' => { 'environmentpath' => "#{testdir}/environments", 'node_terminus' => 'exec', 'external_nodes' => "#{testdir}/enc.rb", }, } with_puppet_running_on master, master_opts, testdir do agents.each do |agent| run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose --environment more_different") assert_match(/more_different_string/, stdout, "Did not find more_different_string from \"more_different\" environment") end end diff --git a/acceptance/tests/environment/use_agent_environment_when_no_enc.rb b/acceptance/tests/environment/use_agent_environment_when_no_enc.rb index 733e1525d..a45d573a5 100644 --- a/acceptance/tests/environment/use_agent_environment_when_no_enc.rb +++ b/acceptance/tests/environment/use_agent_environment_when_no_enc.rb @@ -1,50 +1,50 @@ test_name "Agent should use agent environment if there is no enc-specified environment" require 'puppet/acceptance/classifier_utils' extend Puppet::Acceptance::ClassifierUtils classify_nodes_as_agent_specified_if_classifer_present testdir = create_tmpdir_for_user master, 'use_agent_env' apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) File { ensure => directory, - mode => 770, + mode => "0770", owner => #{master.puppet['user']}, group => #{master.puppet['group']}, } file { '#{testdir}/environments':; '#{testdir}/environments/production':; '#{testdir}/environments/production/manifests':; '#{testdir}/environments/more_different/':; '#{testdir}/environments/more_different/manifests':; } file { '#{testdir}/environments/production/manifests/site.pp': ensure => file, - mode => 640, + mode => "0640", content => 'notify { "production environment": }', } file { '#{testdir}/environments/more_different/manifests/more_different.pp': ensure => file, - mode => 640, + mode => "0640", content => 'notify { "more_different_string": }', } MANIFEST master_opts = { 'main' => { 'environmentpath' => "#{testdir}/environments", }, 'master' => { 'node_terminus' => 'plain' }, } with_puppet_running_on master, master_opts, testdir do agents.each do |agent| run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose --environment more_different") assert_match(/more_different_string/, stdout, "Did not find more_different_string from \"more_different\" environment") end end diff --git a/acceptance/tests/environment/use_enc_environment_for_files.rb b/acceptance/tests/environment/use_enc_environment_for_files.rb index c210bbc43..5519550d8 100644 --- a/acceptance/tests/environment/use_enc_environment_for_files.rb +++ b/acceptance/tests/environment/use_enc_environment_for_files.rb @@ -1,72 +1,72 @@ test_name "Agent should use environment given by ENC for fetching remote files" testdir = create_tmpdir_for_user master, 'respect_enc_test' create_remote_file master, "#{testdir}/enc.rb", < true) File { ensure => directory, - mode => 770, + mode => "0770", owner => #{master.puppet['user']}, group => #{master.puppet['group']}, } file { '#{testdir}/environments':; '#{testdir}/environments/production':; '#{testdir}/environments/special/':; '#{testdir}/environments/special/manifests':; '#{testdir}/environments/special/modules':; '#{testdir}/environments/special/modules/amod':; '#{testdir}/environments/special/modules/amod/files':; } file { '#{testdir}/environments/special/modules/amod/files/testy': ensure => file, - mode => 640, + mode => "0640", content => 'special_environment', } MANIFEST master_opts = { 'main' => { 'environmentpath' => "#{testdir}/environments", 'environment_timeout' => 0, }, 'master' => { 'node_terminus' => 'exec', 'external_nodes' => "#{testdir}/enc.rb", }, } with_puppet_running_on master, master_opts, testdir do agents.each do |agent| atmp = agent.tmpdir('respect_enc_test') logger.debug "agent: #{agent} \tagent.tmpdir => #{atmp}" create_remote_file master, "#{testdir}/environments/special/manifests/different.pp", < "puppet:///modules/amod/testy", } notify { "mytemp is ${::mytemp}": } END on master, "chmod 644 #{testdir}/environments/special/manifests/different.pp" run_agent_on(agent, "--no-daemonize --onetime --server #{master} --verbose --trace") on agent, "cat #{atmp}/special_testy" do |result| assert_match(/special_environment/, result.stdout, "The file from environment 'special' was not found") end on agent, "rm -rf #{atmp}" end end diff --git a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb b/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb index bc7d4562d..22089df89 100644 --- a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb +++ b/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb @@ -1,55 +1,55 @@ test_name "Agent should use environment given by ENC for pluginsync" testdir = create_tmpdir_for_user master, 'respect_enc_test' create_remote_file master, "#{testdir}/enc.rb", < true) File { ensure => directory, - mode => 770, + mode => "0770", owner => #{master.puppet['user']}, group => #{master.puppet['group']}, } file { '#{testdir}/environments':; '#{testdir}/environments/production':; '#{testdir}/environments/special/':; '#{testdir}/environments/special/modules':; '#{testdir}/environments/special/modules/amod':; '#{testdir}/environments/special/modules/amod/lib':; '#{testdir}/environments/special/modules/amod/lib/puppet':; } file { '#{testdir}/environments/special/modules/amod/lib/puppet/foo.rb': ensure => file, - mode => 640, + mode => "0640", content => "#special_version", } MANIFEST master_opts = { 'main' => { 'environmentpath' => "#{testdir}/environments", }, 'master' => { 'node_terminus' => 'exec', 'external_nodes' => "#{testdir}/enc.rb" }, } with_puppet_running_on master, master_opts, testdir do agents.each do |agent| run_agent_on(agent, "--no-daemonize --onetime --server #{master}") on agent, "cat \"#{agent.puppet['vardir']}/lib/puppet/foo.rb\"" assert_match(/#special_version/, stdout, "The plugin from environment 'special' was not synced") on agent, "rm -rf \"#{agent.puppet['vardir']}/lib\"" end end diff --git a/acceptance/tests/ordering/master_agent_application.rb b/acceptance/tests/ordering/master_agent_application.rb index 0f9ce8bee..41cd01ca1 100644 --- a/acceptance/tests/ordering/master_agent_application.rb +++ b/acceptance/tests/ordering/master_agent_application.rb @@ -1,46 +1,46 @@ test_name "Puppet applies resources without dependencies in file order over the network" testdir = master.tmpdir('application_order') apply_manifest_on(master, <<-MANIFEST, :catch_failures => true) File { ensure => directory, - mode => 750, + mode => "0750", owner => #{master.puppet['user']}, group => #{master.puppet['group']}, } file { '#{testdir}':; '#{testdir}/environments':; '#{testdir}/environments/production':; '#{testdir}/environments/production/manifests':; '#{testdir}/environments/production/manifests/site.pp': ensure => file, - mode => 640, + mode => "0640", content => ' notify { "first": } notify { "second": } notify { "third": } notify { "fourth": } notify { "fifth": } notify { "sixth": } notify { "seventh": } notify { "eighth": } '; } MANIFEST master_opts = { 'main' => { 'environmentpath' => "#{testdir}/environments", } } with_puppet_running_on(master, master_opts) do agents.each do |agent| on(agent, puppet('agent', "--no-daemonize --onetime --verbose --server #{master} --ordering manifest")) if stdout !~ /Notice: first.*Notice: second.*Notice: third.*Notice: fourth.*Notice: fifth.*Notice: sixth.*Notice: seventh.*Notice: eighth/m fail_test "Output did not include the notify resources in the correct order" end end end