diff --git a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb b/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb index 0a3f34a1c..72a12ed33 100644 --- a/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb +++ b/acceptance/tests/environment/use_enc_environment_for_pluginsync.rb @@ -1,43 +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.puppet['vardir']}/lib/puppet/foo.rb" + 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" + on agent, "rm -rf \"#{agent.puppet['vardir']}/lib\"" end end diff --git a/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb b/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb index 076ca63d7..62cc95121 100644 --- a/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb +++ b/acceptance/tests/pluginsync/files_earlier_in_modulepath_take_precendence.rb @@ -1,49 +1,49 @@ test_name "earlier modules take precendence over later modules in the modulepath" step "Create some modules in the modulepath" basedir = master.tmpdir("module_precedence") module1libdir = "#{basedir}/1" module2libdir = "#{basedir}/2" apply_manifest_on(master, < #{master['group']}, recurse => true, require => File[mod1, mod2] } Exec { path => "/bin:/usr/bin" } exec { "mod1path": command => "mkdir -p #{module1libdir}/a/lib" } exec { "mod2path": command => "mkdir -p #{module2libdir}/a/lib" } file { "mod1": path => "#{module1libdir}/a/lib/foo.rb", content => "'from the first module'", owner => #{master['group']}, require => Exec[mod1path] } file { "mod2": path => "#{module2libdir}/a/lib/foo.rb", content => "'from the second module'", owner => #{master['group']}, require => Exec[mod2path] } MANIFEST master_opts = { 'master' => { 'modulepath' => "#{module1libdir}:#{module2libdir}", 'node_terminus' => 'plain', } } with_puppet_running_on master, master_opts, basedir do agents.each do |agent| on(agent, puppet('agent', "-t --server #{master}")) - on agent, "cat #{agent.puppet['vardir']}/lib/foo.rb" do + on agent, "cat \"#{agent.puppet['vardir']}/lib/foo.rb\"" do assert_match(/from the first module/, stdout, "The synced plugin was not found or the wrong version was synced") end end end diff --git a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb index 46972d203..28e6ed10d 100644 --- a/acceptance/tests/ticket_6541_invalid_filebucket_files.rb +++ b/acceptance/tests/ticket_6541_invalid_filebucket_files.rb @@ -1,33 +1,33 @@ test_name "#6541: file type truncates target when filebucket cannot retrieve hash" agents.each do |agent| target=agent.tmpfile('6541-target') - on agent, host_command('rm -rf #{host.puppet["vardir"]}/*bucket') + on agent, host_command("rm -rf \"#{host.puppet['vardir']}/*bucket\"") step "write zero length file" manifest = "file { '#{target}': content => '' }" apply_manifest_on(agent, manifest) step "overwrite file, causing zero-length file to be backed up" manifest = "file { '#{target}': content => 'some text' }" apply_manifest_on(agent, manifest) test_name "verify invalid hashes should not change the file" manifest = "file { '#{target}': content => '{md5}notahash' }" apply_manifest_on(agent, manifest) do assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") end test_name "verify valid but unbucketed hashes should not change the file" manifest = "file { '#{target}': content => '{md5}13ad7345d56b566a4408ffdcd877bc78' }" apply_manifest_on(agent, manifest) do assert_no_match(/content changed/, stdout, "#{agent}: shouldn't have overwrote the file") end test_name "verify that an empty file can be retrieved from the filebucket" manifest = "file { '#{target}': content => '{md5}d41d8cd98f00b204e9800998ecf8427e' }" apply_manifest_on(agent, manifest) do assert_match(/content changed '\{md5\}552e21cd4cd9918678e3c1a0df491bc3' to '\{md5\}d41d8cd98f00b204e9800998ecf8427e'/, stdout, "#{agent}: shouldn't have overwrote the file") end end diff --git a/acceptance/tests/ticket_6734_6256_5530_5503.rb b/acceptance/tests/ticket_6734_6256_5530_5503.rb index 32d8b86cd..04419ed22 100644 --- a/acceptance/tests/ticket_6734_6256_5530_5503.rb +++ b/acceptance/tests/ticket_6734_6256_5530_5503.rb @@ -1,12 +1,12 @@ # Puppet master fails to start due to impropper # permissons on the puppet/ dir. Specially, the rrd # sub dir is not created when puppet master starts test_name "Tickets 6734 6256 5530 5503i Puppet Master fails to start" with_puppet_running_on master, {} do step "Check permissions on puppet/rrd/" - on master, "ls -l #{master.puppet['vardir']} | grep rrd | awk '{print $3\" \"$4}'" do + on master, "ls -l \"#{master.puppet['vardir']}\" | grep rrd | awk '{print $3\" \"$4}'" do assert_match(/#{master['group']} #{master['group']}/, stdout, "puppet/rrd does not exist/wrong permissions") end end diff --git a/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb b/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb index f6c23ca83..bdd98e414 100644 --- a/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb +++ b/acceptance/tests/ticket_9862_puppet_runs_without_service_user_or_group_present.rb @@ -1,65 +1,65 @@ test_name "#9862: puppet runs without service user or group present" # puppet doesn't try to manage ownership on windows. confine :except, :platform => 'windows' require 'puppet/acceptance/temp_file_utils' extend Puppet::Acceptance::TempFileUtils initialize_temp_dirs def assert_ownership(agent, location, expected_user, expected_group) on(agent, "stat --format '%U:%G' #{location}") do assert_match(/#{expected_user}:#{expected_group}/, stdout) end end def missing_directory_for(agent, dir) agent_dir = get_test_file_path(agent, dir) on agent, "rm -rf #{agent_dir}" agent_dir end teardown do agents.each do |agent| step "ensure puppet resets it's user/group settings" on agent, puppet('apply', '-e', '"notify { puppet_run: }"') - on agent, "find #{agent.puppet['vardir']} -user existinguser" do + on agent, "find \"#{agent.puppet['vardir']}\" -user existinguser" do assert_equal('',stdout) end on agent, puppet('resource', 'user', 'existinguser', 'ensure=absent') on agent, puppet('resource', 'group', 'existinggroup', 'ensure=absent') end end step "when the user and group are missing" agents.each do |agent| logdir = missing_directory_for(agent, 'log') on agent, puppet('apply', '-e', '"notify { puppet_run: }"', '--logdir', logdir, '--user', 'missinguser', '--group', 'missinggroup') do assert_match(/puppet_run/, stdout) assert_ownership(agent, logdir, 'root', 'root') end end step "when the user and group exist" agents.each do |agent| logdir = missing_directory_for(agent, 'log') on agent, puppet('resource', 'user', 'existinguser', 'ensure=present') on agent, puppet('resource', 'group', 'existinggroup', 'ensure=present') on agent, puppet('apply', '-e', '"notify { puppet_run: }"', '--logdir', logdir, '--user', 'existinguser', '--group', 'existinggroup') do assert_match(/puppet_run/, stdout) assert_ownership(agent, logdir, 'existinguser', 'existinggroup') end end