Debian Codegraph @

spec/acceptance/beaker/git/clone/clone_repo_with_excludes_in_repo.rb

raw
1 test_name 'C3507 - clone repo with excludes in repo'
2
3 # Globals
4 repo_name = 'testrepo_with_excludes_in_repo'
5 exclude1 = 'file1.txt'
6 exclude2 ='file2.txt'
7
8 hosts.each do |host|
9 tmpdir = host.tmpdir('vcsrepo')
10 step 'setup - create repo' do
11 git_pkg = 'git'
12 if host['platform'] =~ /ubuntu-10/
13 git_pkg = 'git-core'
14 end
15 install_package(host, git_pkg)
16 my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
17 scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir)
18 on(host, "cd #{tmpdir} && ./create_git_repo.sh")
19 end
20
21 teardown do
22 on(host, "rm -fr #{tmpdir}")
23 end
24
25 step 'clone repo with excludes in repo with puppet' do
26 pp = <<-EOS
27 vcsrepo { "#{tmpdir}/#{repo_name}":
28 ensure => present,
29 source => "file://#{tmpdir}/testrepo.git",
30 provider => git,
31 excludes => [ '#{exclude1}', '#{exclude2}' ],
32 }
33 EOS
34
35 apply_manifest_on(host, pp, :catch_failures => true)
36 apply_manifest_on(host, pp, :catch_changes => true)
37 end
38
39 step 'verify exludes are known to git' do
40 on(host, "cat #{tmpdir}/#{repo_name}/.git/info/exclude") do |res|
41 fail_test('exclude not found') unless res.stdout.include? "#{exclude1}"
42 fail_test('exclude not found') unless res.stdout.include? "#{exclude2}"
43 end
44 end
45
46 end