Merge pull request #146 from daenney/mv-optional-commands
[puppet_vcsrepo.git] / spec / acceptance / beaker / git / clone / clone_repo_with_excludes_not_in_repo.rb
1 test_name 'C3508 - clone repo with excludes not in repo'
2
3 # Globals
4 repo_name = 'testrepo_with_excludes_not_in_repo'
5 exclude1 = 'worh02o'
6 exclude2 ='ho398b'
7
8 hosts.each do |host|
9   tmpdir = host.tmpdir('vcsrepo')
10   step 'setup - create repo' do
11     install_package(host, 'git')
12     my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
13     scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir)
14     on(host, "cd #{tmpdir} && ./create_git_repo.sh")
15   end
16
17   teardown do
18     on(host, "rm -fr #{tmpdir}")
19   end
20
21   step 'clone repo with excludes not in repo with puppet' do
22     pp = <<-EOS
23     vcsrepo { "#{tmpdir}/#{repo_name}":
24       ensure => present,
25       source => "file://#{tmpdir}/testrepo.git",
26       provider => git,
27       excludes => [ '#{exclude1}', '#{exclude2}' ],
28     }
29     EOS
30
31     apply_manifest_on(host, pp)
32     apply_manifest_on(host, pp)
33   end
34
35   step 'verify exludes are known to git' do
36     on(host, "cat #{tmpdir}/#{repo_name}/.git/info/exclude") do |res|
37       fail_test('exclude not found') unless res.stdout.include? "#{exclude1}"
38       fail_test('exclude not found') unless res.stdout.include? "#{exclude2}"
39     end
40   end
41
42 end