summaryrefslogtreecommitdiff
path: root/spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb')
-rw-r--r--spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb40
1 files changed, 40 insertions, 0 deletions
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