diff --git a/acceptance/tests/environment/use_enc_environment_for_files.rb b/acceptance/tests/environment/use_enc_environment_for_files.rb index 5f3dc6dd0..357d1a8ff 100644 --- a/acceptance/tests/environment/use_enc_environment_for_files.rb +++ b/acceptance/tests/environment/use_enc_environment_for_files.rb @@ -1,60 +1,63 @@ test_name "Agent should use environment given by ENC for fetching remote files" testdir = master.tmpdir('respect_enc_test') create_remote_file master, "#{testdir}/enc.rb", < { 'node_terminus' => 'exec', 'external_nodes' => "#{testdir}/enc.rb", 'filetimeout' => 1 }, 'special' => { 'modulepath' => "#{testdir}/special", 'manifest' => "#{testdir}/different.pp" } } +if master.is_pe? + master_opts['special']['modulepath'] << ":#{master['sitemoduledir']}" +end 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}/different.pp", < "puppet:///modules/amod/testy", } notify { "mytemp is ${::mytemp}": } END on master, "chmod 644 #{testdir}/different.pp" sleep 2 # Make sure the master has time to reload the file 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 e1e54f8c9..05902a37e 100644 --- a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb +++ b/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb @@ -1,40 +1,43 @@ test_name "Agent should use environment given by ENC for pluginsync" testdir = master.tmpdir('respect_enc_test') create_remote_file master, "#{testdir}/enc.rb", < { 'node_terminus' => 'exec', 'external_nodes' => "#{testdir}/enc.rb" }, 'special' => { 'modulepath' => "#{testdir}/special" } } +if master.is_pe? + master_opts['special']['modulepath'] << ":#{master['sitemoduledir']}" +end on master, "mkdir -p #{testdir}/modules" # Create a plugin file on the master on master, "mkdir -p #{testdir}/special/amod/lib/puppet" create_remote_file(master, "#{testdir}/special/amod/lib/puppet/foo.rb", "#special_version") on master, "chown -R #{master['user']}:#{master['group']} #{testdir}" on master, "chmod -R g+rwX #{testdir}" 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['puppetvardir']}/lib/puppet/foo.rb" assert_match(/#special_version/, stdout, "The plugin from environment 'special' was not synced") on agent, "rm -rf #{agent['puppetvardir']}/lib" end end