summaryrefslogtreecommitdiff
path: root/spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_excludes.rb
diff options
context:
space:
mode:
authorJohn Duarte <john.duarte@puppetlabs.com>2014-05-09 11:13:40 -0700
committerJohn Duarte <john.duarte@puppetlabs.com>2014-05-18 11:38:18 -0700
commit60d5e83205a38f714ae678142e14a0d223076028 (patch)
tree8dd2690f8a30b3b0d8b59b6de2759524fe43b459 /spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_excludes.rb
parent85073a856bc69d7b63ebc3993ab1cda6fcba482c (diff)
downloadpuppet-vcsrepo-60d5e83205a38f714ae678142e14a0d223076028.tar.gz
puppet-vcsrepo-60d5e83205a38f714ae678142e14a0d223076028.tar.bz2
Add beaker tests for git clone
Diffstat (limited to 'spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_excludes.rb')
-rw-r--r--spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_excludes.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_excludes.rb b/spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_excludes.rb
new file mode 100644
index 0000000..4e04c78
--- /dev/null
+++ b/spec/acceptance/beaker/clone/negative/clone_repo_with_hostile_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 = '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