1 test_name 'C3479 - shallow clone repo minimal depth = 1 (http protocol)'
4 repo_name = 'testrepo_shallow_clone'
7 ruby = (host.is_pe? && '/opt/puppet/bin/ruby') || 'ruby'
8 tmpdir = host.tmpdir('vcsrepo')
9 step 'setup - create repo' do
10 install_package(host, 'git')
11 my_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../../..'))
12 scp_to(host, "#{my_root}/acceptance/files/create_git_repo.sh", tmpdir)
13 on(host, "cd #{tmpdir} && ./create_git_repo.sh")
16 step 'setup - start http server' do
19 server = WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => "#{tmpdir}")
23 create_remote_file(host, '/tmp/http_daemon.rb', http_daemon)
24 on(host, "#{ruby} /tmp/http_daemon.rb")
28 on(host, "rm -fr #{tmpdir}")
29 on(host, 'ps ax | grep "#{ruby} /tmp/http_daemon.rb" | grep -v grep | awk \'{print "kill -9 " $1}\' | sh ; sleep 1')
32 step 'shallow clone repo with puppet' do
34 vcsrepo { "#{tmpdir}/#{repo_name}":
36 source => "http://#{host}:8000/testrepo.git",
42 apply_manifest_on(host, pp, :expect_failures => true)
45 step 'git does not support shallow clone via HTTP: verify checkout is NOT created' do
46 on(host, "ls #{tmpdir}") do |res|
47 fail_test('checkout found') if res.stdout.include? "#{repo_name}"