Debian Codegraph @

spec/acceptance/beaker/git/shallow_clone/negative/shallow_clone_overflow_depth.rb

raw
1 test_name 'C3606 - shallow clone repo depth overflow 64bit integer'
2
3 # Globals
4 repo_name = 'testrepo_shallow_clone'
5
6 pending_test("The overflow can't be handled on some git versions")
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 'shallow clone repo with puppet (bad input ignored, full clone checkedout)' do
26 pp = <<-EOS
27 vcsrepo { "#{tmpdir}/#{repo_name}":
28 ensure => present,
29 source => "file://#{tmpdir}/testrepo.git",
30 provider => git,
31 depth => 18446744073709551616,
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 checkout is NOT shallow' do
40 on(host, "ls #{tmpdir}/#{repo_name}/.git/") do |res|
41 fail_test('shallow not found') if res.stdout.include? "shallow"
42 end
43 end
44
45 end