Debian Codegraph @

spec/acceptance/beaker/git/clone/negative/clone_repo_with_exec_excludes.rb

raw
1 test_name 'C3509 - clone repo with excludes not in repo'
2 skip_test 'expectations not defined'
3
4 # Globals
5 repo_name = 'testrepo_with_excludes_not_in_repo'
6 exclude1 = "`exec \"rm -rf /tmp\"`"
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 not 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}' ],
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 excludes 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 end
43 end
44
45 end