From eeb52c491869c7916758b4d878018ef4df460bf3 Mon Sep 17 00:00:00 2001 From: John Duarte Date: Mon, 12 May 2014 11:27:37 -0700 Subject: Fix exec test for clone --- .../negative/clone_repo_with_exec_excludes.rb | 40 ++++++++++++++++++++++ .../negative/clone_repo_with_hostile_excludes.rb | 40 ---------------------- 2 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb delete mode 100644 spec/acceptance/beaker/git/clone/negative/clone_repo_with_hostile_excludes.rb diff --git a/spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb b/spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb new file mode 100644 index 0000000..2ab213c --- /dev/null +++ b/spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb @@ -0,0 +1,40 @@ +test_name 'C3509 - clone repo with excludes not in repo' + +# Globals +repo_name = 'testrepo_with_excludes_not_in_repo' +exclude1 = "'exec 'rm -rf /tmp'" + +hosts.each do |host| + tmpdir = host.tmpdir('vcsrepo') + step 'setup - create repo' do + install_package(host, 'git') + my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) + scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) + on(host, "cd #{tmpdir} && ./create_git_repo.sh") + end + + teardown do + on(host, "rm -fr #{tmpdir}") + end + + step 'clone repo with excludes not in repo with puppet' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + excludes => [ '#{exclude1}' ], + } + EOS + + apply_manifest_on(host, pp) + apply_manifest_on(host, pp) + end + + step 'verify excludes are known to git' do + on(host, "cat #{tmpdir}/#{repo_name}/.git/info/exclude") do |res| + fail_test('exclude not found') unless res.stdout.include? "#{exclude1}" + end + end + +end diff --git a/spec/acceptance/beaker/git/clone/negative/clone_repo_with_hostile_excludes.rb b/spec/acceptance/beaker/git/clone/negative/clone_repo_with_hostile_excludes.rb deleted file mode 100644 index 6331840..0000000 --- a/spec/acceptance/beaker/git/clone/negative/clone_repo_with_hostile_excludes.rb +++ /dev/null @@ -1,40 +0,0 @@ -test_name 'C3509 - clone repo with excludes not in repo' - -# Globals -repo_name = 'testrepo_with_excludes_not_in_repo' -exclude1 = 'rm -rf /tmp' - -hosts.each do |host| - tmpdir = host.tmpdir('vcsrepo') - step 'setup - create repo' do - install_package(host, 'git') - my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..')) - scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir) - on(host, "cd #{tmpdir} && ./create_git_repo.sh") - end - - teardown do - on(host, "rm -fr #{tmpdir}") - end - - step 'clone repo with excludes not in repo with puppet' do - pp = <<-EOS - vcsrepo { "#{tmpdir}/#{repo_name}": - ensure => present, - source => "file://#{tmpdir}/testrepo.git", - provider => git, - excludes => [ '#{exclude1}' ], - } - EOS - - apply_manifest_on(host, pp) - apply_manifest_on(host, pp) - end - - step 'verify excludes are known to git' do - on(host, "cat #{tmpdir}/#{repo_name}/.git/info/exclude") do |res| - fail_test('exclude not found') unless res.stdout.include? "#{exclude1}" - end - end - -end -- cgit v1.2.3